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

Simple Macro Request (no jass)

Status
Not open for further replies.
Level 3
Joined
Jun 1, 2013
Messages
47
Hello, just need a little support for a simple macro

Background information (this has already been implemented):
- Map features 6 players
- Player 7 (AI) controls Player 1 ' units
- Player 8 (AI) controls Player 2 ' units
(...)
- Player 12 (AI) controls Player 6 ' units
(imagine castle fight map)

Macro I need:
- when Player 7 kills a unit that drops bounty, Player 1 receives the gold instead. Or with other words Player 1 receives all gold that Player 7 gets at any time. (repeat the same for Player 8 - 12

Im having difficulties making such a macro, any help is appreciated. Also open for new ideas to achieve my goal.

Thank you very much
 

Ardenian

A

Ardenian

Trigger the bounty received instead, don't use the default options for bounty.
 
Level 3
Joined
Jun 1, 2013
Messages
47
Trigger the bounty received instead, don't use the default options for bounty.

:goblin_jawdrop:

Could you give me a hint how the trigger needs to look like? Im not experienced, I just created a simple bounty trigger for all the players
 
Level 10
Joined
Apr 4, 2010
Messages
509
yy_aux,
He said Trigger the bounty,
I just created a simple bounty trigger for all the players
. It's seem like you did trigger the bounty.
  • Bounty For Red
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Killing unit)) Equal to Player 7 (Green)
              • (Owner of (Killing unit)) Equal to Player 8 (Pink)
              • (Owner of (Killing unit)) Equal to Player 9 (Gray)
              • (Owner of (Killing unit)) Equal to Player 10 (Light Blue)
              • (Owner of (Killing unit)) Equal to Player 11 (Dark Green)
              • (Owner of (Killing unit)) Equal to Player 12 (Brown)
        • Then - Actions
          • Player - Add Bounty to Player 1 (Red) Current gold
        • Else - Actions
          • Player - Add Bounty to (Owner of (Killing unit)) Current gold
 
Level 3
Joined
Jun 1, 2013
Messages
47
yy_aux,
He said Trigger the bounty, . It's seem like you did trigger the bounty.
  • Bounty For Red
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Killing unit)) Equal to Player 7 (Green)
              • (Owner of (Killing unit)) Equal to Player 8 (Pink)
              • (Owner of (Killing unit)) Equal to Player 9 (Gray)
              • (Owner of (Killing unit)) Equal to Player 10 (Light Blue)
              • (Owner of (Killing unit)) Equal to Player 11 (Dark Green)
              • (Owner of (Killing unit)) Equal to Player 12 (Brown)
        • Then - Actions
          • Player - Add Bounty to Player 1 (Red) Current gold
        • Else - Actions
          • Player - Add Bounty to (Owner of (Killing unit)) Current gold


Nonono !! First of all Red ONLY receives the gold when Owner of killing unit = Player 7. When it's Player 8, then Blue supposed to receive the gold instead.

And where did you find that trigger "Add Bounty to player", did you use a variable?
 
Level 10
Joined
Apr 4, 2010
Messages
509
Yes, bounty is a variable...
  • Bounty
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Killing unit)) Equal to Player 7 (Green)
        • Then - Actions
          • Player - Add Bounty to Player 1 (Red) Current gold
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Killing unit)) Equal to Player 8 (Pink)
        • Then - Actions
          • Player - Add Bounty to Player 2 (Blue) Current gold
        • Else - Actions
 
Level 3
Joined
Jun 1, 2013
Messages
47
Ok this looks good, but I dont understand how did you insert the bounty there. Sorry Im not very experienced with creating variables. Could you please explain what you mean exactly?
 
Level 10
Joined
Apr 4, 2010
Messages
509
With the trigger window open, you should see a Yellow "X" outlined with black, click on that (or Ctrl + B). Now a smaller window will open, you can make a new variable by clicking the Green "X". Name your variable and then choose what type you want it to be. If you are creating an Income variable, then that variable type should be an Integer. Now to add a value to the Variable, go to actions and It should be the 7th one down the list, click on it. Now you can choose the variable's value.
  • Set Bounty = 5
