• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Bugged Spell That could be posted

Status
Not open for further replies.
Remove Unit Group [a] = Epic Fail HELP!

Nice wave that moves together with the keyboard, silence units on its way.

It moves units into unit group called ugflame[*player number*]
but ever since it try to destroy the group -> the group become a leak instead.
Please help me fix it so we all could enjoy this spell.
:goblin_good_job:
  • Wave of Flame Death
    • Events
    • Conditions
    • Actions
      • Set A = (Player number of (Owner of (Dying unit)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • A Equal to 1
        • Then - Actions
          • Custom script: call DestroyGroup (udg_ugflame[1])
        • Else - Actions
          • Custom script: call DestroyGroup (udg_ugflame[udg_A])
^ none of those helped.
http://www.hiveworkshop.com/forums/attachment.php?attachmentid=110145&stc=1&d=1326661538
 

Attachments

  • Wave of Fire Test.w3x
    25.8 KB · Views: 59
Last edited:
Level 14
Joined
Apr 20, 2009
Messages
1,543
Nice wave that moves together with the keyboard, silence units on its way.

It moves units into unit group called ugflame[*player number*]
but ever since it try to destroy the group -> the group become a leak instead.
Please help me fix it so we all could enjoy this spell.
:goblin_good_job:
  • Wave of Flame Death
    • Events
    • Conditions
    • Actions
      • Set A = (Player number of (Owner of (Dying unit)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • A Equal to 1
        • Then - Actions
          • Custom script: call DestroyGroup (udg_ugflame[1])
        • Else - Actions
          • Custom script: call DestroyGroup (udg_ugflame[udg_A])
^ none of those helped.
http://www.hiveworkshop.com/forums/attachment.php?attachmentid=110145&stc=1&d=1326661538

If your using a variable to store a group, then when destroying it, it means you will not be abled to access it again because it is destroyed...

GUI group variables do not need to be destroyed if they are going to be used throughout the entire game.

It's not a leak if it is supposed to be there the entire game.
If at some point the group is not going to be used in any trigger anymore, then at that point it's safe to destroy the group.
But only if you are sure that your not doing anything with that group afterwards.

If you are, then you can check if the group variable is empty or not with the following Custom Script line:
  • Ofcourse you would have to set the group variable to be empty after you've destroyed it.
  • Custom script: set udg_myGroup = null
  • After that you can check if the group is empty with the following script:
  • Custom script: if udg_myGroup == null then
  • Some actions here for whenever the group is empty...
  • Custom script: endif
If it's a temporary group then you would need to destroy the group since your not going to reference it again.
Meaning that the temporary group will stay inside the game untill it ends unless being destroyed.


EDIT: Here's an example of how it works.

Whenever a group is created it is being stored inside your RAM memory.
A variable is basically something that points to the location in your RAM memory where this group is stored.
By destroying the group you remove it from your RAM memory.
But the variable now points to an empty location inside your RAM memmory.
Which means that the variable can now not be used anymore since it doesn't point to anything.
Unless the location where it points to is being filled with a new group, which means the variable then points to the new group (This is a bit more advanced though).

A leak basically means that you did not destroy the group inside your RAM memory after using the group, and neither did you set a variable to point to the the newly created group inside your RAM memory.
Meaning the group is now lost somewhere inside the memory because there's nothing that points to that group, nor anything that destroys it inside the memory.

So a leak basically is something that is stored inside your RAM memory without anything that points to where it is being stored. Meaning that it's lost inside your RAM memory and takes up some of your RAM memory usage untill the game ends.
You would need to clean up the leak in order to reduce the RAM memory usage.
If however the purpose of the group is to exist the entire game then it's not a leak.
Since that is what it is supposed to do.
 
Last edited:
Level 14
Joined
Apr 20, 2009
Messages
1,543
Okay, so what I did was recreate all your GUI triggers in Jass in order to optimize it a LOT more.
I'm not saying your GUI triggers where bad, they were in fact quite good except for a few minor things here and there.
But instead of bothering I thought let's just optimize it a lot more since GUI is just slow in comparison to Jass...

Also: If you want to optimize it even further, you might want to setup a few unit group variable that it cycles through instead of picking all the units within range every 0.05 seconds.

(That's the only thing I know that can optimize it even further)


Ow and erm, you can remove the following variables from your variable editor:
Integer
itemtype (Wait, LOOT!?)
LastPlayerSummoned (Can a player be summoned O,o??)
MAX
p
p2
playerhero
playertarget
real
ug
ut
WaveSound (My bass is breaking the soundbarrier here!)
Zilluision (Houdini is in da house? Is the Illusion the misspelling of Illusion here by saying illuision? I like puzzles ^.^)

Those variables are not in use anymore...

The map is in the attachment, have fun ;)
 

Attachments

  • Wave of Fire Test .w3x
    29 KB · Views: 41
Okay, so what I did was recreate all your GUI triggers in Jass in order to optimize it a LOT more.
I'm not saying your GUI triggers where bad, they were in fact quite good except for a few minor things here and there.
But instead of bothering I thought let's just optimize it a lot more since GUI is just slow in comparison to Jass...

Also: If you want to optimize it even further, you might want to setup a few unit group variable that it cycles through instead of picking all the units within range every 0.05 seconds.

(That's the only thing I know that can optimize it even further)


Ow and erm, you can remove the following variables from your variable editor:
Integer
itemtype (Wait, LOOT!?)
LastPlayerSummoned (Can a player be summoned O,o??)
MAX
p
p2
playerhero
playertarget
real
ug
ut
WaveSound (My bass is breaking the soundbarrier here!)
Zilluision (Houdini is in da house? Is the Illusion the misspelling of Illusion here by saying illuision? I like puzzles ^.^)

Those variables are not in use anymore...

The map is in the attachment, have fun ;)

DUDE! the bird IS NOT seppoused to spread splashes of blood that make burn / silence effect, instead, it need to move and WHEN SOMETHING GET HIT then it make "omg this unit was cut" EFFECT! , And : the bird is allways created at the location of the caster at the facing between him and the cast location- your bird allways fly to the bottom of the screen and wait for someone to order it arround. (it don't really like to be bossed arround) please fix
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
DUDE! the bird IS NOT seppoused to spread splashes of blood that make burn / silence effect, instead, it need to move and WHEN SOMETHING GET HIT then it make "omg this unit was cut" EFFECT! , And : the bird is allways created at the location of the caster at the facing between him and the cast location- your bird allways fly to the bottom of the screen and wait for someone to order it arround. (it don't really like to be bossed arround) please fix

I'm deeply sorry, I didn't notice it. I will fix it as soon as I get home...

So things that need to be fixed:

1. The effect needs to be created whenever a enemy unit is in range and is being hit, and it needs to be created on the position of the unit that is being hit right?

2. When the bird is created it should be created on the position of the ability being cast, and it should move forward in the angle it is being cast right?
Or do you want it not to move at all untill the player moves the bird?

Please tell me if I missunderstood. If I did I will change it to your needs.

Here is the new version with the fixes explained above (took me 12 seconds to fix it):


EDIT: b.t.w. I see your using the arrow keys. But wouldn't this be a bit annoying since the camera position then changes? Why not use ability's with keys such as W, A, S, D in order to move the bird?
 

Attachments

  • Wave of Fire Test (1).w3x
    28.8 KB · Views: 41
Last edited:
Status
Not open for further replies.
Top