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

Script troubles

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Jack
the fool




Joined: 30 Jul 2004
Posts: 773

PostPosted: Sat Nov 27, 2004 1:20 pm    Post subject: Script troubles Reply with quote

im having trouble with this script, for some reason when i go to compile it, an error comes up saying:

"Unrecognised name deletehero. It has not been defined as script, constant, variable, or anything else"

Code:
include, plotscr.hsd, Zombie.hsi

define script (1,ondeath,0)

script,ondeath,begin
if (0,0,HP) then(deletehero(0))
end


not really sure what to do, any help would be greatly appreciated
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Shadowiii
It's been real.




Joined: 14 Feb 2003
Posts: 2460

PostPosted: Sat Nov 27, 2004 2:00 pm    Post subject: Reply with quote

When using delete hero you must use it in the form of hero:name. Ex:

Delete Hero (Hero:MichaelJackson)
_________________
But enough talk, have at you!
Back to top
View user's profile Send private message Send e-mail
Jack
the fool




Joined: 30 Jul 2004
Posts: 773

PostPosted: Sat Nov 27, 2004 2:09 pm    Post subject: Reply with quote

Code:
include, plotscr.hsd, Zombie.hsi

define script (1,ondeath,0)

script,ondeath,begin
if (0,0,HP) then (delete hero (hero:0))
end


i'm still getting the same error:
Quote:
"Unrecognised name delete hero. It has not been defined as script, constant, variable, or anything else"

_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Shadowiii
It's been real.




Joined: 14 Feb 2003
Posts: 2460

PostPosted: Sat Nov 27, 2004 2:15 pm    Post subject: Reply with quote

Did you export the .hsi file from the rpg?

Did you add "include rpgname.hsi" at the beginning of your script?

Is the hero's name "0" (zero)?

If the hero's name is "Cloud", you have to put his actual name, not the number.
_________________
But enough talk, have at you!
Back to top
View user's profile Send private message Send e-mail
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Sat Nov 27, 2004 2:18 pm    Post subject: Reply with quote

It's not recognizing "delete hero," which seems to indicate it didn't load "plotscr.hsd" correctly. I'm not sure if you can do two includes on one line. Try making them two statements:

include, plotscr.hsd
include, zombie.hsi
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Jack
the fool




Joined: 30 Jul 2004
Posts: 773

PostPosted: Sat Nov 27, 2004 2:55 pm    Post subject: Reply with quote

Code:
include, plotscr.hsd
include, Zombie.hsi

define script (1,ondeath,0)

script,ondeath,begin
if (hero:Jack,0,HP) then (delete hero(hero:Jack))
end


ok, now im getting this message: "If statement has 3 conditions. It should have only one. Use and and or for complex conditions."
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Camdog




Joined: 08 Aug 2003
Posts: 606

PostPosted: Sat Nov 27, 2004 3:34 pm    Post subject: Reply with quote

The code within an if statement should resolve to a single boolean value, either true or false. The way you have it right now, there are three values that evaluate in your if statement. Instead, you should plug your numbers into the appropriate function (in this case: get hero stat) and compare the result with what you want so you'll get the much sought after boolean result.

Code:
script, ondeath, begin
if(get hero stat(hero:jack,HP) == 0) then (delete hero(hero:jack))
end


In other words, get hero stat returns the value of the stat you want, you compare it to 0, and the comparison returns true or false, which is what you need for the if statement to work.

Incidentally, just using 0 to identify the hero should work fine. Hamster Speak uses numbers as identifiers for everything. The hsi file just defines a bunch of constants that Hamster Speak changes back to numbers anyway. Using Hero:Jack instead of 0 will only make it more readable, if you care about that.
Back to top
View user's profile Send private message
Jack
the fool




Joined: 30 Jul 2004
Posts: 773

PostPosted: Sat Nov 27, 2004 3:42 pm    Post subject: Reply with quote

Big grin, got it working now, thanks for all your help!
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
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