I set the bounty to 5, so now when a unit dies, the killer will be awarded 5 gold. There are functions that you can add as well, for example, if you want randomized gold, then you would set Bounty like this:
  • Set Bounty = (Random integer between 1 and 10)
(this must be placed in the kill detection trigger).
You should just play around with editor, or download a spell or a system and study them to see how they do their triggers.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
It is pretty hard to get the exact value of the given bounty in GUI, in JASS this is very easy but nevermind that.

I have created a little script that replaces normal bounty with a triggered one.
What you need to do is download JNGP 2.0 and the Object Data Extractor
These are to allow you to edit the bounty of each unit type in the object editor like you have always done.

JASS:
library Bounty
    
    globals
        player NEUTRAL_HOSTILE = Player(PLAYER_NEUTRAL_AGGRESSIVE)
    endglobals
    
    //! LoadUnitData fields=ubba,ubdi,ubsi -defaults
    
    //Basicfunctions
    function GetDiceInteger takes integer dice, integer sides returns integer
        local integer i = 0
        local integer result = 0
        
        loop
            exitwhen i >= dice
            set result = result + GetRandomInt(1, sides)
            set i = i +1
        endloop
        
        return result
    endfunction
    
    function GetUnitTypeBounty takes integer unitTypeId returns integer
        return GetUnitTypeGoldBountyBase(unitTypeId) + GetDiceInteger(GetUnitTypeGoldBountyNumberOfDice(unitTypeId), GetUnitTypeGoldBountySidesPerDie(unitTypeId))
    endfunction
    
    function GetUnitBounty takes unit whichUnit returns integer
        return GetUnitTypeBounty(GetUnitTypeId(whichUnit))
    endfunction
    
endlibrary

function Bounty_UnitDeath takes nothing returns boolean
    local texttag tt
    
    set udg_Bounty_Unit = GetTriggerUnit()
    set udg_Bounty_Player = GetOwningPlayer(GetKillingUnit())
    if udg_Bounty_Player == null or GetOwningPlayer(udg_Bounty_Unit) != NEUTRAL_HOSTILE then
        return false
    endif
    set udg_Bounty_Amount = GetUnitBounty(udg_Bounty_Unit)
    
    set udg_Bounty_Event = 1
    set udg_Bounty_Event = 0
    
    call SetPlayerState(udg_Bounty_Player, PLAYER_STATE_GOLD_GATHERED, GetPlayerState(udg_Bounty_Player, PLAYER_STATE_GOLD_GATHERED) + udg_Bounty_Amount)
    call SetPlayerState(udg_Bounty_Player, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(udg_Bounty_Player, PLAYER_STATE_RESOURCE_GOLD) + udg_Bounty_Amount)
    
    set tt = CreateTextTag()
    call SetTextTagText(tt, "+" + I2S(udg_Bounty_Amount) + "g", 0.023)
    call SetTextTagPos(tt, GetUnitX(udg_Bounty_Unit), GetUnitY(udg_Bounty_Unit), 0)
    call SetTextTagColor(tt, 255, 255, 0, 255)
    call SetTextTagPermanent(tt, false)
    call SetTextTagLifespan(tt, 3)
    call SetTextTagFadepoint(tt, 2)
    call SetTextTagVelocity(tt, 0, 0.0355)
    if GetLocalPlayer() != udg_Bounty_Player then
        call SetTextTagVisibility(tt, false)
    endif
    return false
endfunction

//===========================================================================
function InitTrig_Bounty takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_DEATH)
    call TriggerAddCondition(t, Filter(function Bounty_UnitDeath))
    
    call SetPlayerState(NEUTRAL_HOSTILE, PLAYER_STATE_GIVES_BOUNTY, 0)
endfunction

