store gold amount in a variable?

jeremiah

New Member
Reaction score
0
Code:
anti-greedisgood
    Events
        Player - Player 1 (Red)'s Current gold becomes Greater than (CANT USE A VARIABLE)
    Conditions
    Actions

why cant I use a variable there?
 

Draphoelix

It's not the wintercold that's killing me
Reaction score
132
Try interger or real, either of them got the line = Player properety
 

verdr3t

New Member
Reaction score
8
Like this?

Variable Gold = Integer

Code:
Melee Initialization
    Events
    Conditions
    Actions
        Set [COLOR="Red"]Gold[/COLOR] = (Player 1 (Red) Current gold)


Cheers
 

jeremiah

New Member
Reaction score
0
no

no when I

Code:
anti-greedisgood
    Events
        Player - Player 1 (Red)'s Current gold becomes Greater than (CANT USE A VARIABLE)
    Conditions
    Actions

i tried integer and real it wouldnt show up
 

DiDdY

New Member
Reaction score
14
Why would you need to use a variable? Couldn't you just put 9999999 there?
 

verdr3t

New Member
Reaction score
8
It would be easier for us to help if you'd exactly say what you want to do in-gamewise.


Cheers
 

Dmshu

New Member
Reaction score
9
I think I know what you want to do as your trigger is called anti-greedisgood so this is what I have made:
Code:
Untitled Trigger 001
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
                Set PlayerGoldArray[(Integer A)] = ((Player((Integer A))) Current gold)
Every second it stores all players gold into a variable

Code:
Untitled Trigger 002
    Events
        Player - Player 1 (Red) types a chat message containing greedisgood as A substring
    Conditions
        (Player 1 (Red) Current gold) Greater than PlayerGoldArray[1]
    Actions
        Player - Set Player 1 (Red) Current gold to PlayerGoldArray[1]
If they type greedisgood then that trigger will run and set them back to the gold they had the last second ago eliminating their cheated gold.
 

DiDdY

New Member
Reaction score
14
I think I know what you want to do as your trigger is called anti-greedisgood so this is what I have made:
Code:
Untitled Trigger 001
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
                Set PlayerGoldArray[(Integer A)] = ((Player((Integer A))) Current gold)
Every second it stores all players gold into a variable

Code:
Untitled Trigger 002
    Events
        Player - Player 1 (Red) types a chat message containing greedisgood as A substring
    Conditions
        (Player 1 (Red) Current gold) Greater than PlayerGoldArray[1]
    Actions
        Player - Set Player 1 (Red) Current gold to PlayerGoldArray[1]
If they type greedisgood then that trigger will run and set them back to the gold they had the last second ago eliminating their cheated gold.

What if it's too slow and the variable is overwritten with the amount after the cheat has been used?
 

jeremiah

New Member
Reaction score
0
It would be easier for us to help if you'd exactly say what you want to do in-gamewise.


Cheers

no it wouldnt, Im not trying to ask you how to get a a certain effect "in-gamewise". Im trying to ask you if there is some reason as to why that field wont take a variable
 

jeremiah

New Member
Reaction score
0
I think I know what you want to do as your trigger is called anti-greedisgood so this is what I have made:
Code:
Untitled Trigger 001
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
                Set PlayerGoldArray[(Integer A)] = ((Player((Integer A))) Current gold)
Every second it stores all players gold into a variable

Code:
Untitled Trigger 002
    Events
        Player - Player 1 (Red) types a chat message containing greedisgood as A substring
    Conditions
        (Player 1 (Red) Current gold) Greater than PlayerGoldArray[1]
    Actions
        Player - Set Player 1 (Red) Current gold to PlayerGoldArray[1]
If they type greedisgood then that trigger will run and set them back to the gold they had the last second ago eliminating their cheated gold.

unfortunately, when a player types a cheat it is not considered a string and it wont be detected
 

Dmshu

New Member
Reaction score
9
What if it's too slow and the variable is overwritten with the amount after the cheat has been used?

My faith in the wc3 engine picking up a substring of greedisgood in less than a second it very very very high.

Just think if you play Dota when you type -random does it confirm you are going to be given a random hero almost instantly or does it take over a second before that message hits your screen?

The only problem with my trigger is if they are killing units with a bounty multiple times in a second and they want to type greedisgood they will actually lose gold, but that gold setback trigger wont happen to a normal person unless they type greedisgood within their chat message.
 

Dmshu

New Member
Reaction score
9
How about you store all gold you know is good into a variable.
I made an int array called GoodGold[]

Then as an example this gives you the correct bounty:
Code:
Untitled Trigger 001
    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 1 (Red)
            Then - Actions
                Set GoodGold[1] = (GoodGold[1] + (Point-value of (Triggering unit)))
            Else - Actions
                Do nothing

The point value is found near the bottom in the unit editor change that to what you want the bounty to be.

Then this trigger gives the player the gold they have earned thus far:
Code:
Untitled Trigger 002
    Events
        Time - Every 0.25 seconds of game time
    Conditions
    Actions
        Player - Set Player 1 (Red) Current gold to GoodGold[1]

Think you can work with that idea and see what you can come up with?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top