Game freezes when giving gold to player.

Gluttonous

Active Member
Reaction score
1
It's a seemingly pathetically simple trigger. However, the very -moment- a unit with this Pillage ability attacks something, the game freezes, and I am positive that this simple, innocent looking trigger is somehow to blame. It'd be one thing if this somehow leaked, but freeze the game on the very first attack. . .?
Trigger:
  • Pillage
    • Events
    • Unit - A unit Is attacked
    • Conditions
    • (Level of Pillage for (Attacking unit)) Not equal to 0
    • ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    • Actions
    • Player - Add (10 + (2 x (Level of Pillage for (Attacking unit)))) to (Owner of (Attacking unit)) Current gold


As far as the actual ability ignoring the trigger, it's a 20 level Hero version of Pillage that does nothing.

Edit: And said ability was apparently the problem, not the trigger. If you want Pillage to do nothing, do NOT set the various amounts of pillage in the data fields to 0, as your unit will make the game freeze when they attack for whatever reason. Instead, just set the allowed targets of the ability to none.
 

chukky-jr

Member
Reaction score
15
unless there is another trigger that checks when a unit attacks and creates infinite loop, i don't see anything wrong with this trigger

As far as the actual ability ignoring the trigger, it's a 20 level Hero version of Pillage that does nothing..

iirc even 10 Level hero ability already make the game very laggy, try to make 20 different Pillage ability with corresponding stats from level 1-20 to your lining, and see if it helps
 

AriesX_420

Active Member
Reaction score
1
Instead of basing the ability off of the actual pillage spell you should use an aura based one instead, it might not matter but could help. I have found that the triggering of gold at an excessive rate does lag the game, instead of using player property. you should:

Create gold coin items that are used when acquired that give your Hero x amount of gold. (ie: Gold Coins / Create item for hero)

Either create multiple of the same item depend on the level of the spell... ie: level 1 creates one gold coin for hero... level 2 creates two.
or
Create a bunch of Gold coins each depending on your level of the custom spell.
 

Syndrome

You can change this now in User CP.
Reaction score
126
Attacked doesn't mean the unit is taking damage by the way. It just means there is a unit in range whose target is that unit. This trigger might trigger a couple of trillion times if one unit is 'attacking' another.
You'll have to add the attacked unit to a trigger via another trigger, with something like
"Trigger - Add Event to Trigger 2 - Attacked Unit takes Damage"
And then in trigger 2, have the gold increment actions there.
Also, this trigger leaks a ton. But that's something else to worry about later.

EDIT: Actually, it may or may not be the leaks that are killing your game since it's triggering like mad. However, if you do it the way I suggested it will cut down on the majority of it.

Or you can use the Orb of Electricity ability, the thing with a chance to cast purge. Instead, make the chance 100% and make the ability some dummy ability.
Then have a trigger that picks up when a unit channels that ability, and then add the gold then.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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