All you need to know is how to use the events like I made them.
  • Change Player
    • Events
      • Game - Bounty_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bounty_Player Equal to Player 7 (Green)
        • Then - Actions
          • Set Bounty_Player = Player 1 (Red)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bounty_Player Equal to Player 8 (Pink)
        • Then - Actions
          • Set Bounty_Player = Player 2 (Blue)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bounty_Player Equal to Player 9 (Gray)
        • Then - Actions
          • Set Bounty_Player = Player 3 (Teal)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bounty_Player Equal to Player 10 (Light Blue)
        • Then - Actions
          • Set Bounty_Player = Player 4 (Purple)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bounty_Player Equal to Player 11 (Dark Green)
        • Then - Actions
          • Set Bounty_Player = Player 5 (Yellow)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bounty_Player Equal to Player 12 (Brown)
        • Then - Actions
          • Set Bounty_Player = Player 6 (Orange)
          • Skip remaining actions
        • Else - Actions
This trigger does exactly what you want.

EDIT:
I made a system out of it and rewrote this post.
 

Attachments

  • Bounty.w3x
    33.9 KB · Views: 77
Last edited:
Level 3
Joined
Jun 1, 2013
Messages
47
It is pretty hard to get the exact value of the given bounty in GUI, in JASS this is very easy but nevermind that.

I have created a little script that replaces normal bounty with a triggered one.
What you need to do is download JNGP 2.0 and the Object Data Extractor
These are to allow you to edit the bounty of each unit type in the object editor like you have always done.

JASS:
library Bounty
    
    globals
        player NEUTRAL_HOSTILE = Player(PLAYER_NEUTRAL_AGGRESSIVE)
    endglobals
    
    //! LoadUnitData fields=ubba,ubdi,ubsi -defaults
    
    //Basicfunctions
    function GetDiceInteger takes integer dice, integer sides returns integer
        local integer i = 0
        local integer result = 0
        
        loop
            exitwhen i >= dice
            set result = result + GetRandomInt(1, sides)
            set i = i +1
        endloop
        
        return result
    endfunction
    
    function GetUnitTypeBounty takes integer unitTypeId returns integer
        return GetUnitTypeGoldBountyBase(unitTypeId) + GetDiceInteger(GetUnitTypeGoldBountyNumberOfDice(unitTypeId), GetUnitTypeGoldBountySidesPerDie(unitTypeId))
    endfunction
    
    function GetUnitBounty takes unit whichUnit returns integer
        return GetUnitTypeBounty(GetUnitTypeId(whichUnit))
    endfunction
    
endlibrary

function Bounty_UnitDeath takes nothing returns boolean
    local texttag tt
    
    set udg_Bounty_Unit = GetTriggerUnit()
    set udg_Bounty_Player = GetOwningPlayer(GetKillingUnit())
    if udg_Bounty_Player == null or GetOwningPlayer(udg_Bounty_Unit) != NEUTRAL_HOSTILE then
        return false
    endif
    set udg_Bounty_Amount = GetUnitBounty(udg_Bounty_Unit)
    
    set udg_Bounty_Event = 1
    set udg_Bounty_Event = 0
    
    call SetPlayerState(udg_Bounty_Player, PLAYER_STATE_GOLD_GATHERED, GetPlayerState(udg_Bounty_Player, PLAYER_STATE_GOLD_GATHERED) + udg_Bounty_Amount)
    call SetPlayerState(udg_Bounty_Player, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(udg_Bounty_Player, PLAYER_STATE_RESOURCE_GOLD) + udg_Bounty_Amount)
    
    set tt = CreateTextTag()
    call SetTextTagText(tt, "+" + I2S(udg_Bounty_Amount) + "g", 0.023)
    call SetTextTagPos(tt, GetUnitX(udg_Bounty_Unit), GetUnitY(udg_Bounty_Unit), 0)
    call SetTextTagColor(tt, 255, 255, 0, 255)
    call SetTextTagPermanent(tt, false)
    call SetTextTagLifespan(tt, 3)
    call SetTextTagFadepoint(tt, 2)
    call SetTextTagVelocity(tt, 0, 0.0355)
    if GetLocalPlayer() != udg_Bounty_Player then
        call SetTextTagVisibility(tt, false)
    endif
    return false
