Which variabletype will work

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
Choosing variable type Solved. Thanks. Just a related Question

Hmmmm, right so i have an ability that when used, bolts of lightning are created on all units with a particular buff.

After reading the tutorial on leaking. I realised that, my map would be like a hole the hull in my ship.

So... I decided to put the lightning into a variable,

But.... the variable types i choose, dont want to be selected when i run the action;

Action: Create special effect at (point) using [effect(wont allow variables)]

so which variable type allows selection in this action?
 

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
Yes, i assumed the same, however when choosing the model, the variable selection remained grey. Therefore, they were obviously a unsuitable choice.

However, the string works nicely. Very nice. Thankyou Ace.

Just one more thing.

Is there a command, that will destroy ALL the effects?

as there is no way to determine the amount of units struck, without only allowing a certain number to be struck (which i dont want to do.)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> the string works nicely.

I must admit, however, that I've no idea how that's going to help in The Great Crusade against Memory Leaks...

> Is there a command, that will destroy ALL the effects?

No.
That would be too simple.

But, you could try to add "Special effect - Destroy (last created special effect)" right after you create it.
It depends on the effect though.
Flamestrike for example, needs some time to actually show something.
Teleport, on the other hand, works just fine...


Some other idea would be an array of special effects.

Special effect - Create ...
set counter = counter + 1
set array[counter] = (last created special effect)

Once done,
for each integer A from 1 to count: Destroy array[integer A]
set counter = 0
 

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
It sounds good. But, what variable types are you using for counter and array.

(on a side note)

Could i use this to determine the amount of bolts created?

Pick every unit in (area with buff) and do...

Set Units_Struck =
(Real((number of units in (units owned by Enemy matching ((picked unit) has buff (x) equal to true)))))

I'll be buggered if i know what to do with this tho.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Well, an example would be:

Code:
Actions
    Set UnitGroup = (Units within 512.00 of (Target point of ability being cast) matching (((Matching unit) has buff <some buff>) Equal to True))
    Set IntegerCounter = 0
    Unit Group - Pick every unit in UnitGroup and do (Actions)
        Loop - Actions
            Set Position = (Position of (Picked unit))
            Special Effect - Create a special effect at Position using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
            Set SpecialEffects[IntegerCounter] = (Last created special effect)
            Set IntegerCounter = (IntegerCounter + 1)
    Wait 2.00 game-time seconds
    For each (Integer A) from 1 to IntegerCounter, do (Actions)
        Loop - Actions
            Special Effect - Destroy SpecialEffects[(Integer A)]

Variables used:
UnitGroup, of type Unit Group
IntegerCounter, of type Integer
Position, of type Point
SpecialEffects, of type Special Effect, array, size... big (100 or so)

Knowing nothing about your ability, the very first action "Set UnitGroup" is a wild guess... :)


Or, like mentioned already:
Special Effect - Create a special effect at Position using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
Special Effect - Destroy (Last created special effect)

Without remembering anything in some array.
Depends on what effect you're using.
 

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
Just for your peace of mind Ace :D

Well the ability is to basically simulate the monsoon ability only it is in two parts.

The first part is an ability which i shall call 'rain'. Basically what this is an aura, which looks like its raining around the caster. It leaves a buff, which i shall call 'wet'.

The second part is an ability that i shall call 'electrocute'. This is a 'dummy' ability, that when cast, strikes EVERY unit that has the buff 'wet'. If you cast it and nobody has the buff, nobody is hurt etc.

The special effect model I am using is the monsoon (target). Which I (believe) is a bit more 'flowery' on impact than the doodad version.

The Original trigger was.

Event: Unit 'uses' ability
Condition: Ability equal to 'electrocute'
Action: Unitgroup: pick every unit in 'x' range of casting unit with buff wet &
Create special effect ('electrocute[string variable]) at picked unit.
Damage picked unit for <blah blah not relevent>

So, if you can see, any number of units could be struck with lightning.
Which, after reading about leakage creates a problem as the effects are not destroyed after being created.

And it seems that 'destroy last effect' should only work for the LAST created effect, and therefore not everysingle one

Point out if I am wrong ( I wish i was, then I wouldnt have to muck around like this)

Now I have worked the trigger to be exactly like the one you provided.

THankyou for your help, sorry for the long posts and, is there somewhere i could understand leakage a bit more. The tutorial, covers it, but i feel i could understand more.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> And it seems that 'destroy last effect' should only work for the LAST created effect, and therefore not every single one

Well, yes.
But, for a lot of effects, it works if you destroy them in the very next action.
They will not instantly disappear, they will, sort of, die. So, basically, show their death animation, then disappear.
For most effects, that's it already anyway.

Some, however, like Flamestrike, have longer animations.
Actually, it has a 7 seconds "birth" animation that holds all the interesting parts.
Its death animation is pretty much instant.
If you destroy those immediately after creation they will disappear.
Actually, it will be so quick that you won't even see them...

And, well, for those, you'll need to remember them somehow for later destruction.
An "array" solution, as you may have noticed, is rather simple.

How do you see which effect is what?
Well, when choosing your effect model, the actual effect is also shown on the map view.
If it says "birth" or "stand" or "death", you'll have to wait for it.
Otherwise, it's ok to destroy them the very instant they come.
Well, that's what I'm going with until there's some better idea around :)


People have worried about leaks since someone pointed out that there are some.
Means... years!

A trigger that creates one unit at some spot and only ever runs once every 10 minutes is nothing to worry about.
Or, "map initialization"... runs once, that's it. (Yep, people will hate me for that last one :))




So, basically, you electrocute people standing in the rain?
Hm... makes you think, doesn't it? :nuts:


Happy mapping,
AceHart

P.s.: Long posts? You ain't seen nothing yet. :p
 

Rinpun

Ex TH Member
Reaction score
105
FYI, Leakage only happens on a serious level when you use clumsy JASS or you go over the size on an array. I don't see how simply creating an SE and destroying it would be serious leakage or even a little buildup...if any at all.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> I don't see how simply creating an SE and destroying it...

The keyword here is "destroying".
If you don't...

Then again, one effect or two is not much of a leak anyway.
And, how often are you going to use that ability in a game?
How long will one game last?

It gets more interesting with periodic triggers that leak several things at once every 0.05 seconds for half an hour... :)

