• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Issue(s) with ability leveling system

Status
Not open for further replies.
Level 2
Joined
Sep 14, 2008
Messages
9
Hi all,
I am starting a 1 player RPG map and have run into my first Big problem.
I have made some custom “level-able” abilities for the player to level up through a dialog system when they level up (!!None are Hero abilities!!). 2 of them work right but the other 4 do not give their “Data bonuses per-level” even though the level of the ability on the unit goes up.
5 of the abilities are based on “Item Stat Bonuses” and the 6th is based on “harvest gold and lumber”
The Attack Damage and Defense abilities work fine it is the Str, Agi, and Int that don’t work… the lumber one is more of a test than something that “needs” to work.

Right now I do not know if it is a problem with the trigger (though I doubt it) or with the abilities in the object editor... or something I am missing (most likely)

Here are the 2 triggers for the dialog leveling system.

  • Hero level
    • Events
      • Unit - A unit owned by Player 1 (Red) Gains a level
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Dialog - Clear pickskill
      • Dialog - Change the title of pickskill to What will you impro...
      • Dialog - Create a dialog button for pickskill labelled Attack
      • Set pickskillbuttons[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for pickskill labelled Defense
      • Set pickskillbuttons[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for pickskill labelled Strength
      • Set pickskillbuttons[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for pickskill labelled Agility
      • Set pickskillbuttons[4] = (Last created dialog Button)
      • Dialog - Create a dialog button for pickskill labelled Intelligence
      • Set pickskillbuttons[5] = (Last created dialog Button)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Harvestlevel Less than 4
        • Then - Actions
          • Dialog - Create a dialog button for pickskill labelled Gold Mining
          • Set pickskillbuttons[6] = (Last created dialog Button)
        • Else - Actions
          • Do nothing
      • Dialog - Show pickskill for Player 1 (Red)
  • Hero Level Buttons
    • Events
      • Dialog - A dialog button is clicked for pickskill
    • Conditions
    • Actions
      • -------- The first 2 abilities work just fine --------
      • If ((Clicked dialog button) Equal to pickskillbuttons[1]) then do (Unit - Increase Level of Hero Attack (+2) for Hero) else do (Do nothing)
      • If ((Clicked dialog button) Equal to pickskillbuttons[2]) then do (Unit - Increase Level of Hero Defense (+2) for Hero) else do (Do nothing)
      • -------- These abilities do not show up on the unit --------
      • If ((Clicked dialog button) Equal to pickskillbuttons[3]) then do (Unit - Increase Level of Hero Str (+2) for Hero) else do (Do nothing)
      • If ((Clicked dialog button) Equal to pickskillbuttons[4]) then do (Unit - Increase Level of Hero Agi (+2) for Hero) else do (Do nothing)
      • If ((Clicked dialog button) Equal to pickskillbuttons[5]) then do (Unit - Increase Level of Hero Int (+2) for Hero) else do (Do nothing)
      • -------- This harvest abilities was a test of unit ability leveling on a hero --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to pickskillbuttons[6]
        • Then - Actions
          • Unit - Increase Level of Harvest (1) for Hero
          • Set Harvestlevel = (Harvestlevel + 1)
        • Else - Actions
          • Do nothing
      • -------- The Game Text shows the current level of each ability in the Hero Var --------
      • -------- In game the Hero Var returns the right level for the ability --------
      • Game - Display to (All players) the text: (Attack Level + (String((Level of Hero Attack (+2) for Hero))))
      • Game - Display to (All players) the text: (Defense Level + (String((Level of Hero Defense (+2) for Hero))))
      • Game - Display to (All players) the text: (Harvest Level + (String((Level of Harvest (1) for Hero))))
      • Game - Display to (All players) the text: (Str Level + (String((Level of Hero Str (+2) for Hero))))
      • Game - Display to (All players) the text: (Agi Level + (String((Level of Hero Agi (+2) for Hero))))
      • Game - Display to (All players) the text: (Int Level + (String((Level of Hero Int (+2) for Hero))))
Here is the WIP map… as is... first draft...
View attachment (1)RPG_WIP1.w3x

When you level you will see the level of each ability... there are some helpful cheats built in ... just type -maphelp

If you can please help me get these working with the dialog system that would be great. Thanks in advance for any help.
 
Last edited by a moderator:
Level 12
Joined
Apr 27, 2008
Messages
1,228
Do Nothing does not leak, it simply does nothing other than call an empty function.
It cannot leak as nothing is created there.
You should not use Do Nothing in Multiple Ifs as it takes some time to call a function (0.001-0.005 seconds maybe(guessing)).

I ain't sure about the trigger(sleepy), but I would suggest rethinking this.
A player would not wish for a pesky dialog to appear in the middle of a fight with 20 creatures ;)
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
He could have a boolean to check how many point he has left, and if he has any he can make the player type something like: -spells
Then the box appears.

You can also give them a tome when they level up a ability.
This might fix your problem aswell, then again the dude needs a open slot when gaining a tome right? xD
 
Level 2
Joined
Sep 14, 2008
Messages
9
Thanks Airandius, giving the player a tome works to increase the stats... (even if their inventory is full) but doing it this way dose not show the green bonus number next to the stat. like this (21-38 +2)
The attack and defense bonus numbers show up and work just fine...

:fp: I am still hoping someone will open the map in the editor and take a look at the abilities that don't work.

For now it is fixed... although I will keep trying to make it show the green bonus numbers by using abilities instead of tomes (as that was the goal).

Thanks spiwn, (I see your point about the dialog showing up and stopping everything) now when you level there is a game text telling you to return to base camp. I have set the level dialog "popup" to check to see if the "hero" is in a region "base camp" and then run the level up dialog... So it will not run in battle... but will still be automatic for the player after they get back to their camp... I think I will add an "integer check" so that it a player will not miss a dialog if they level twice before coming back to base camp.

Thanks all,
Eamon
 
Status
Not open for further replies.
Top