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.

Some Questions

Having issues not related to a specific Sandbox game mode? Get help here!
Please also read the rules for support when posting support requests.
Failure to comply with the forum rules may result in your topic being locked without resolution.
Firelight
Member
Member
Posts: 22
Joined: March 27th, 2010, 7:37 am
Name: Firelight
IRC Username: Firelight

Re: Some Questions

Post by Firelight »

Hey guys, thanks for the examples. :D

I'm sorry but I don't really get those examples as I really don't get the hang of the syntax =x

What if I want something to happen when I go near a model? Something like:

Code: Select all

Model A:
if $x = 0;
do something, set $x = 1;

Model B:
if $x = 0;
say something.
if $x = 1;
do something, set $x = 2;


And, I assume (read the comments :D):

Code: Select all

key1 = 0

level_trigger_1 = [
   if (> $key1 0) [ // if $key1 is larger than 0?
      trigger 1 1 //I don't get this part.
      echo "You unlock the door with the key."
   ] [
      trigger 1 0 //Not this too.
      echo "The door is locked."
   ]
]
level_trigger_2 = [
   key1 = (+ $key1 1) //Is this set $key1, $key1 + 1?
   echo "You picked up a key."
]

Sorry, but I can't seem to make it work.

I loaded the existing village map and saved it as a new map, and added 2 new mapmodel with tag trigger_level_1 and trigger_level_2. Then I created a new .cfg file and pasted the script inside. I also changed both of them to trigger type 11 and 12 respectively. When I walked near one of them, it disappeared without any messages/texts and the other one just remains there.

Anything I done wrongly?

Again, thanks for all the help!
arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Some Questions

Post by arcones »

We're basically trying to explain that (read the notes) ;) :

Code: Select all

    key1 = 0

    level_trigger_1 = [
       if (> $key1 0) [ // This is what the key1 = 0 is/equals.
          trigger 1 1 //It shows the trigger values. If you have that value, then it unlocks the door.
          echo "You unlock the door with the key."
       ] [
          trigger 1 0 //If you have this trigger value, then the door is locked.
          echo "The door is locked."
       ]
    ]
    level_trigger_2 = [
       key1 = (+ $key1 1) //This is the trigger value of the key to unlock the door. (Remember the trigger value up above?) 
       echo "You picked up a key." (Now you can unlock the door)
    ]
Hope that helps you Firelight!

Arc :geek:
Image
Want a user bar like this one? PM Leo!
User avatar
Venima
Support Team
Support Team
Posts: 259
Joined: February 17th, 2010, 4:56 am
Name: Tombstone
IRC Username: Venima
Location: Somewhere in the eternal planes between the living and the dead

Re: Some Questions

Post by Venima »

Just to be clear incase you didn't get that.

Code: Select all

    key1 = 0

    level_trigger_1 = [
       if (> $key1 0) [ // If $key1 is more than 0
          trigger 1 1 //A mapmodel with trigger tag 1 gets their value set to 1 (in this case it means the door opens)
          echo "You unlock the door with the key."
       ] [
          trigger 1 0 //A mapmodel with trigger tag 1 gets their value set to 0 (in this case it means the door closes)
          echo "The door is locked."
       ]
    ]
    level_trigger_2 = [
       key1 = (+ $key1 1) //This adds 1 to $key1. Yes I know the syntax is weird but just go with it ;p. (it sets $key1 to <$key1 + 1>) only you don't have the $ in front of the first bit
       echo "You picked up a key." (Now you can unlock the door)
    ]
Tombstone's Tournament round 2 has begun! Tombstone's Posting Tournament

Try out my: CFG Easy Text Editor (Note: still in beta)

-----Venima
Image
Image
arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Some Questions

Post by arcones »

Was I close??
Image
Want a user bar like this one? PM Leo!
User avatar
Venima
Support Team
Support Team
Posts: 259
Joined: February 17th, 2010, 4:56 am
Name: Tombstone
IRC Username: Venima
Location: Somewhere in the eternal planes between the living and the dead

Re: Some Questions

Post by Venima »

Yeah, only I thought it might be clearer if I involve the mapmodels in the explanation.
Tombstone's Tournament round 2 has begun! Tombstone's Posting Tournament

Try out my: CFG Easy Text Editor (Note: still in beta)

-----Venima
Image
Image
arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Some Questions

Post by arcones »

Okay... :) 8-)
Image
Want a user bar like this one? PM Leo!
Firelight
Member
Member
Posts: 22
Joined: March 27th, 2010, 7:37 am
Name: Firelight
IRC Username: Firelight

Re: Some Questions

Post by Firelight »

Ok, thanks to all your help, I got it to work! Thanks alot! :D

I have another question now. As I mentioned previously, how do you script a model to start following you around when triggered?

Again, thanks for those awesome solutions! Really really appreciated the help!
arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Some Questions

Post by arcones »

I wouldn't know if you script mapmodels to follow you...

However, go into fps mode. Pick any map, and enter edit mode. Hit esc and click Editing Gui. Click on "Ents". Click on, "Spawn Creature" (It'll say something like that ;) ) Then you'll have a box on the ground. Click on it. Change the number by the "Butterfly"... That will change the creature. They will follow you through open gates, around trees, etc.

NOTE: They aren't that smart. They try to get to you the fastest way possible!! They don't know about lava!! If they fall into the lava they die and you'll have to respawn them by going into edit mode then back again.

Hope that helps! :D

Arc :geek:
Image
Want a user bar like this one? PM Leo!
Firelight
Member
Member
Posts: 22
Joined: March 27th, 2010, 7:37 am
Name: Firelight
IRC Username: Firelight

Re: Some Questions

Post by Firelight »

Thanks for the reply!

I don't have to do anything else and it will automatically follow me around after spawning it?

Is there anyway to make it stay where it is until I go near it, and only then it will start following me?

And, how do I add my own creatures?

Again, I really appreciate that you spend your time explaining these to me. Thank you! :)
arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Some Questions

Post by arcones »

No Problem!

Anyway, you have to set the level trigger to make it follow you. (And yes, it will only follow you once you get near enough to trigger it ;) otherwise it'll just stand still)

As for adding your own creatures... that's tough. :| I don't know how to do that. I believe it's a matter of actually being able to code the new creature in the actual engine...

Hope that helps!

Arc :mrgreen:
Image
Want a user bar like this one? PM Leo!
Locked