endfunction

//===========================================================================
function InitTrig_Bounty takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_DEATH)
    call TriggerAddCondition(t, Filter(function Bounty_UnitDeath))
    
    call SetPlayerState(NEUTRAL_HOSTILE, PLAYER_STATE_GIVES_BOUNTY, 0)
endfunction

All you need to know is how to use the events like I made them.
  • Change Player
    • Events
      • Game - Bounty_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bounty_Player Equal to Player 7 (Green)
        • Then - Actions
          • Set Bounty_Player = Player 1 (Red)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bounty_Player Equal to Player 8 (Pink)
        • Then - Actions
          • Set Bounty_Player = Player 2 (Blue)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bounty_Player Equal to Player 9 (Gray)
        • Then - Actions
          • Set Bounty_Player = Player 3 (Teal)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bounty_Player Equal to Player 10 (Light Blue)
        • Then - Actions
          • Set Bounty_Player = Player 4 (Purple)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bounty_Player Equal to Player 11 (Dark Green)
        • Then - Actions
          • Set Bounty_Player = Player 5 (Yellow)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bounty_Player Equal to Player 12 (Brown)
        • Then - Actions
          • Set Bounty_Player = Player 6 (Orange)
          • Skip remaining actions
        • Else - Actions
This trigger does exactly what you want.

EDIT:
I made a system out of it and rewrote this post.


Wow thanks very much. But just to make sure: I dont want every unit to give the same bounty. I want that only certain units give bounty, just like I have set it up already (the correct bounty is already set up like it is supposed to be, just that red only received the bounty when he kills the unit himself)
Wietlol, could I send you the map and you insert the jass and that other trigger where they supposed to be and check whether my bounty trigger needs to be replaced or not? So many question and Im a big confused...
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Is the correct bounty set up in the object editor?
In that case, you are already almost done.
My script reads those fields to get the bounty you deserve.

To import the script, simply make a trigger called "Bounty" and convert it to custom text.
Then you copy and paste that GUI trigger, you can also instead just copy both triggers and your map should run fine.

Just be sure that you have JNGP 2.0 and ODE installed on your computer.
You dont need them to run your map, just to be able to edit it.
(You have to save the map before testing.)
 
Level 3
Joined
Jun 1, 2013
Messages
47
Is the correct bounty set up in the object editor?
In that case, you are already almost done.
My script reads those fields to get the bounty you deserve.

To import the script, simply make a trigger called "Bounty" and convert it to custom text.
Then you copy and paste that GUI trigger, you can also instead just copy both triggers and your map should run fine.

Just be sure that you have JNGP 2.0 and ODE installed on your computer.
You dont need them to run your map, just to be able to edit it.
(You have to save the map before testing.)

Yes, bounty works perfectly. How can I insert a trigger or script here like you did so I can show you? How can I convert a trigger to custom text? I do have JNPG 2.

I just copy pasted them and I get 12 compile errors...no idea how to fix them. And hiveworkshop doesnt let me upload any picture...
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You can use BB tags which are basically [tag][/tag] and you replace "tag" with something else and you place your stuff in it.
For triggers, you use TRIGGER tags and for JASS, you use JASS tags.

Have you also installed ODE?

You can convert a trigger to custom text using "Edit -> Convert to custom text" (you have to have a trigger selected)

You can upload images via imgur
 
Level 3
Joined
Jun 1, 2013
Messages
47
You can use BB tags which are basically [tag][/tag] and you replace "tag" with something else and you place your stuff in it.
For triggers, you use TRIGGER tags and for JASS, you use JASS tags.

Have you also installed ODE?

You can convert a trigger to custom text using "Edit -> Convert to custom text" (you have to have a trigger selected)

You can upload images via imgur

As I said I get 12 compile errors and dont know what to do. Plz help !!

image.jpg



