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

Add Godly Orbs

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
As an extra twist to my map I would like to add a concept called "Orbs"

-------------------------------------------------------------------

Every 60 seconds an "Orb" is created in the middle of the map.
The Orb is neutral and has 100 HP.
The player who kills the Orb gets control of it.

If the Orb is killed by another player, that player gets control of the Orb.

(The Orbs can go back and forth in control)


When a player gets control of an Orb, a level is added to his Hero.
(Each player only has 1 hero)
If a player looses control of the Orb, the Hero looses 1 level.

----------------------------------------------------------------------

How do I make this?
 
Level 5
Joined
Nov 7, 2007
Messages
134
Event, Time - Every 60 seconds of game time
Action, Unit - Create 1 Orb for (a neutral player, or neutral hostile) at center of playable map area

-------------------------------------

Event, Unit - A Unit Dies
Condition, Unit-type - Unit-type of Dying Unit equal to Orb
Action, Unit - Create 1 Orb for Owner of Killing Unit at Position of Killing unit
Action, Hero - Set Killing unit Hero-level to Level of Killing Unit + 1 (this can be achieved through an "Arithmetic" integer value).

------------------------------------

These two triggers will make Orbs spawn and make heroes that kills orbs get a new orb for themselves and increase one level.
As for the trigger that causes units that loses an orb to decrease one level, you could store each hero in a variable each, and then do a trigger like this:

Event, Unit - A Unit Dies
Condition, Unit-type - Unit-type of Dying Unit equal to Orb
Action, General - If Owner of Dying Unit is Equal to Player 1 Then set "RedHero" Hero-level to Level of "RedHero" - 1
Action, General - If Owner of Dying Unit is Equal to Player 2 Then set "BlueHero" Hero-level to Level of "BlueHero" - 1

And so on. This should work if each player has only one hero, there might be a more efficient way to do it though, but I can't think of any right now.

EDIT: I thought of a more efficient way to do it :D

Just use the second trigger, the one where a hero gains a level for killing a Orb and gains control of the orb, and simply add one action:

Action, Unit Group - Pick every unit in Units owned by Owner of Dying Unit and do Action, Hero - Set Picked Unit Hero-level to Level of Picked Unit - 1

I think this should work to, and run more smoothly. If it does, the other trigger I made won't be necessary. But those triggers only work if every player has only one hero, but since you said that was the case there should be no problem.
 
Last edited:
Level 5
Joined
Nov 7, 2007
Messages
134
I did some testing about this, and it appears as if the hero will lose his/her highest level skill when the level is lost. If there are more than one skill on the same level, it will be the skill furthest to the left that will disappear. If they have an ultimate skill, though, it will disappear when the hero's level becomes less than 6, since that is the level required for the ultimate skill.
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
It can.

PS: To make it easier for others, I have reposted Xarxos's triggers, correctly tagged.

  • Events
    • Time - Every 60 seconds of game time
  • Conditions
  • Actions
    • Unit - Create 1 Orb for (a neutral player, or neutral hostile) at center of playable map area
  • Events
    • Unit - A Unit Dies
  • Conditions
    • Unit-type - Unit-type of Dying Unit equal to Orb
  • Actions
    • Unit - Create 1 Orb for Owner of Killing Unit at Position of Killing unit
    • Hero - Set Killing unit Hero-level to Level of Killing Unit + 1 (this can be achieved through an "Arithmetic" integer value).
  • Events
    • Unit - A Unit Dies
  • Conditions
    • Unit-type - Unit-type of Dying Unit equal to Orb
  • Actions
    • If Owner of Dying Unit is Equal to Player 1 Then set "RedHero" Hero-level to Level of "RedHero" - 1
    • If Owner of Dying Unit is Equal to Player 2 Then set "BlueHero" Hero-level to Level of "BlueHero" - 1
 
