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

pick hero..

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
AdrianX
..yeah.




Joined: 13 Feb 2003
Posts: 286
Location: Batangas City,Philippines

PostPosted: Wed Mar 10, 2004 3:23 am    Post subject: pick hero.. Reply with quote

..hello.i was wondering, how do we use the "pick hero" plotscript command?someone please explain and put a very short and simple example on when to use it?..
..also,i've asked this question two or three times before, gets an answer,but always forget about it:how can i use the "multiple ifs"?i mean,something like,if () and if () then..hope you know what i mean..
thanx!!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Aethereal
SHUT UP.
Elite Designer
Elite Designer



Joined: 04 Jan 2003
Posts: 928
Location: Gone! I pop in on occasion though.

PostPosted: Wed Mar 10, 2004 6:51 am    Post subject: Reply with quote

I can answer both of your questions.

The pickhero() function pulls up a box that lets the player select a hero and the hero that they picked is returned by the function. Let's say you were scripting some kind of minigame that only one hero can participate in, but you want the player to be able to choose which hero will participate in it, and you have three heroes in your party. This is how you would use pickhero():
Code:

if (pickhero == 0)
then(
        #Do stuff so that hero 0 is the hero in the minigame
        end
if (pickhero == 1)
then(
        #Do stuff so that hero 1 is the one in the minigame
        end
if (pickhero == 2)
then(
        #Blah blah hero 2
        end
end

As for multiple Ifs, it would be accomplished like this. Let's say you want something to happen only if tags 3 and 4 are both on. This is what you would write:
Code:

if (checktag(3))
then(
        if (checktag(4))
        then(
                #Do stuff
                end
        end
end

_________________
Back to top
View user's profile Send private message Send e-mail AIM Address
Mr B




Joined: 20 Mar 2003
Posts: 382

PostPosted: Wed Mar 10, 2004 10:43 am    Post subject: Reply with quote

Or, for the second question, you could just do:
Code:

if(checktag(3),and,checktag(4)) then
(
  #do stuff
)
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Mar 10, 2004 12:31 pm    Post subject: a problem with this example Reply with quote

Aethereal wrote:

Code:

if (pickhero == 0)
then(
        #Do stuff so that hero 0 is the hero in the minigame
        end
if (pickhero == 1)
then(
        #Do stuff so that hero 1 is the one in the minigame
        end
if (pickhero == 2)
then(
        #Blah blah hero 2
        end
end



There is a problem with this example. It would pop up the hero picking box three times, once for each use of the "pick hero" command. To pop the hero picker box up only once, you should store the result of "pick hero" in a variable.

Code:

variable(who)
who:=pickhero
if (who == 0)
then(
        #Do stuff so that hero 0 is the hero in the minigame
        end
if (who == 1)
then(
        #Do stuff so that hero 1 is the one in the minigame
        end
if (who == 2)
then(
        #Blah blah hero 2
        end
end
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Wed Mar 10, 2004 10:41 pm    Post subject: Reply with quote

I further point out that when Aeth wrote

Code:
if (checktag(3))
then(
        if (checktag(4))
        then(
                #Do stuff
                end
        end
end


He stuck an extra 'end' in there. Remove the first end. Personally, I think it looks nicer to use )'s with ('s and end's with then's.

Also, something you might more commonly use nested ifs for (as opposed to combining them like Mr B said) would be in something like this:
Code:

if (checktag(3))
then (
        if (hero hp <= 0)
        then (
                #Do stuff
        )
        if (hero hp >> 0, and, hero hp <= 10)
        then ( 
                #Do stuff
        )
        if (hero hp >> 10)
        then (
                #Do stuff
        )
)

_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Aethereal
SHUT UP.
Elite Designer
Elite Designer



Joined: 04 Jan 2003
Posts: 928
Location: Gone! I pop in on occasion though.

PostPosted: Thu Mar 11, 2004 6:36 am    Post subject: Reply with quote

I put in the extra end to signify the end of the script, not the end of a block of if-then code. Thanks for pointing out my mistake though, James.
_________________
Back to top
View user's profile Send private message Send e-mail AIM Address
junahu
Custom Title: 45 character limit




Joined: 13 Jan 2004
Posts: 369
Location: Hull, England

PostPosted: Thu Mar 11, 2004 7:39 am    Post subject: Reply with quote

I was wondering about pick hero for a while. Like maybe I could use it to make more complicated choices (rather than the pathetic 2 choices a text box provides)
_________________
Back to top
View user's profile Send private message Send e-mail
Shineyest
What I say is what I am




Joined: 10 Mar 2004
Posts: 21
Location: Here

PostPosted: Thu Mar 11, 2004 9:25 am    Post subject: Reply with quote

That might not be a good idea because you could do a script working on a text box and then you press a number to pick a choice
_________________
I am making a game about thieves
Back to top
View user's profile Send private message Send e-mail MSN Messenger
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Thu Mar 11, 2004 9:45 pm    Post subject: Reply with quote

Well, Aeth, you didn't make it very clear. If you had put in a script header I would know what the extra end was for.

Using 'key is pressed' is indeed an easy way to get the player to select a choice. Using 'pick hero' would look much nicer.. but it's so annoying to swap out all the heros with icon graphics... : \
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
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