this is my bounty trigger Ive made myself before.

  • bounty on
    • Ereignisse
      • Zeit - Elapsed game time is 1.00 seconds
    • Bedingungen
    • Aktionen
      • Spieler - Turn Gibt Beute Ein for Spieler 1 (Rot)
      • Spieler - Turn Gibt Beute Ein for Spieler 2 (Blau)
      • Spieler - Turn Gibt Beute Ein for Spieler 3 (Blaugrau)
      • Spieler - Turn Gibt Beute Ein for Spieler 4 (Lila)
      • Spieler - Turn Gibt Beute Ein for Spieler 5 (Gelb)
      • Spieler - Turn Gibt Beute Ein for Spieler 6 (Orange)
      • Spieler - Turn Gibt Beute Ein for Spieler 7 (Grün)
      • Spieler - Turn Gibt Beute Ein for Spieler 8 (Rosa)
      • Spieler - Turn Gibt Beute Ein for Spieler 9 (Grau)
      • Spieler - Turn Gibt Beute Ein for Spieler 10 (Hellblau)
      • Spieler - Turn Gibt Beute Ein for Spieler 11 (Dunkelgrün)
      • Spieler - Turn Gibt Beute Ein for Spieler 12 (Braun)
      • Spieler - Turn Gibt Beute Ein for Neutral feindlich
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Ow you are missing the global variables.
You have to create them yourself I guess and then copy and paste the triggers again.

The variables you have to create are:
- Bounty_Amount (Integer)
- Bounty_Event (Real)
- Bounty_Player (Player)

And you have not installed the Object Data Extractor which I linked (or you didnt save the map)

The trigger you made is not doing much because you disable the loot when a unit kills any of the players of which the bounty is turned off. However, it is turned off for all players except neutral hostile by default.
You shouldnt have that trigger of yours.
 
Level 3
Joined
Jun 1, 2013
Messages
47
The trigger you made is not doing much because you disable the loot when a unit kills any of the players of which the bounty is turned off. However, it is turned off for all players except neutral hostile by default.
You shouldnt have that trigger of yours.

The trigger I made is just for turning the bounty on for all players. Like you said, it is by default turned off (except neutral hostile) so thats why I added my trigger. Works perfectly fine, but as I already stated I want to expand that loot trigger.

And you have not installed the Object Data Extractor which I linked (or you didnt save the map)
I dont know what that is or what you mean by that? The compile error came right when I saved the map, so yes I (at least tried to) saved the map.


Still 8 compile errors

nr2.jpg


the missing 2 errors:
Line 158 Cannot convert returned value from real to integer
Line 3739 Undeclared variable udg_Bounty_Unit
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Then you didnt install the Object Data Extractor to your jassnewgenpack folder in Warcraft III folder.
Because you were missing the functions that the ODE creates.

About your trigger... can you tell me exactly when you are supposed to get loot in your map?
 
Level 3
Joined
Jun 1, 2013
Messages
47
About your trigger... can you tell me exactly when you are supposed to get loot in your map?

So far when any players kills any other player's unit, he receives bounty depending on the unit. I edited the different bounties in the object editor directly. This works perfectly so far.

Now what I need is what I described in the first post. I want Player 1 to receive the bounty not only when he himself kills another unit, but also when Player 7 does it.

The same connection between Player 1 and 7 also ought to exist between:
Player 2 and 8
Player 3 and 9
Player 4 and 10
Player 5 and 11
Player 6 and 12


I hope this is comprehensible :D

Then you didnt install the Object Data Extractor to your jassnewgenpack folder in Warcraft III folder.

How do I know whether I have installed it and how can I install it now?

I have installed jassnewgenpack and jasshelper both newest versions. Thats not sufficient? I have never heard of the ODE, could you give me a link where to download that additional program? I cant find anything on google :/
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
I would just assume that you wont kill your own units.
The GUI actions that you have should not be used but instead you should edit this part in my script:
JASS:
    if udg_Bounty_Player == null or GetOwningPlayer(udg_Bounty_Unit) != NEUTRAL_HOSTILE then
        return false
    endif
to
JASS:
    if udg_Bounty_Player == null  then
        return false
    endif
That part will make bounty only work when you kill neutral hostile units and removing that part in the if will make it work for all units.