Well... whatever floats your boat I guess.
Personally, I worry little to less :p
 

Rinpun

Ex TH Member
Reaction score
105
Killing an SE destroys it. I apologize for the mention. It's called graphics work on your graphics card. The less difference in pixels, and the less polygons that meshes take up, the less work your card has to do. So, removing fancy graphics from what your card has to render does not cause a leakage and does not hurt the map in anyway :)

(I don't worry about leakages unless it actually hurts my map)

Worrying about leakages is like worrying about the many million ways you can die. You can be electrocuted, trip and fall down flights of stairs, drown in the shower (trip, become unconscious, and then drown :p), suffocate via pillows, suffocate via plastic wrap...the list goes on. And yet, I don't see the majority of the human race worrying about these things :D
 

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
AceHart said:
>
Then again, one effect or two is not much of a leak anyway.
And, how often are you going to use that ability in a game?
How long will one game last?

It gets more interesting with periodic triggers that leak several things at once every 0.05 seconds for half an hour... :)
:p

My concern was the amount of undestroyed effects. The spell itself created an uncountable ammount of lightning bolts on each unit affected. The cooldown on the ability was bugger all. (5 secs then going down [3 lvl ultimate])

It was the mana cost that was the killer.

Also leakage was a problem because the whole 'edge' to the game is to survive against HORDES of units.

I have them spawning frequently in mass (incidently i 'believe' i have stopped that leak). So, I have been attempting to 'streamline' the map and make it as smooth as possible. If you have any tips, suggestions or info, throw it my way.

Often I found that the funnest part in hero combat, is the threat and anticipation of losing, of being smothered by units.

Once you stop that, and begin pushing forward toward the spawn point, the game becomes boring as ridiculous levels, tomes, claws +376235236 dmg and MASS criticals, 23982925995892 health, lifesteals and AOE spells take the threat away and soon you are hitting schoolyard children with a bulldozer.

I am attempting to solve that, with no lifesteal no tomes, no claws +3125395, no massive criticals, and relatively low powered aoe spells. Playing it solo, is impossible, with almost decimal xp awarded per kill, strategising skills, waiting and teamplay, is paramount.

Each hero plays a specific role, and most have skills that aid or compliment other heros.

OK so this is a shameless plug, but, i got tired of the suped up MK's, BM's, AM's, Wardens, and the first person to get a mask of death and high dmg would own everything.

I am probably going to throw some quests in, that require one or more players, to stop fighting and venture somewhere. Thus making it harder for the others to survive, but the benefits of completing the quest, could make it easier. Time limited quests, would be ideal, as it would give a urgency to actions, and a greater tension.

So.. lag and leakage is something I would like to avoid as much as possible.
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
Rinpun said:
Leakage only happens on a serious level when you use clumsy JASS
'Clumsy JASS' is as bad as the equvalent 'greatest GUI'. You can create most serius leaks with GUI but needs JASS to remove them.


Lag is mostly caused by alot of units/effects/projectils. Leaking is caused by everything, almost, if you dont watch out. Places were it is VERY bad (and easy) to have a leaking actoin or two is
a) loops
b) pick every unit
c) nested variants of a + b
d) periodic triggers

Spawn triggers is a good place to start looking, since they atleast leak 1 location if not more.
 

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
Thats, what i gathered.

And from the tutorial, i gathered that*, if I am using pick every unit, its better to form a group variable, then use that to issue the commands, then destroy it. And repeat such an action.

As a result, the spawn points are a single variable, that is set and destroyed individually.

The same goes for the units created, only i have shoved them into an array, as, i have an order to give the whole group (explode on death and attack move to)

I figured that it might be better to issue that order once rather than four times every small amount of seconds, (currently at 7-pending balance). If any of you are interested i could post it up.

But, I am going away until sunday/monday so....
 
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