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

Charge gold and lumber problem

Status
Not open for further replies.
Level 5
Joined
Aug 24, 2010
Messages
133
I'm using charge gold and lumber as a basis for an upgrade
and I've set it to start at 50 gold and increment by 25 gold each time
but for some reason it always takes 25 more gold than it should
I've tried setting it to start at 25 gold but if you have less than 50 but greater than 25 you can still use it.
Does anyone know why this happens and how to fix it.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Are there any triggers that are involved?

Are the base order ids consistent on all the levels?
If you have multiple charge gold and lumber abilities on a single unit the base order ids need to all be different.
 
Level 5
Joined
Aug 24, 2010
Messages
133
There's 2 on one unit but they each have different base order ids.
Both of them have the same issue of charging 25 gold more than displayed.

  • attack up
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to attack up
    • Actions
      • Set atk[(Player number of (Triggering player))] = (atk[(Player number of (Triggering player))] + 1)
      • Player - Set the current research level of Attack Upgrade to atk[(Player number of (Triggering player))] for (Triggering player)
      • Unit - Set level of attack up for (Triggering unit) to (atk[(Player number of (Triggering player))] + 1)
  • defense up
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to defense up
    • Actions
      • Set def[(Player number of (Triggering player))] = (def[(Player number of (Triggering player))] + 1)
      • Player - Set the current research level of Defense Upgrade to def[(Player number of (Triggering player))] for (Triggering player)
      • Unit - Set level of defense up for (Triggering unit) to (def[(Player number of (Triggering player))] + 1)
      • Unit Group - Pick every unit in (Units owned by (Triggering player) of type Marine) and do (Actions)
        • Loop - Actions
          • Unit - Set level of Hardened Skin for (Picked unit) to (def[(Player number of (Owner of (Picked unit)))] - 1)
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Well besides some leaks and inefficiencies, there is nothing in those triggers that I see that would be contributing to the problem.

I just made a demo and mine did not do anything strange. So, I'm not really sure where to go from here.

Just in case go line by line in the OE and examine all the values, especially on multi-leveled spells some settings that the default has are not carried over so while it will appear black, it actually needs to change to pink.

If when you take a second look and don't see anything that is out of whack, attempt to replicate the problem in a test map so we can see what is going on. Although since I did not have any problems, I think you might have just mixed up a value or two.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Care to share that map? Again, when I tried I didn't see that happen, but maybe I was careless.

If that is the case I suppose you just need to dial everything back by one level if its consistently going one level higher.
 
Level 5
Joined
Aug 24, 2010
Messages
133
If I dial it back then it displays the incorrect value and if the value is set to 50 then it requires at least 50 to buy but takes 75 if you have more than 50.
 

Attachments

  • charge gold.w3x
    17 KB · Views: 34
Level 13
Joined
Mar 24, 2013
Messages
1,105
Okay, I fooled around a little on your map. It appears this ability is a little bizarre. There needs to "some amount of time" between the ability firing and the level being incremented. So I tried a 0.00 second wait and it worked as intended. I probably would advise against waits and just use a 0. second timer that way it should still be mpi and the effect should work.

  • charge
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charge Gold and Lumber
    • Actions
      • Set buyingUnit = (Triggering unit)
      • Countdown Timer - Start timer as a One-shot timer that will expire in 0.00 seconds
  • Untitled Trigger 001
    • Events
      • Time - timer expires
    • Conditions
    • Actions
      • Unit - Set level of Charge Gold and Lumber for buyingUnit to ((Level of Charge Gold and Lumber for buyingUnit) + 1)


I didn't run into this problem because I wasn't using Start the effect of an ability as my increasing level event. :p

Also, I would suggest adding a deselect and reselect because the ability information does not appear to update until reselected.
 
Status
Not open for further replies.
Top