The link to the ODE is in my post where I also posted the map and triggers.
You have to extract the zip that you download from that page and read the README for how to install it.

You are required to have a specific Java version (which you probably have) but you may want to edit the wehack.lua instead of overwriting it.
In any case... everything is made clear in the README. (You have to open it with a texteditor like notepad... it doenst have a file extention so it doesnt do it by default.)
 
Level 3
Joined
Jun 1, 2013
Messages
47
I would just assume that you wont kill your own units.
The GUI actions that you have should not be used but instead you should edit this part in my script:
JASS:
    if udg_Bounty_Player == null or GetOwningPlayer(udg_Bounty_Unit) != NEUTRAL_HOSTILE then
        return false
    endif
to
JASS:
    if udg_Bounty_Player == null  then
        return false
    endif
That part will make bounty only work when you kill neutral hostile units and removing that part in the if will make it work for all units.

The link to the ODE is in my post where I also posted the map and triggers.
You have to extract the zip that you download from that page and read the README for how to install it.

You are required to have a specific Java version (which you probably have) but you may want to edit the wehack.lua instead of overwriting it.
In any case... everything is made clear in the README. (You have to open it with a texteditor like notepad... it doenst have a file extention so it doesnt do it by default.)

Ok ill test it ASAP.

The link to the ODE: That guy offers 3 different programs for download without explaining which one is the actual program :vw_wtf:

TestObjDataExporter14.w3m
ode-44.zip
ode-44-src.zip

I have no clue which one I need to download :ogre_icwydt:
Plz advice
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
The first one is a map file (which is as you could imagine an example of how to use it or a check to find out if you have it properly installed).

The second one is a zip file with the name ode and a version... sounds like it is the right file.

The third one is a source (src) zip which means that people who want to edit the ode need that one to work with.


ode-44.zip is the one you need.
 
Level 3
Joined
Jun 1, 2013
Messages
47
I would just assume that you wont kill your own units.
The GUI actions that you have should not be used but instead you should edit this part in my script:

this edit didnt change anything, still these 8 compile errors :/

I extracted ODE into the Jassnewgenpack5d folder, didnt replace the wehack.lua but just added the line as it is told in the Readme . Thats all I have to do, right?

1 Compile Error left
image.jpg
 
Last edited:
Level 3
Joined
Jun 1, 2013
Messages
47
Ok no more compile error now.
It first didnt work, but then I removed that "or GetOwningPlayer(udg_Bounty_Unit) != NEUTRAL_HOSTILE" passage

Now it works perfectly so far (havent tested for all colors yet tho)

Thank you very much !!!
 
Level 3
Joined
Jun 1, 2013
Messages
47
Could I tell you about one additional little issue while you here? :ogre_haosis:
it's a bit easier I think and you seem to be veeery professional:

There are 2 teams à 3 players (Player 1-3 and Player 4-6)

1) I want when any of them leaves, his gold is devided among the other allys

// only the ones still in game
// when a player leaves his buildings and units remain in game (set up by me)


This is my trigger for what happens when a player leaves (in case this is not necessary for you, just ignore it)

  • Spieler 1 leaves
    • Ereignisse
      • Spieler - Spieler 1 (Rot) leaves the game
    • Bedingungen
      • PlayerAlive[1] Gleich True
    • Aktionen
      • Spiel - Display to (All players) the text: ((Name of (Triggering player)) + hat das Spiel verlassen!)
      • Set PlayerLeft[1] = True
      • Spielergruppe - Pick every player in (All allies of (Triggering player)) and do (Actions)
        • Schleifen - Aktionen
          • Spieler - For (Triggering player), turn Gemeinsame Einheiten Ein toward (Picked player)
          • Spieler - For (Triggering player), turn Komplett gemeinsame Einheiten Ein toward (Picked player)
      • Auslöser - Run SiegNiederlage <gen> (checking conditions)
2) When any HQ gets destroyed (no matter if that player already left or not), the other remaining allys get his income / sec added (standard is 2g / sec, so if one player leaves, the other 2 would get in total 3g / sec)

