I am setting up some locked doors and placing keys in my map and have come up with a puzzle.
I approach a locked door (without picking up the key) and it opens.
The door is model doors/door_02 - mapmodel 85 110 11 4 0 - model #110, locked, trigger 4
The key is model tentus/key - mapmodel 174 58 12 5 0 - model #58, dissappear, trigger 5
The code within the .cfg file is:
"key1" = [0]
"level_trigger_4" = [ if ( = $key1 1 )[ trigger 4 1 ][ echo "Look behind the barrel..." ]]
"level_trigger_5" = [ key1 = 1 ]
Here is the puzzle. When I start my map, before I approach the locked door, I reset the key1 variable to 0 with /key1 = 0
Touched the door - echo message appeared - picked up the key - came back to the door and it opened. Bingo
But, if I do not reset the key1 variable to 0, and approach the door without picking up the key, the mongrel of a door opens.
I have also repeated this action on a Sauerbraten map with just the door and a key with the EXACT same code and it worked like a charm.... The door stayed locked until I picked up the key and approached the door.
Am I doing something wrong? I am going nuts trying to figure out such a simple problem.
Regards
J
Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.
In the meantime please join the new Discord Server!
If you have any questions please e-mail me through the Platinum Arts website.
In the meantime please join the new Discord Server!
If you have any questions please e-mail me through the Platinum Arts website.
Possible script problem
- johnno56
- Member
- Posts: 158
- Joined: June 12th, 2009, 4:06 am
- Name: John
- Location: Melbourne, Australia
Possible script problem
May your journey be free of incident.
Live long and prosper.
Live long and prosper.
Re: Possible script problem
Could the entity settings in the map be wrong? For example wrong trigger settings. Take care.
-mike
-mike
Sign up for our Newsletter to keep up to date with the Sandbox news!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
- johnno56
- Member
- Posts: 158
- Joined: June 12th, 2009, 4:06 am
- Name: John
- Location: Melbourne, Australia
Re: Possible script problem
Mike,
No the settings are fine. I used the sample script from the Cubescript tutorial: Example 2 - A Door Controlled by a Key (pickups)
I had all my doors set to open on approach. 110 10 4 0 (model 110, 10 = open by approach, trigger 4)
Modified one door to 110 11 4 0 - model 110, 11 = locked, trigger 4
Modified one key to 58 12 5 0 - model 58, 12 = disappear, trigger 5
If I manually set key1 = 0 prior to approaching the locked door, all works ok. Fetch the key, unlock the door.
The code in the .cfg file begins with "key1" = [0] (also tried with key1 = 0). It is as though the program is ignoring the "key1" = [0].
I ran the exact same code in sauerbraten (door model number edited to suit) and it worked without a glitch.
I am totally confused.
I have attached my .cfg file.
Regards
J
No the settings are fine. I used the sample script from the Cubescript tutorial: Example 2 - A Door Controlled by a Key (pickups)
I had all my doors set to open on approach. 110 10 4 0 (model 110, 10 = open by approach, trigger 4)
Modified one door to 110 11 4 0 - model 110, 11 = locked, trigger 4
Modified one key to 58 12 5 0 - model 58, 12 = disappear, trigger 5
If I manually set key1 = 0 prior to approaching the locked door, all works ok. Fetch the key, unlock the door.
The code in the .cfg file begins with "key1" = [0] (also tried with key1 = 0). It is as though the program is ignoring the "key1" = [0].
I ran the exact same code in sauerbraten (door model number edited to suit) and it worked without a glitch.
I am totally confused.
I have attached my .cfg file.
Regards
J
Code: Select all
//Configuration generated by Platinum Arts Sandbox 2.3.0, modify with caution
//to execute commands on a mapstart, please create an on_start alias with said commands
//to add anything, add them onto the end of the file or it's given section.
//for further information, see our wiki or catch us on IRC
exec packages/base/wolf3d010-art.cfg //load saved art assets
//world variables
shadowmapambient 0
lnjitterradius 2
cloudheight 0.2
causticmillis 75
cloudlayer []
spinsky 0.0
cloudclip 0.5
cloudfade 0.2
cloudscale 1.0
blurskylight 0
spincloudlayer 0.0
nastylava 1
lavafog 50
yawcloudlayer 0
cloudscrolly 0.0
cloudscrollx 0.0
flarelights 0
flaresize 100
cloudcolour 16777215
spinclouds 0.0
causticscale 100
flarecutoff 1000
envmapradius 128
cloudbox []
skybox [loopix/daysky]
fogcolour 8427955
maxmerge 6
yawsky 0
waterspec 150
yawclouds 0
fog 4000
cloudsubdiv 16
waterfog 150
lnjittermillis 100
blurlms 0
//mapsounds
mapsoundreset
mapsound "freesound/fireplace" 255 32767 // 0
mapsound "freesound/waterfall" 200 32767 // 1
mapsound "freesound/crickets" 200 32767 // 2
mapsound "freesound/waterdrops" 255 32767 // 3
mapsound "freesound/undertreeinrain" 175 32767 // 4
//aliases
"key1" = [0]
"level_trigger_4" = [ if ( = $key1 1 )[ trigger 4 1 ][ echo "Look behind the barrel..." ]]
"level_trigger_5" = [ key1 = 1 ]
//game data
May your journey be free of incident.
Live long and prosper.
Live long and prosper.
Re: Possible script problem
Did this problem ever get solved? Do you want to also send the map and/or a small version of the map showing just the problem? Sorry for not responding to this sooner, teaching the kids camp and game design even class for the college students at the same time was a lot more time consuming than I had imagined. But all set for the evening class anyway. Take care!
-mike
-mike
Sign up for our Newsletter to keep up to date with the Sandbox news!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
- johnno56
- Member
- Posts: 158
- Joined: June 12th, 2009, 4:06 am
- Name: John
- Location: Melbourne, Australia
Re: Possible script problem
Mike,
I think I may have figured it out.
I deleted all of my doors! I had added all of the unlocked doors to my map with a trigger of 5.
I experimented with a door that was locked with a trigger of 1 and opened it with a key of trigger 2 using the code from the tutorial. Bingo! Started adding the other unlocked doors with a trigger of 0. Still working ok. Added another locked door with trigger 3 and opened with a key with trigger 4. Bingo! Still working ok. Tested key 2 on door 1. "key needed" message popped up. So far so good....
Instead of having the text "You need a key" appearing in the top left corner of the screen, I modified the .cfg to display a gui that says "Door_1_Locked. You need a key." Then click on "Ok" to acknowledge the message and the gui disappears. Picking apart the "Village" demo helped with the gui message. The door problem was pure guess work.
My map is progressing at a painfully slow rate. I still have to finish the rest of the doors; brighten up the lighting; figure out how to put wall decorations up (pictures etc - light fittings I can kind of do); place the "furniture" in the rooms; add sound and or music etc
The plot is quite typical; Locate 5 keys, 20 coins and release the "captive". It's not a plot worthy of note, but it is my first...
Does the door "solution" sound ok to you? If there is an easier way to do it, as they say, "I'm all ears."
Regards
J
I think I may have figured it out.
I deleted all of my doors! I had added all of the unlocked doors to my map with a trigger of 5.
I experimented with a door that was locked with a trigger of 1 and opened it with a key of trigger 2 using the code from the tutorial. Bingo! Started adding the other unlocked doors with a trigger of 0. Still working ok. Added another locked door with trigger 3 and opened with a key with trigger 4. Bingo! Still working ok. Tested key 2 on door 1. "key needed" message popped up. So far so good....
Instead of having the text "You need a key" appearing in the top left corner of the screen, I modified the .cfg to display a gui that says "Door_1_Locked. You need a key." Then click on "Ok" to acknowledge the message and the gui disappears. Picking apart the "Village" demo helped with the gui message. The door problem was pure guess work.
My map is progressing at a painfully slow rate. I still have to finish the rest of the doors; brighten up the lighting; figure out how to put wall decorations up (pictures etc - light fittings I can kind of do); place the "furniture" in the rooms; add sound and or music etc
The plot is quite typical; Locate 5 keys, 20 coins and release the "captive". It's not a plot worthy of note, but it is my first...
Does the door "solution" sound ok to you? If there is an easier way to do it, as they say, "I'm all ears."
Regards
J
May your journey be free of incident.
Live long and prosper.
Live long and prosper.
Re: Possible script problem
Glad to hear it worked out! In case I never showed you, this level trigger guide on the wiki might help you out:
http://sandboxgamemaker.com/platinumart ... _mapmodel_
Sorry my responses have taken so long lately, kids camp is almost over, one more week!!! Take care.
-mike
PS Oh yeah I had some fun with doors and triggers in the teletest map in Master Chef Ogro, might be worth taking a look at.
http://sandboxgamemaker.com/platinumart ... _mapmodel_
Sorry my responses have taken so long lately, kids camp is almost over, one more week!!! Take care.
-mike
PS Oh yeah I had some fun with doors and triggers in the teletest map in Master Chef Ogro, might be worth taking a look at.
Sign up for our Newsletter to keep up to date with the Sandbox news!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
- johnno56
- Member
- Posts: 158
- Joined: June 12th, 2009, 4:06 am
- Name: John
- Location: Melbourne, Australia
Re: Possible script problem
Mike,
Thanks for the "Wiki Tip". Will come in handy. I have printed it as well as the "Village.cfg" and now use them as reference.
Now that I have the SVN version running on a small windblows disk, I will check out the doors in "Chef". By the way; I tried out the game. Excellent! Have not completed it yet, just "took it out for a test run". I am having a slight problem with some of the textures. Parts of the structures display "No Texture". Do I need to install extra textures? If so, where from?
Just as an "off topic"... "Kids Camp"?
regards
J
Thanks for the "Wiki Tip". Will come in handy. I have printed it as well as the "Village.cfg" and now use them as reference.
Now that I have the SVN version running on a small windblows disk, I will check out the doors in "Chef". By the way; I tried out the game. Excellent! Have not completed it yet, just "took it out for a test run". I am having a slight problem with some of the textures. Parts of the structures display "No Texture". Do I need to install extra textures? If so, where from?
Just as an "off topic"... "Kids Camp"?
regards
J
May your journey be free of incident.
Live long and prosper.
Live long and prosper.
- Creatorrookie
- Member
- Posts: 66
- Joined: September 22nd, 2009, 8:35 pm
- Name: John
Re: Possible script problem
Can you please display the correct cfg for this? I want to use it in my project.
The rookie in sandbox... 

