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

plotscript not working

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
gagekilmer
Ninja... nuff said




Joined: 09 Jan 2013
Posts: 53

PostPosted: Tue May 21, 2013 8:05 am    Post subject: plotscript not working Reply with quote

so I am trying to increase my character (kenryku) fire stat. it compiles the script, I have it set to run after a text box, the text box comes up but the stat never increases. Here is my script

plotscript, NinLevelFire, Begin
variable (who)
who := find hero (hero:Kenryoku)
variable (oldstat)
oldstat := get hero stat (hero:kenryoku, stat:Fire, current stat)
set hero stat (hero:kenryoku, stat:Fire, oldstat + 5, current stat)
end

I tried also replacing current stat with maximum and base, and none of these show a change in the stats in the status menu.
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: Tue May 21, 2013 8:49 am    Post subject: Reply with quote

This article tells you more http://rpg.hamsterrepublic.com/ohrrpgce/Permanent_Stat-Boosters
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: Tue May 21, 2013 10:26 am    Post subject: Reply with quote

The bug in your script is that you twice wrote "hero:kenryoku" instead of "who".

Also, you should usually use 'base stat' for permanent changes.

Code:
oldstat := get hero stat (who, stat:Fire, base stat)
set hero stat (who, stat:Fire, oldstat + 5, base stat)

_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
gagekilmer
Ninja... nuff said




Joined: 09 Jan 2013
Posts: 53

PostPosted: Tue May 21, 2013 10:45 am    Post subject: Reply with quote

Bob I go my information from there in the first place, before I asked it here. An thanks TMC, for correcting my script but there still hasn't been any changes in its behavior, I also raised the max stat by the same amount before I raised the base and still nothing, it's acting like the script isn't running
Back to top
View user's profile Send private message Send e-mail
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Tue May 21, 2013 11:06 am    Post subject: Reply with quote

Oh, my mistake. What I said was wrong, and so is that article (partially). I have been meaning to clean up that article actually.

Unfortunately for historical reasons HP and MP act differently to the other stats, and it's a huge pain. The status menu displays the current value of each stat. You want to modify both the current value and the maximum or base value (max and base are tied together so you should only change one of them).

One correct way to increase a stat is like this:
Code:
script, increase hero stat, who, stat, amount, begin
  variable (old base, new max)
  # Increase base and maximum values
  old base := get hero stat (who, stat, base stat)
  set hero stat (who, stat, old base + 5, base stat)
  # Update current value
  new max := get hero stat (who, stat, maximum stat)
  set hero stat (who, stat, new max, current stat)
end


(Well it's possible to write it in a simpler way as you may have seen elsewhere, but by using base instead of max allows handling stat caps properly)
_________________
"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