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

Help with permanently altering stats...

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




Joined: 08 Aug 2003
Posts: 606

PostPosted: Wed Sep 17, 2003 4:38 am    Post subject: Help with permanently altering stats... Reply with quote

I want to have some items in my game that permanently increase a hero's stats. Originally, I had the items linked to an attack that healed the maxstat by five, with the bitset "cure can exceed maximum" set to on. This worked fine, but I noticed that if the hero equipped a different weapon or if the hero in battle used a spell meant to temporarily increase his stats, the max stat reverted back to what it would've been had the hero not used the stat increasing item.

For plan b, I linked the stat increasing items to text boxes that ran scripts that increased the max stat, like so...

script, upattack, begin
variable(x)
x:=get hero stat(0,stat:Attack,maximum stat)
x:=x+5
set hero stat(0,stat:Attack,x,maximum stat)
end

For some reason, this doesn't work at all (the appropriate text box is displayed, but the hero's stats are unchanged). Even if I can get this to work, it isn't a perfect solution as the stat increasing items will have the same problem if they're used in battle (ie, stat increases in battle will revert).

Does anyone have a solution to this problem, or at least a reason why my plotscript seems to not work? Thanks!
Back to top
View user's profile Send private message
Fenrir-Lunaris
WUT




Joined: 03 Feb 2003
Posts: 1747

PostPosted: Wed Sep 17, 2003 5:31 am    Post subject: Reply with quote

Download Cube's plotscript library, and create a script as follows:

Code:
script,hptab,begin
 Add To Stat (0,stat:HP,250)
end


This script adds 250 to the party leader's HP (whoever is in slot Zero) when run, and should be a permanent addition. Create an item that links to a textbox, say, 100. Then go into the textbox editor and chose to link that textbox to run the script immediately after it. Not during, but after. Then it should work. However you can't run scripts in battle, so you'll have to make an attack for the item to raise the stats in combat anyway.

I've tried this out in TSSE (not the release that's publicly available yet) and the changes are permanent, so no need to worry about that.
Back to top
View user's profile Send private message
Cube
Dimensional Traveller




Joined: 02 Feb 2003
Posts: 294

PostPosted: Wed Sep 17, 2003 9:06 am    Post subject: Reply with quote

Also, to just add a little to that particular command. It is possible to also subtract numbers from a stat using "Add to Stat". This is done by adding negatives to the number:

Add To Stat (0,stat:HP,-250)

So, the stat will go down by 250. So what if you have a number from somethings else and want to subtact that amount (Say, you obtained the STR value from a character and needed to subtract that amount from another stat for some reason), then you simple multiply that number by -1:

Add To Stat (0,stat:HP,number*-1)

So yay, that's how you do subtractions (Technically it's still addition, but don't worry about that detail Wink ). Nobody has asked, I know, but I thought that some people may not have thought of this since it DOES say "ADD to Stat".
Back to top
View user's profile Send private message
Setu_Firestorm
Music Composer




Joined: 26 Mar 2003
Posts: 2566
Location: Holiday. FL

PostPosted: Thu Sep 18, 2003 1:28 am    Post subject: Reply with quote

Hrm..did I miss something? I never knew there was an Add to Stat command. Hm! Guess that shows how much I know. Raspberry!
_________________


Facebook: http://www.facebook.com/georgerpowell
Newgrounds: http://setu-firestorm.newgrounds.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Camdog




Joined: 08 Aug 2003
Posts: 606

PostPosted: Thu Sep 18, 2003 2:15 am    Post subject: Reply with quote

It isn't a command built into hamsterspeak, it's a user defined function in Cube's plotscript library.

I downloaded your library and checked out the code, Cube. I didn't end up actually using it, but checking out your code helped me figure out where I was going wrong, so thanks!
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: Thu Sep 18, 2003 8:51 am    Post subject: A bug Reply with quote

If an item increases a stat outside of battle, the effect is supposed to be permanent. If that is not happening, then it is a bug.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Camdog




Joined: 08 Aug 2003
Posts: 606

PostPosted: Fri Sep 19, 2003 1:10 am    Post subject: Reply with quote

Don't worry, I didn't find a bug. The permanent effect works fine outside of battle (now that I've fixed my plotscript). I was just hoping there was a way to make it a permanent effect if used in battle as well.
Back to top
View user's profile Send private message
JSH357




Joined: 02 Feb 2003
Posts: 1705

PostPosted: Sat Oct 18, 2003 3:40 pm    Post subject: Reply with quote

James: A few updates ago, I tried making an item that used an attack to
raise Strength by one permanently. It worked, but when the hero
leveled up, the stat reset. I don't know for sure if it's the same way
now, but it's possible.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Flamer
The last guy on earth...




Joined: 04 Feb 2003
Posts: 725
Location: New Zealand (newly discovered)

PostPosted: Sat Oct 18, 2003 6:12 pm    Post subject: Reply with quote

maybe it's something to do with "allow to exceed maximum" bitset.
i saw another situation like this and the user (i forgot who) did the same thing with the attack to "allow to exceed maximum" bitset set.
_________________
If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch Raspberry!
(no offense to anyone that was mentioned)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Guest







PostPosted: Mon Oct 20, 2003 11:06 am    Post subject: Reply with quote

Um, I think that this problem (the stat resetting on levelup) is rather hard to work around (not hard, but it's work). Ya see, every time that a levelup occurs, the stats are recalcuated based on the original information given by the creator in custom.exe.

From what I understand, if a hero gained ~ 10 HP/level, and you used plotscripting to add 100 HP, that plotscript change would stay there, but the actual HP won't increase until for 10 levels (for /level increases).

However, this won't happen if there is no change in the stats (level 0 HP = 10, level 99 HP = 10). If you have it like that, then no changes will occur in HP on levelup. Use an instead-of-battle script to check for level changes, and then do the /level stat alterations by plotscripting.

Did that make any sense? Rolling Eyes
Back to top
Mr B




Joined: 20 Mar 2003
Posts: 382

PostPosted: Mon Oct 20, 2003 11:08 am    Post subject: Reply with quote

Garg, I thought that I was logged in. I was before. It must have logged me out after 15 minutes, but let me post anyway. As it is, I wrote the 'guest' post (just so you know whom to blame Raspberry!)
Back to top
View user's profile Send private message
Mad Cacti (also guest :P)
Guest






PostPosted: Tue Oct 21, 2003 10:19 pm    Post subject: Reply with quote

Actually, James has stated on many occasions that on level up custom calculates the normal differents between a stat for the current level and the level up level, and adds this different to the stat.

So a hero if no level 10, and the speed stat would normally be 15, and at level 11 it would be 17, custom calculates 17 - 15 and adds 2 to the speed stat when the hero levels up to L11, even if the speed stat is currently 100 and not 15. So I don't know what your problem is...
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