- johnno56
- Member
- Posts: 158
- Joined: June 12th, 2009, 4:06 am
- Name: John
- Location: Melbourne, Australia
Re: Possible script problem
CreatorRookie,
I am relatively noobish with Sandbox and where all the files are located.
As I use Linux, I am not sure what the Windows location would be.
The village.cfg, on my PC, is located in the Sandbox/packages/base directory. I am not sure how to view or edit the .cfg file via Sandbox. All I did was to open the file in my text editor. I suppose you could use "notepad" or something similar.
I just opened the file and printed. That's it.
But word or warning!!!
If you plan to change the "Village.cfg", always, and I mean ALWAYS make a backup copy of the file BEFORE using the file.
If you change it, NEVER pass it of as your own work!!! Ask permission from the original creator and give him/her the credit that he/she deserves. After all, he/she, has spend much time in developing the code.
I will get down off my soapbox now. I hope this helps.
Regards
J
I am relatively noobish with Sandbox and where all the files are located.
As I use Linux, I am not sure what the Windows location would be.
The village.cfg, on my PC, is located in the Sandbox/packages/base directory. I am not sure how to view or edit the .cfg file via Sandbox. All I did was to open the file in my text editor. I suppose you could use "notepad" or something similar.
I just opened the file and printed. That's it.
But word or warning!!!
If you plan to change the "Village.cfg", always, and I mean ALWAYS make a backup copy of the file BEFORE using the file.
If you change it, NEVER pass it of as your own work!!! Ask permission from the original creator and give him/her the credit that he/she deserves. After all, he/she, has spend much time in developing the code.
I will get down off my soapbox now. I hope this helps.
Regards
J
May your journey be free of incident.
Live long and prosper.
Live long and prosper.