Level 5
Joined
Nov 7, 2007
Messages
134
Thank you Reaper2008, I've never figured out how to draw triggers like that here on the Hive, they allways end up looking like this:

  • Looking
  • Like
  • This
  • :(
 
Level 12
Joined
Mar 10, 2008
Messages
869
Thank you Reaper2008, I've never figured out how to draw triggers like that here on the Hive, they allways end up looking like this:

  • Looking
  • Like
  • This
  • :(

[ trigger ] tags walkthrough [ /trigger ]
Here's how to do it.

[ trigger ] (Insert trigger name here)
(insert SPACE) Events
(insert SPACE) Conditions
(insert SPACE) Actions
(insert 2 SPACES)Unit - Create 1 bla bla bla bla...
(insert 2 SPACES)Add another trigger here... w/e
(insert 2 SPACES)If / Then / Else - Multiple
(insert 3 SPACES (OMG!!!))If - Conditions
(insert 3 SPACES)Then - Actions
(insert 4 SPACES)Do something
(insert 3 SPACES)Else - Actions
(insert 4 SPACES)Do Nothing (I do not suggest using do nothing though)
[ /trigger ]

And then that... Makes:

  • (Insert trigger name here)
  • (insert SPACE) Events
  • (insert SPACE) Conditions
  • (insert SPACE) Actions
    • (insert 2 SPACES)Unit - Create 1 bla bla bla bla...
    • (insert 2 SPACES)Add another trigger here... w/e
    • (insert 2 SPACES)If / Then / Else - Multiple
      • (insert 3 SPACES (OMG!!!))If - Conditions
      • (insert 3 SPACES)Then - Actions
        • (insert 4 SPACES)Do something
      • (insert 3 SPACES)Else - Actions
        • (insert 4 SPACES)Do Nothing (I do not suggest using do nothing though)
It's like a branch.
 
Level 10
Joined
Nov 5, 2008
Messages
536
  • Orb Dying
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Orb
    • Actions
      • Unit - Create 1 Orb for (Owner of (Killing unit)) at (Position of (Killing unit)) facing Default building facing degrees
      • Hero - Set (Killing unit) Hero-level to ((Level of (Killing unit)) + 1), Show level-up graphics
I hade made the trigger like this. Player A has a Hero. Player A's units kill the neutral Orb, but no level is added to the Hero. (Although, the rest of the trigger works fine)

Does the Hero need to kill the Orb to get a level or am I doing something wrong?
 
Level 5
Joined
Nov 7, 2007
Messages
134
Oh, I think I know where the problem lies. The "level-up"-trigger should say:

"Hero - Set (Killing unit) Hero-level to ((Hero-level of (Killing unit)) + 1), Show level-up graphic".

If it says just "Level of unit" it won't work, I think. And I realize it's my fault since I told you to do that at first, I am sorry about that :p .
 
Level 10
Joined
Nov 5, 2008
Messages
536
Oh, I think I know where the problem lies. The "level-up"-trigger should say:

"Hero - Set (Killing unit) Hero-level to ((Hero-level of (Killing unit)) + 1), Show level-up graphic".

If it says just "Level of unit" it won't work, I think. And I realize it's my fault since I told you to do that at first, I am sorry about that :p .

Don't be sorry, you have helped me a lot and I really appreciate it!

When I try to trigger triggers like this there is always something that goes wrong but when I ask here at the forums, I get so much better and effective triggers.

But I have made your change, but it still does not work :(

  • Orb Dying
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Orb
    • Actions
      • Unit - Create 1 Orb for (Owner of (Killing unit)) at (Position of (Killing unit)) facing Default building facing degrees
      • Hero - Set (Killing unit) Hero-level to ((Hero level of (Killing unit)) + 1), Show level-up graphics
The Hero controlled by the player does not gain a level.

Any thoughts?
 
Level 14
Joined
Jul 16, 2009
Messages
1,568
Set the Hero as a variable or something, and use it instead of ''Killing unit'', because with that trigger the unit that deals the killing blow gets the level.
 
Level 6
Joined
May 1, 2009
Messages
215
Yeah you're going to need some variables for that trigger because of leaks and bugs like that.

If players can only get 1 hero you'll need something like this:
  • Events
    • A Unit Enters Playable Map Bounds
  • Conditions
    • Unit type = Hero is true
  • Actions
    • If / Then / Else
      • If (owner of unit) is red equal to true
    • Then
      • Set Variable HeroRed = entering unit
    • Else
Repeat that for all the players, having separate variables for each player who can get a Hero (you could prob. do this faster with a variable array but that's prob too complicated for you.. and it's usually a waste of effort for me so I'm no good at them :p)

As for the leaks, you'll need (position of unit) as a variable too, call it TempLocation. Read about leaks, 'cause a trigger like this would leak enough to be concerncing.

You'll have to modify the triggers too, so the killing unit gets checked as which player is belongs to so you can refer to the proper variable.
 
Level 10
Joined
Nov 5, 2008
Messages
536
Gah! I don't get it to work. Is there any way to make this effective?

The player who kills the Orb gets control over it and when he gets it, his hero gets a level.
If he looses the Orb, his hero looses a level.
 
Level 5
Joined
Nov 7, 2007
Messages
134
I don't understand why it wouldn't work, but I think there's another way to do it still. Instead of "Set level"-action, use an "Add experience"-action when the orb is killed, and add as much experience to the hero that is necessary for it to gain a level. In order to make it work no matter what level the hero is on, go into gameplay constants and change the experience-thing there that says how much experience is needed for each level and set it to the same value for each level (at least I think there's such an option in gameplay constants, you should be able to find something like that).
And to decrease the level, do the same thing but instead use a negative value for the experience added, and it will subtract experience and (probably) decrease the level.

EDIT: In gameplay constants, there is an option that says "Hero XP Required - Level Factor". Set that value to 0, and the experience required for each level should be the same. Also, by default the experience for each level will be 200 if the Level Factor is set to 0.
 
Status
Not open for further replies.
Top