This is what happens when a HQ is destroyed
  • Spieler 1 HQ vernichtet
    • Ereignisse
      • Einheit - |cFF008080Rebels Keep |r 0016 <gen> Stirbt
    • Bedingungen
    • Aktionen
      • Set PlayerAlive[1] = False
      • Einheitengruppe - Pick every unit in (Units in Rot <gen>) and do (Actions)
        • Schleifen - Aktionen
          • Einheit - Explode (Picked unit)
      • Einheitengruppe - Pick every unit in (Units in Rot2 <gen>) and do (Actions)
        • Schleifen - Aktionen
          • Einheit - Explode (Picked unit)
      • Einheitengruppe - Pick every unit in (Units in (Playable map area) owned by Spieler 1 (Rot)) and do (Actions)
        • Schleifen - Aktionen
          • Einheit - Remove (Picked unit) from the game
      • Spiel - Defeat Spieler 1 (Rot) with the message: Niederlage!
      • Spiel - Display to (All players) the text: ((Name of Spieler 1 (Rot)) + wurde besiegt!)
      • Auslöser - Run SiegNiederlage <gen> (checking conditions)

This is the income trigger
  • Gold pro Sekunde
    • Ereignisse
      • Zeit - Every 1.00 seconds of game time
    • Bedingungen
    • Aktionen
      • Spieler - Add 2 to Spieler 1 (Rot) Aktuelles Gold
      • Spieler - Add 2 to Spieler 3 (Blaugrau) Aktuelles Gold
      • Spieler - Add 2 to Spieler 4 (Lila) Aktuelles Gold
      • Spieler - Add 2 to Spieler 5 (Gelb) Aktuelles Gold
      • Spieler - Add 2 to Spieler 2 (Blau) Aktuelles Gold
      • Spieler - Add 2 to Spieler 6 (Orange) Aktuelles Gold
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Cant you just pick every unit owned by player <triggering player>?
And you should get rid of specific unit events and start using generic unit events only.

About the income, you could try to make a real variable array that will represent the income of all players.
Then you can loop through all players and give them their income.
(The income is given as an integer so you would need "Conversion - Convert Real to Integer". The real array is simply to keep calculations right. You might also want to use arithmetics to add 0.5 before converting it to an integer to use nearest int roundings. You could even have another variable which keeps track of how much decimal gold has been given and add that as well to the calculation which would mean that in a total of 10 seconds, you get 15 gold when your income is 1.5 per second (which would be 10 gold in 10 seconds without that new variable).)

Then when a player leaves, you can increase the value of that variable for his allies.
 
Level 3
Joined
Jun 1, 2013
Messages
47
Cant you just pick every unit owned by player <triggering player>?
And you should get rid of specific unit events and start using generic unit events only.

You mean in order to not have to write 6 different triggers for each player? I made it this way cause Im not very sure how to put them all in 1 trigger. I tried alot of triggers for dividing the gold of a leaving player to the remaining but I couoldnt figure out how to make the trigger working when 2 player leaves. Then the remaining player should not receive 0.5, but the whole gold (If you understand what I mean :/). So trigger needs to check if remaining players still in game and I rly dont even know how to start this :vw_wtf:

About the income, you could try to make a real variable array that will represent the income of all players.
Then you can loop through all players and give them their income.
(The income is given as an integer so you would need "Conversion - Convert Real to Integer". The real array is simply to keep calculations right. You might also want to use arithmetics to add 0.5 before converting it to an integer to use nearest int roundings. You could even have another variable which keeps track of how much decimal gold has been given and add that as well to the calculation which would mean that in a total of 10 seconds, you get 15 gold when your income is 1.5 per second (which would be 10 gold in 10 seconds without that new variable).)

1.5g per second would never be the case. Players get 2g / sec so either:

- 2 players get 1 additional gold per second (in case 1 Players of a team gets his HQ destroyed) or
- 1 player gets in total 4 more gold per second (in case both Players of a team get their HQ destroyed)

