More help with plotscripting

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
AzureGames
Red Slime
Posts: 49
Joined: Thu Oct 29, 2015 8:18 pm

More help with plotscripting

Post by AzureGames »

What are conditions? :???:
User avatar
kylekrack
Liquid Metal Slime
Posts: 1242
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

Can you be more specific? Do you mean conditions as in "if(condition) then(commands) else(commands)" or are you referring to something else?
My pronouns are they/them
Ps. I love my wife
AzureGames
Red Slime
Posts: 49
Joined: Thu Oct 29, 2015 8:18 pm

Plotscripting conditions

Post by AzureGames »

Here's a little something from the wiki:

while (condition) do, begin
# various things you want the script to repeat
end
# various things you want to happen after the script finishes

How do I make condition be "If player is on this map only"?
Last edited by AzureGames on Thu Feb 23, 2017 9:23 pm, edited 1 time in total.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1242
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

To accomplish that you can look in the dictionary under "Tweaking Maps." The first command, in fact, is "current map," which returns whatever map the player is in.

Assuming you want the player to be on map 0 only, the check for this should be

Code: Select all

while(current map == 0) do, begin

#things you want to do

wait(1) #This is important to include at the end of the loop. Without it your game will crash!

end
My pronouns are they/them
Ps. I love my wife
User avatar
Taco Bot
Meat, Cheese, and Silicon
Posts: 484
Joined: Fri Jul 18, 2014 12:15 am
Location: Santa Cruz
Contact:

Post by Taco Bot »

or maybe what you're looking for is something like

Code: Select all

if (current map == themap) then (
   whatever code you want to do
)
where "themap" is the name or number of the map you want
Sent from my iPhone
AzureGames
Red Slime
Posts: 49
Joined: Thu Oct 29, 2015 8:18 pm

:)

Post by AzureGames »

Thanks!
AzureGames
Red Slime
Posts: 49
Joined: Thu Oct 29, 2015 8:18 pm

New question.

Post by AzureGames »

How do I make a script repeat over and over until I leave the map?
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Use a while loop, like the one kylekrack posted. Replace the part that says "#things you want to do " with your commands.
Post Reply