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

Scripting Questions

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Master K
Ex-Akatsuki Masked Ninja




Joined: 11 Jun 2011
Posts: 57
Location: Everywhere and Nowhere. Muahaha!

PostPosted: Wed Jun 29, 2011 7:32 pm    Post subject: Scripting Questions Reply with quote

Ok...here are my questions.

1. How could I implement the idea for my pet as said in Party Plight thread?

2. What do I do to make a script that sets a tag on when any hero hits a certain level?
Back to top
View user's profile Send private message
NeoSpade
Of course!




Joined: 23 Sep 2008
Posts: 249
Location: Wales GB

PostPosted: Thu Jun 30, 2011 12:30 am    Post subject: Reply with quote

I'm not that much of a plotscripting wizard but I can help you the long way (which James or someone better at this will correct me with Raspberry!)

Right so the way I'd achieve this would be by using something like this, and it'd only work for one hero at a time, basically just do that for each hero :

Code:
plotscript, herolevelis20, begin
hero0lv := get hero level (0)
hero1lv := get hero level (1)
hero2lv := get hero level (2)
hero3lv := get hero level (3)
if (hero0lv == 20) then (set tag (tag:whatever0 == ON))
if (hero1lv == 20) then (set tag (tag:whatever1 == ON))
if (hero2lv == 20) then (set tag (tag:whatever2 == ON))
if (hero3lv == 20) then (set tag (tag:whatever3 == ON))
end


I'm not 100% that this'll work (it's been a while since I did any scripting), I know it'd work for just 1 hero at a time for sure but it may block the other 3 heroes in the party.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Thu Jun 30, 2011 7:55 am    Post subject: Reply with quote

NeoSpade is on the right track, although were some errors in that script

Code:
plotscript, herolevelis20, begin
variable(hero0lv, hero1lv, hero2lv, hero3lv)
hero0lv := get hero level (0)
hero1lv := get hero level (1)
hero2lv := get hero level (2)
hero3lv := get hero level (3)
if (hero0lv == 20) then (set tag (tag:whatever0, ON))
if (hero1lv == 20) then (set tag (tag:whatever1, ON))
if (hero2lv == 20) then (set tag (tag:whatever2, ON))
if (hero3lv == 20) then (set tag (tag:whatever3, ON))
end


But my understanding is that you want to set just a single tag on when any hero is over level 20, right?

Here is a fancier script that does that

Code:
plotscript, any hero over level 20, begin
  variable(i)
  for(i, 0, 3) do( # for each hero slot in the party
    if(hero by slot(i) >= 0) then( # a hero is actually in this slot
      if(get hero level(i) >= 20) then(set tag(tag:whatever, ON))
    )
  )
end
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Master K
Ex-Akatsuki Masked Ninja




Joined: 11 Jun 2011
Posts: 57
Location: Everywhere and Nowhere. Muahaha!

PostPosted: Thu Jun 30, 2011 9:12 am    Post subject: Reply with quote

Your script doesn't work. I'll show it to you:
Quote:
Code:

plotscript, Newbie, begin
     variable(i)
     for(i, 0, 3) do( # for each hero slot in the party
       if(hero by slot(i) >= 0) then( # a hero is actually in this slot
         if(get hero level(i) >= 20) then(set tag(tag:Newbie, ON))
       )
     )
   end


It has an error come up saying that tag:Newbie has not been defined as a constant, variable, and such. My four other scripts are just copies of this one, with the level and tag changed. Also, if we get this working, where would I place the scripts? (Theres four more after this one)
Back to top
View user's profile Send private message
Rimudora
Psychopath yandere
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 26 May 2005
Posts: 335

PostPosted: Thu Jun 30, 2011 11:16 am    Post subject: Reply with quote

You'd need to export an HSI file for your game and include it to make tag:tagname work.
Back to top
View user's profile Send private message Send e-mail
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Thu Jun 30, 2011 12:03 pm    Post subject: Reply with quote

Master K wrote:
Also, if we get this working, where would I place the scripts? (Theres four more after this one)


All your scripts should be in the same file. If you have not read it yet, http://rpg.hamsterrepublic.com/ohrrpgce/Plotscripting_Tutorial might help

EDIT: I just realized you might have been asking how the scripts should be triggered in your game. The best way to do that is with an after-battle script. You have to set this on each map.

EDIT2: also, rather than having four different scripts, you could just make the one script do four checks:

Code:
plotscript, check levels, begin
  variable(i)
  for(i, 0, 3) do( # for each hero slot in the party
    if(hero by slot(i) >= 0) then( # a hero is actually in this slot
      if(get hero level(i) >= 10) then(set tag(tag:Newbie, ON))
      if(get hero level(i) >= 20) then(set tag(tag:Intermediate, ON))
      if(get hero level(i) >= 30) then(set tag(tag:Advanced, ON))
      if(get hero level(i) >= 40) then(set tag(tag:Elite, ON))
    )
  )
end
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mswguest
Guest






PostPosted: Fri Jul 01, 2011 4:22 pm    Post subject: Reply with quote

Sorry about saying I'd help and disappearing, but I've been on vacation without internet for about a week, and even now I'm still not home. I'll look at this again later and try to help out more.
Back to top
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