• 🏆 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!

Adding Skill points at begging of game

Status
Not open for further replies.
Something like this?
  • Tr
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
      • Loop - Actions
        • Hero - Modify unspent skill points of (Picked unit): Add (250 x (Strength of (Picked unit) (Include bonuses))) points
This is what you mean by Skill Points, right?
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,196
Yes, with triggers where you do some simple maths and multiply their hero level by 250. You then set their hero stats of strength and agility to that computed value.

You will probably want to run this when you spawn the units, so eithor on map initialization or directly after they get created/trained/built.
 
Level 11
Joined
Aug 1, 2009
Messages
714
Moved to World Editor Help Zone. Need help getting started on a trigger? Triggers & Scripts is not the right place.

=Offtopic=
A lot of people was confused about this Triggers & Scripts and This Helping Board. XD. Even I got the wrong idea.

=Ontopic=
I wonder what abilities who he use... 50 levels per ability??? Now that's a lot. Then add the multiplyer.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
WARNING: Questions regarding the creation of triggers or systems go here (not in Triggers & Scripts!)

Is that confusing even a little? Seems quite straight-forward.

And on Triggers & Scripts:

Need help getting started with a trigger? If so, this is not the right place - please use the World Editor Help Zone.

If you think this is confusing, let me know what needs to be cleared up and I'll request that the notes be changed.
 
Level 8
Joined
Dec 12, 2010
Messages
280
Im trying to make it in my map where certain NPC's get 250* their level of strength and agility. anyone have a trigger that would do this?

This trigger would do the trick if the units are on the map at game start:

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Add <selected unit> to NPC_Group
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is in NPC_Group) Equal to True)) and do (Actions)
        • Loop - Actions
          • Hero - Modify Strength of (Picked unit): Add (250 x (Hero level of (Picked unit)))
You need a unit group action like the one above for each NPC on the map so they're all added to the NPC group before the pick action.

Got it?
 
Level 6
Joined
May 26, 2010
Messages
212
Something like this?
  • Tr
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
      • Loop - Actions
        • Hero - Modify unspent skill points of (Picked unit): Add (250 x (Strength of (Picked unit) (Include bonuses))) points
This is what you mean by Skill Points, right?

no i want it to ADD strength... Ok let me put it this way, i have a level 85 npc under browns (computer) control. At the very start of the game i want it to add 85*250 strength and agility
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,196
Just make a trigger that does exactly what you said?

Set unit strength to 250 * getherolevel
Set unit agility to 250 * getherolevel

There are natives to both get the level of a hero and to set the strength and agility and intelligence of a hero to any value. You can even use natives to get what value of strength or agility or intelligence a hero has with or without bonuses (green +X)
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,196
The function declerations which jass (WC3's scripting language) uses to interface with the game engine.

GUI interacts with these natives through the use of "BJ" functions (somtimes "swapped" but mostly BJ) which a lot of them do nothing more than swap the argument order of a native.
 
Level 7
Joined
Feb 26, 2011
Messages
238
Capture.jpg

I think this is what your asking for, please tell me if it works.
 
Level 6
Joined
May 26, 2010
Messages
212
Capture.jpg

I think this is what your asking for, please tell me if it works.

I edited it a little but it worked! :goblin_good_job: this is my finished trigger.
  • Extra NPC Skill ups
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to Player 12 (Brown)
            • Then - Actions
              • Hero - Modify Agility of (Picked unit): Add ((Hero level of (Picked unit)) x 250)
              • Hero - Modify Strength of (Picked unit): Add ((Hero level of (Picked unit)) x 250)
            • Else - Actions
              • Do nothing
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I edited it a little but it worked! :goblin_good_job: this is my finished trigger.
  • Extra NPC Skill ups
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to Player 12 (Brown)
            • Then - Actions
              • Hero - Modify Agility of (Picked unit): Add ((Hero level of (Picked unit)) x 250)
              • Hero - Modify Strength of (Picked unit): Add ((Hero level of (Picked unit)) x 250)
            • Else - Actions
              • Do nothing

This is the fixed trigger of yours:
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Picked unit)) Equal to Player 12 (Brown)
        • Then - Actions
          • Hero - Modify Agility of (Picked unit): Add ((Hero level of (Picked unit)) x 250)
          • Hero - Modify Strength of (Picked unit): Add ((Hero level of (Picked unit)) x 250)
        • Else - Actions
1. Add the "set bj_wantDestroyGroup = true" for cleaning Unit Group leaks
2. Remove the "Do nothing" action because it practically does nothing, so why should you add ?
It will lessen your trigger performance
 
Status
Not open for further replies.
Top