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

SetHeroStat problem

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Awful Waffle




Joined: 18 Jun 2003
Posts: 73
Location: Canada

PostPosted: Thu Mar 29, 2007 11:19 pm    Post subject: SetHeroStat problem Reply with quote

The stat changes I make to a hero in my game using SetHeroStat seem to be over-written when I level-up or equip an item that changes stats. It reverts the stats back to their "base course" that the min and max determine I set in custom.exe, and then calculates the offset of the item or level, but not the changes with SetHeroStat. The exception is with "HP" and "MP" which work just fine.

I got over the problem of stats resetting when I level by using the "after-battle" event, but the problem is now when I make equipment changes.

Hero X has 15 STR, and 5 added through script to make it 20. When I equip a weapon that adds 3 STR, it calculates from base stat of 15, and + 3 to make it 18, when it should be 23 in the end.

Hero is how i'm altering stats...

Code:

setHeroStat(findHero(hero: hero), stat:str, getHeroStat(findHero(hero: hero), stat:str, currentStat) + 5, currentStat)


Is there a way to have SetHeroStat imbedded into the hero's stats? Possibly without using a +/- stat changing item for every case? lol
Back to top
View user's profile Send private message
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



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

PostPosted: Fri Mar 30, 2007 6:53 am    Post subject: Reply with quote

You should set both the current stat and the maximum stat.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Fri Mar 30, 2007 6:57 am    Post subject: Reply with quote

Here is what you need to do:

Code:

setHeroStat(findHero(hero: hero), stat:str, getHeroStat(findHero(hero: hero), stat:str, currentStat) + 5, currentStat)
setHeroStat(findHero(hero: hero), stat:str, getHeroStat(findHero(hero: hero), stat:str, maximumStat) + 5, maximumStat)


if you want the changes to persist, you need to change both currentstat and maximumstat

...although I would probably write it like this myself:

Code:

script, increase stat, who, whichstat, amount, begin
  setHeroStat(who, whichstat, getHeroStat(who, whichstat, currentStat) + amount, currentStat)
  setHeroStat(who, whichstat, getHeroStat(who, whichstat, maximumStat) + amount, maximumStat)
end


and then you could use that as:

Code:

increase stat(find hero(hero:hero), stat:str, 5)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Awful Waffle




Joined: 18 Jun 2003
Posts: 73
Location: Canada

PostPosted: Fri Mar 30, 2007 9:47 am    Post subject: Reply with quote

Awesome thanks!

I had tried setting both current and max before, just never both at the same time Oookay...
Back to top
View user's profile Send private message
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