Author Topic: Fds class  (Read 3373 times)

Offline ArmorNox (Funky Dynamite)

  • Jr. Member
  • **
  • Posts: 65
Re: Fds class
« Reply #90 on: February 27, 2017, 01:51:27 PM »
sorry about the double post, but....
I probably flupped this up, but is this anywhere near close?

\(BEGIN)
name = item_SymbiotecharacterRegeneration
[OnReady] = $SET_CHARACTER_SA($CharacterContext(),"characterRegeneration","3");
[StartCombatRound] = $VAR tgt;
-$VAR currHP;
-$VAR round;
-tgt = $IndexOf($Myself());
-currHP = $GET_CHAR_HITPOINTS(tgt);
-round = $GetCombatRound();
-$IF (currHP <# 42)
-   {
-      $IF ($SA_COMBATANT_GET("timeToRegen") == "-?-?-")
-      {
-         $SET_COMBATANT_SA($Myself(),"timeToRegen",round +# 3);
-      };
-   };
-$IF (round ==# $SA_COMBATANT_GET("timeToRegen"))
-   {
-      $RETURN $SET_COMBATANT_SA($Myself(),"item_SymbiotecharacterRegeneration",$SA_PARAM_GET());
-   };
[OnUnReady] = $DELETE_CHARACTER_SA($CharacterContext(),"characterRegeneration");
-tgt = $IndexOf($Myself());
\(END)
"Where does he get those -wonderful- toys?!"
"Why, I sell my soul, of course...."

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9864
Re: Fds class
« Reply #91 on: February 27, 2017, 02:25:17 PM »
Your OnReady and OnUnReady are fine. But, you need an SA called characterRegeneration to put the StartCombatRound script.

OnReady gives an SA to the character. The SA on the character needs to do the regeneration stuff. :)

Offline ArmorNox (Funky Dynamite)

  • Jr. Member
  • **
  • Posts: 65
Re: Fds class
« Reply #92 on: February 27, 2017, 02:42:29 PM »
hmmm...
makes sense...but how do i do that?  do i need another Sa?  if so, what would it look like?
"Where does he get those -wonderful- toys?!"
"Why, I sell my soul, of course...."

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9864
Re: Fds class
« Reply #93 on: February 27, 2017, 03:18:55 PM »
Yes, you need another SA. The name is going to be the name refered to in your OnReady script.
Your new SA will have the StartCombatRound Hook in script in it. :)

Offline ArmorNox (Funky Dynamite)

  • Jr. Member
  • **
  • Posts: 65
Re: Fds class
« Reply #94 on: February 27, 2017, 06:07:17 PM »
I'm not sure i'm doing this right...or completely understanding.,...
okay...quiz time, boys and girls...
what i think you're saying is i need two SAs, one to actually give the character the Regen, the other to actually do the work...correct?
so...the actual regen SA would look like this:

\(BEGIN)
name = characterRegeneration
[StartCombatRound] = $VAR tgt;
-$VAR currHP;
-$VAR round;
-tgt = $IndexOf($Myself());
-currHP = $GET_CHAR_HITPOINTS(tgt);
-round = $GetCombatRound();
-$IF (currHP <# 42)
-   {
-      $IF ($SA_COMBATANT_GET("timeToRegen") == "-?-?-")
-      {
-         $SET_COMBATANT_SA($Myself(),"timeToRegen",round +# 3);
-      };
-   };
-$IF (round ==# $SA_COMBATANT_GET("timeToRegen"))
-   {
-      $RETURN $SET_COMBATANT_SA($Myself(),"characterRegeneration",$SA_PARAM_GET());
-   };
\(END)

The other would be only activatation/deactivation...right?  so, i would delete the code in the middle?
"Where does he get those -wonderful- toys?!"
"Why, I sell my soul, of course...."

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9864
Re: Fds class
« Reply #95 on: February 27, 2017, 06:59:31 PM »
yes. This is what you want to do. :) Give it a try. ;)

Offline ArmorNox (Funky Dynamite)

  • Jr. Member
  • **
  • Posts: 65
Re: Fds class
« Reply #96 on: March 01, 2017, 09:05:17 AM »
Okay, didn't work.  I don't think i'm doing the hook right.  By the way, do I have to put the SAs in any particular order in the Database?  And on the SA screen on the item, do I have to a qualifier in the space (i.e. a number, or a word)? 
Example:  item_SymbiotecharacterRegeneration                  3
"Where does he get those -wonderful- toys?!"
"Why, I sell my soul, of course...."

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9864
Re: Fds class
« Reply #97 on: March 01, 2017, 12:23:04 PM »
The name of the SA and the value need to be separated by a comma.

Did you import your database?

The order of the SAs in the database is arbitrary. I try to keep them in alphabetical order so that I can more easily find what I'm looking for (in case I can't remember the exact name to do a search on). The same goes for the Hooks in the SA - I list them in alphabetical order because that is how I roll. ;)

