Inserting a script

Iron Mike
11 Mar 2013, 14:23
I've had a lot of help here recently, and I hope I'm not stretching everyone's patience too far, but I have yet another query. If I have a list of scripts:
Print message
Show picture
Unlock door
And so on, and I want to add another between the first two, how can I do that?
Thank you

levicki
11 Mar 2013, 15:09
You click on add script in the same indentation level as the other scripts and then you can move it up and down with the arrows in the header until you get it between those two scripts where you want it to be. Bear in mind that you cannot move scripts which are part of if () switch (), etc, out of their parent script. Those you would have to delete and add in the proper place again.

Iron Mike
11 Mar 2013, 15:44
Thank you so much. That works perfectly

jaynabonne
11 Mar 2013, 17:45

Bear in mind that you cannot move scripts which are part of if () switch (), etc, out of their parent script. Those you would have to delete and add in the proper place again.



Cut and paste works well for that.

Asyranok
11 Mar 2013, 18:15
Yeah, as jay mentioned, cut and paste will work - Cut and paste becomes absolutely necessary when taking scripts from one sequence and adding them to a sequence in another object entirely. Also, each branch of a tree of scripts allows scripts within it to be reordered with the arrows, but to move the script out of one branch and into another, you will need to cut and paste.

So if you have something like this,"

(Run script)
<Initial Script Tree>
-->msg - "Hello!"

Wait for 1 second, then run script
<Script Branch 01>
------->msg - "It's nice to meet you."
------->msg - "Let's play a game."

^If you wanted to move the script message "It's nice to meet you" so that it is directly below the message, "Hello!", then you would need to cut and past it into the script branch that the "hello" message is in. However, you could simply use the reorder arrows to move the "Let's play a game" message above the "It's nice to meet you." message.

HegemonKhan
11 Mar 2013, 20:47
just when copying, cutting, and~or pasting, that you click on (use) the bloody correct edit box, lol. Maybe I'm just old and my eyes are bad, but I'm always clicking on the wrong layer of the editing boxes, laughs. Also, if you got a "nested" (indented, a long chain of code in a single script block), you got to cut or copy from the most "inside", "deepest", or "indented" of the script block first, as sometimes (or all the time), it won't capture the nested script, if you go to cut or copy the outermost script, and try to paste it. Or whatever actually, just becareful as sometimes you don't get all the code~script you want when you paste. I can't explain how it works exactly, as I have trouble with it myself, lol. As the last thing you want to do is to lose all that script code that you done through the GUI, lol.

"nesting" = "indentation" = "inside" = "deepness" = my use of: ->

also the coding of:

{ = beginning of the nested script
} = ending of the nested script

red_script (a single script block code) {
-> blue_script (nested inside of red_script) {
->-> purple_code (nested inside of blue_script)
-> }
-> yellow_script (nested inside of red_script) {
->-> orange_script (nested inside of yellow_script) {
->->-> white_script (nested inside of orange_script)
->-> }
-> }
}
one_script (another, a different, single script block code) {
-> two_script (nested inside of one_script) {
->-> three_script (nested inside of two_script)
-> }
-> four_script (nested inside of one_script) {
->-> five_script (nested inside of four_script) {
->->-> ten_script (nested inside of five_script)
->-> }
->-> eleven_script (nested inside of four_script)
-> }
-> twelve_script (nested inside of one_script)
}

<function name="character_creation_function">
msg ("What is your name?")
get input { // this will get (return) what you type in as "result", so for example: I type in HK, and "result" will be (equal to) HK
game.pov.alias = result // game.pov.alias = HK (it's algebraic substitution, the game engine substitutes in "HK" for "result")
msg ("-" + game.pov.alias) // I do this just to look the same as what is done~shown below by this code, so it looks like: - HK, and so you can see what you typed in, if you messed up your name or not, though you'd still have to start game over, lol
show menu ("What is your race?", split ("human;dwarf;elf;orc",";"), false) { // this does 4 things, the first is a message, the second is a list of choices, the third is whether you want to be able to cancel your choice, and the fourth is that it sets your choosen choice to result: your choice (human or dwarf or elf or orc) = result
game.pov.race = result // game.pov.race = your_choosen_choice
show menu ("What is your class?", split ("warrior;cleric;mage;thief",";"), false) {
game.pov.class = result
msg (game.pov.alias + " is a " + game.pov.race + " " + game.pov.class +".")
wait {
ClearScreen
}
}
}
}
</function>

<game name=testing character creation>
<gameid>fhlfnsn8383</gameid>
<version>1.0</version>
<etc etc etc>etc etc etc</etc etc etc>
<start type="script"> // this runs at the beginning of the game, think of it as like your main menu, intro, and start for your game.
character_creation_function
</start>
</game>