Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Life counter...

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
captain whatthehell
Guest






PostPosted: Thu Jan 20, 2005 4:47 pm    Post subject: Life counter... Reply with quote

I need a script that has a variable (like 100 or 1000) and can be decremented whenever an "enemy NPC" touches you. When the varaible hits zero the game runs a gameover script... How whould that be set up???
Back to top
Guest







PostPosted: Thu Jan 20, 2005 4:49 pm    Post subject: Reply with quote

kind of like what was on smokey magoo???
Back to top
RPGCreations
E Pluribus Unum




Joined: 18 May 2003
Posts: 345

PostPosted: Thu Jan 20, 2005 6:13 pm    Post subject: Reply with quote

on mapload, define a global variable.

Now, have the NPC activated to touch, and have it run a script that does

set global variable ( globvar , globvar -- 1 )

you can also do the check for the gameover in that too, if you want.
_________________
Back to top
View user's profile Send private message
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Fri Jan 21, 2005 11:44 am    Post subject: Reply with quote

I don't think that you can define global variables within a script. You define them in the master script text file (otherwise you would be trying to redefine the global variable everytime the script is called - not good). The rest of RPGCreation's looks good. I'd also like to point out that an NPC calling a script sends it two arguments, which you might be able to use. The first is defined by you in Custom in the 'Edit NPC' menu in the Map Editor. This might allow you to make certain NPCs decrease the global variable more than others. The second is an automatic argument that is a reference to the NPC that called the script. Very useful if you want something to happen to the NPC when it touches you.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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