I can write a trigger for this right? Or is Jass needed?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You can do it in simple triggers.

First of all, you take the whole number of gold that the leaving player has.
Then you devide that number by the total players inside the group Allies of <player> (you may want to remove one of that number first because this may also include <player> itself).
Then you know how much you want to add.

When working with 3 players starting with 2g/s it will indeed not be necessary to use reals.

You can do it with plain GUI triggers.
 
Level 3
Joined
Jun 1, 2013
Messages
47
You can do it in simple triggers.

First of all, you take the whole number of gold that the leaving player has.
Then you devide that number by the total players inside the group Allies of <player> (you may want to remove one of that number first because this may also include <player> itself).
Then you know how much you want to add.

When working with 3 players starting with 2g/s it will indeed not be necessary to use reals.

You can do it with plain GUI triggers.


Could you do the trigger for me please I really have no idea how to make it work. Tried several times and nothing works :/
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
This is about the defeat trigger.
The only thing I dont know is what the trigger is about that you run at the end of it.
  • Player Defeat
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set TempUnit[0] = (Triggering unit)
      • Set TempUnitType[0] = (Unit-type of TempUnit[0])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • TempUnitType[0] Equal to Town Hall
              • TempUnitType[0] Equal to Keep
              • TempUnitType[0] Equal to Castle
        • Then - Actions
          • -------- - --------
          • Set TempPlayer[0] = (Owner of TempUnit[0])
          • -------- - --------
          • -------- - --------
          • -------- Explode all units of the defeated player. --------
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units owned by TempPlayer[0]) and do (Actions)
            • Loop - Actions
              • Unit - Explode (Picked unit)
          • -------- - --------
          • -------- - --------
          • -------- Remove the defeated player from the game. --------
          • Game - Defeat TempPlayer[0] with the message: Defeat!
          • Game - Display to (All players) the text: ((Name of TempPlayer[0]) + has been defeated!)
          • -------- - --------
          • -------- - --------
          • -------- Give the gold income of the defeated player to his allies. --------
          • Set TempForce[0] = (All allies of TempPlayer[0])
          • -------- Carefull for divide by zero exception when the last player of a group is defeated! --------
          • Set TempInteger[0] = (Player_GoldIncome[(Player number of TempPlayer[0])] / ((Number of players in TempForce[0]) - 1))
          • Player Group - Pick every player in TempForce[0] and do (Actions)
            • Loop - Actions
              • Set TempPlayer[1] = (Picked player)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TempPlayer[0] Not equal to TempPlayer[1]
                • Then - Actions
                  • Set TempInteger[1] = (Player number of TempPlayer[1])
                  • Set Player_GoldIncome[TempInteger[1]] = (Player_GoldIncome[TempInteger[1]] + TempInteger[0])
                • Else - Actions
          • Custom script: call DestroyForce(udg_TempForce[0])
          • -------- - --------
        • Else - Actions
          • -------- Dying unit is not a town hall. --------
 
Level 3
Joined
Jun 1, 2013
Messages
47
Thanks you very much :)

The only thing I dont know is what the trigger is about that you run at the end of it.

I dont quite understand what you mean ?:goblin_jawdrop: Do you mean you dont know how to do the trigger I need?

The first part of this trigger you did is redudant cause I already created it for all the players. Please just make a trigger with either:
- the income that will be added to the allys - condition: hq destroyed or
- the gold that will be given to the remaining allys - condition: player leaves
 
Level 3
Joined
Jun 1, 2013
Messages
47
In your trigger you run another trigger at the end called "SiegNiederlage".
I hope for you that that one is working for all players.

The trigger I made is simply a replicate of yours but then working for all players.

Oh, my trigger is working for all players that wasnt what I need help with :D
SiegNiederlage (VictoryDefeat) is another trigger which works perfectly fine and I did many of my trigger 6 times (for each player). No need to summarize them all into one thats perfectly fine.

But could you please do a trigger for my 2 requests? If you could do just one of the two request and upload an empty map with it that would already help me alot.
 
Status
Not open for further replies.
Top