 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Sun Feb 24, 2008 10:45 am Post subject: Alas, how many times will keyval be explained? |
|
|
Okay, my little brother has experienced trouble with a part of my game where leaving a shop (by pressing SPACE or CTRL on the option 'leave') immediatelly reactivates the NPC and goes back to the shop. These are NOT normal shops, they are plotscripted. I don't see this behavior on my computer very much, might have something to do with speed of computer? Anyway, I have a script that the NPC triggers that sets up the shop. Would the following be the correct way to handle the situation?:
Code: |
plotscript, Enter Shop, whichmenu=0, begin
if(keyval(key:space)>>1, or, same for CTRL and ENTER),then
begin #THIS IS WHAT I AM CONSIDERING ADDING, BASED ON PLOTDICT
suspendplayer
suspendnpcs
gShop:=whichmenu
variable(i)
i:=openmenu(whichmenu)
get menuitem caption(first menuitem(i),5) #string 5 is the shop name!!!
closemenu(i)
swtextbox(177) #WELCOME TO SHOP
i:=openmenu(menu:EnterShop)
set menuitem caption(first menuitem(i),5)
show money string
end #END OF NEW IF
end
|
_________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Feb 26, 2008 11:30 pm Post subject: |
|
|
Yes, that's the way to use it. Just try it and see if it works. keyval doesn't really have any other use, and we should probably provide a wrapper, named... I hate this bit. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Inferior Minion Metric Ruler

Joined: 03 Jan 2003 Posts: 741 Location: Santa Barbara, CA
|
Posted: Tue Feb 26, 2008 11:44 pm Post subject: |
|
|
The Mad Cacti wrote: | Yes, that's the way to use it. Just try it and see if it works. keyval doesn't really have any other use, and we should probably provide a wrapper, named... I hate this bit. |
I don't know, TMC.
Code: | if(i hate this bit(key:space)) |
...just doesn't read as well... _________________
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Feb 26, 2008 11:57 pm Post subject: |
|
|
Well if the bit were just one position to the right, we wouldn't need a wrapper! _________________ "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
|