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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top