 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Robot Skeleton King

Joined: 20 Oct 2008 Posts: 72
|
Posted: Mon Nov 09, 2009 3:12 pm Post subject: Need a little plotscripting help |
|
|
Sorry, I'm really new to plotscripting. Here is what I need:
1. Game Over Script:
-Need to display a backdrop and then go to title screen
2. Teleporter Script (Sort of)
Ask the player if they would like to use a "token"
If they select No, nothing happens. If they say yes, then I need to first check and see if the player has a "token" in their inventory, if so remove one and then teleport the player to a certain map.
Thanks in advance!
- _________________ ---
8bitcity.blogspot.com |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Mon Nov 09, 2009 5:00 pm Post subject: |
|
|
Whoa!
Something where I can help!
For your first script, you need like three things:
Code: |
Plotscript,YOU_DEAD, begin
show backdrop(number)
wait for key (any key)
game over
end
|
For your second script, make a text box that has a choice ( you can do this in custom). Then check the tag:
Code: |
Plotscript,teleport_sort_of, begin
show text box ( number )
if ( tag number that you set == 1 ) then(
if ( inventory (item # of token) <> 0) then(
delete item (item # of token, 1)
fade screen out
teleport to map (map,X,Y)
fade screen in
)
)
end
|
That's it. If you use HSI constants (I forget how at the moment) you don't have to use the item number, but can actually type "token".
If you need to lookup any of these commands or look for new ones, look here:
http://hamsterrepublic.com/ohrrpgce/index.php/Plotscripting_Dictionary.html _________________ Working on rain and cloud formation
Last edited by Bagne on Mon Nov 09, 2009 7:41 pm; edited 1 time in total |
|
Back to top |
|
 |
Robot Skeleton King

Joined: 20 Oct 2008 Posts: 72
|
Posted: Mon Nov 09, 2009 6:33 pm Post subject: |
|
|
Thanks Bagne! One thing I'm not clear on, however, is why you called a text box before the teleport script. Shouldn't the box be called in custom? _________________ ---
8bitcity.blogspot.com |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Mon Nov 09, 2009 7:39 pm Post subject: |
|
|
Oops!
I made a typo.
The "show text box" is in the right place now.
But - that might not have answered your question.
If you're wondering why the "show text box" needs to be in the script ... well, it doesn't. There's often more than one way to do things: you could trigger the script (from an NPC or something) and then show the text box, or you could trigger the script from the text box itself.
If the latter case, then yes, you would not want to "show text box" in your script. _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Nov 13, 2009 2:31 am Post subject: |
|
|
Bagne wrote: | if ( tag number that you set == 1 ) then( |
To clarify, this should be something like
Code: | if (checktag(tag:selected yes)) then( |
(== 1 aka == true is optional)
But if you are calling the script from a text box you can skip this check: you can check the tag before calling the script in the first place.
Trivia: It's actually possible to do this without a script, by sticking an unreachable door on each map which leads to the teleport destination, and using that door from a textbox.
Code: | fade screen out
teleport to map (map,X,Y)
fade screen in |
A word of warning: this will work, because teleporttomap secretly causes a wait(1). But be aware that normally you need a wait before fade screen in/out, to redraw to screen (even if the screen palette is totally black) if you've changed something, such as displaying a textbox, changing the hero, etc.
Quote: | If you use HSI constants (I forget how at the moment) you don't have to use the item number, but can actually type "token". |
Write "item:token". See 'HSI' _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|