If these answers don't resolve your issue, you need to do a new/updated mini-mod.

Offline ArmorNox (Funky Dynamite)

  • Jr. Member
  • **
  • Posts: 65
Re: Fds class
« Reply #98 on: March 01, 2017, 10:15:46 PM »
okay, i'll try that and then post the code when I get time to test it again.  But a mini mod might be called for anyway.  I've been experiencing crashes not related to the coding i'm doing....
"Where does he get those -wonderful- toys?!"
"Why, I sell my soul, of course...."

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2238
Re: Fds class
« Reply #99 on: March 01, 2017, 11:07:35 PM »
Quote
a mini mod might be called for......I've been experiencing crashes

"Definitely".  Not "might".  We can't fix them if we don't
know about them.

Offline ArmorNox (Funky Dynamite)

  • Jr. Member
  • **
  • Posts: 65
Re: Fds class
« Reply #100 on: March 02, 2017, 02:49:23 PM »
"Might" was code for "definitely", Paul.  :D
Okay, after looking over the SAs, i -definitely- know I'm doing it wrong.  Unfortunately I don't know  what I'm exactly doing here.  So...assuming the characterRegeneration SA is right (I just modified the Troll one, and by modifying, i mean changing a word or two),  this is the one I used on the item itself: 

\(BEGIN)
name = item_SymbiotecharacterRegeneration
[OnReady] = $SET_CHARACTER_SA($CharacterContext(),"characterRegeneration","3");
[OnUnReady] = $DELETE_CHARACTER_SA($CharacterContext(),"characterRegeneration");
-tgt = $IndexOf($Myself());
\(END)

And here's the minimod for the crash.  I know a red Dragon is supposed to murder you, but it shouldn't murder you so hard the game crashes...hard
"Where does he get those -wonderful- toys?!"
"Why, I sell my soul, of course...."

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2238
Re: Fds class
« Reply #101 on: March 02, 2017, 03:05:21 PM »
I'll fetch the mini-mod, Eric.  Crashes are my favorite.

Unfortunately, the Data folder was pretty much empty.
No config, no BASS.dll.  no data files.  And a mal-naled
Playfile.log.
« Last Edit: March 02, 2017, 03:14:24 PM by Paul R. Stevens »

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9864
Re: Fds class
« Reply #102 on: March 02, 2017, 03:10:45 PM »
"Might" was code for "definitely", Paul.  :D
Okay, after looking over the SAs, i -definitely- know I'm doing it wrong.  Unfortunately I don't know  what I'm exactly doing here.  So...assuming the characterRegeneration SA is right (I just modified the Troll one, and by modifying, i mean changing a word or two),  this is the one I used on the item itself:
Chaingin a word or two could be a problem, depending on which word you change. ;)
 
Quote from:
\(BEGIN)
name = item_SymbiotecharacterRegeneration
[OnReady] = $SET_CHARACTER_SA($CharacterContext(),"characterRegeneration","3");
[OnUnReady] = $DELETE_CHARACTER_SA($CharacterContext(),"characterRegeneration");
-tgt = $IndexOf($Myself());
\(END)
When you write a script and then import, you should open the special abilities editor. Locate the SAs you have just added (one at a time), and select the script and press edit.
A new editor will come up with your script in it and you want to select teh testing button. It will tell you about many different kinds of errors.
For example, your OnUnReady script won't work. You have an undeclared variable -"tgt", and actually you don't need that line at all.

Quote from: ArrowNox
And here's the minimod for the crash.  I know a red Dragon is supposed to murder you, but it shouldn't murder you so hard the game crashes...hard
I'll check it out, thanks.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9864
Re: Fds class
« Reply #103 on: March 02, 2017, 03:22:14 PM »
Okay, I won't get the mini-mod. :D

Remember, a mini-mod needs a Data and a Saves folder.
The data folder needs  all the .dat and .lvl files. It also needs the config.txt, the bass.dll and the AI_Script.BLK files. And lastly, it needs a Playfile.log file.
The Saves folder needs all saved characters and saved games.

Offline ArmorNox (Funky Dynamite)

  • Jr. Member
  • **
  • Posts: 65
Re: Fds class
« Reply #104 on: March 02, 2017, 04:29:45 PM »
Okay...Super Spud won't work, okay, good to know...
hold on just a sec....
anyway...
Understood. :) FYI, I changed the name and at the last part I changed "monster_" to "character"....
Okay...completely forgot about that.  I have been trying to tinker with existing SAs, but nothing means to be working....  Anyway...if i delete  that one bit of code, it should be good?  ...Okay...program says it's good, so step 1 down.  However it says the regeneration itself code has errors in it...  So...another minimod?`
« Last Edit: March 02, 2017, 04:32:22 PM by ArmorNox (Funky Dynamite) »
"Where does he get those -wonderful- toys?!"
"Why, I sell my soul, of course...."

 

anything