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

(Trigger Leak) Player Group

Status
Not open for further replies.
Level 1
Joined
Nov 7, 2015
Messages
1
Greetings.

Thank you very much for taking your time to read this post.

I have a very novice understanding of how triggers work. I usually do not post on hiveworkshop, because I could always find answers using the search option. However, I believe I've encountered problem that cannot be solved very easily using either thehelper or hiveworkshop threads.

I've checked this thread: http://www.hiveworkshop.com/forums/triggers-scripts-269/each-integer-vs-player-group-271744/ , but could not understand the basic principle of how I should structure my trigger to work.

In this thread: http://www.thehelper.net/threads/triggers-memory-leaks.20731/ / http://www.hiveworkshop.com/forums/world-editor-help-zone-98/each-integer-x-y-52461/ I couldn't understand it either, as it doesn't goes in too much detail on how integers work.

Also, in this thread (http://www.hiveworkshop.com/forums/...e-my-existance-player-group-leak-help-196050/), one of the users suggests, that integer method is somehow bugged. What is that bug? Can it be avoided in my case?

So, if it's possible, I'd like to ask anyone who understands this subject better to explain, how can I fix my (Player Group) leak using the integer method, described here: http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/complete-list-things-leak-126761/ (where it says "to avoid the force, use the loop"). I did not quite understand what was meant in message by the tutorial giver, saying: "If your forces are setup transition numerically with no skips, there is an alternative to even using player groups. That might not have made much sense, so I'll give an example.".

This is a screenshot with my trigger:

http://imgur.com/noaKdgU
Qhmpmp1.png


What I'm trying to achieve is a same trigger (perhaps, using the integer method, described in the tutorial) but without a memory leak.

Thanks in advance.
 
Last edited:
Hi Fainor,
nice you post here if you can't find a solution!.

At first, there is a simple way on hive how to post your triggers.
It can make it simple for you the next time: Link

As Genesys said, "All Players" force/group does not leak. It is a special case.
You can read up some general information here to get a better understanding what leaks are: Link

You trigger looks very fine and I would not change it.

But if you would want to make it with integer loop it would look like:

Pseudo code
Code:
For Each Integer i from 1 to 12 make Actions:
---- Visibility - Create an initially Enabled modifer for Player[i]

The integer "i" goes from 1 to 12 and each time the action inside the loop will run.
So it will make the action for player[1] to player[12].
The code above with loop will have same result as:

Pseudo code
Code:
Visibility - Create an initially Enabled modifer for Player[1]
Visibility - Create an initially Enabled modifer for Player[2]
Visibility - Create an initially Enabled modifer for Player[3]
Visibility - Create an initially Enabled modifer for Player[4]
Visibility - Create an initially Enabled modifer for Player[5]
Visibility - Create an initially Enabled modifer for Player[6]
Visibility - Create an initially Enabled modifer for Player[7]
Visibility - Create an initially Enabled modifer for Player[8]
Visibility - Create an initially Enabled modifer for Player[9]
Visibility - Create an initially Enabled modifer for Player[10]
Visibility - Create an initially Enabled modifer for Player[11]
Visibility - Create an initially Enabled modifer for Player[12]

And no, integer loops don't bug. He means not to use "Integer A" as integer, but to use your own custom variable for it.
This is a bit of an other story, but just remember better to use your own integer for loops.
 
(All players) refers to an unchanging player group handle called bj_FORCE_ALL_PLAYERS. For some reason they give access to the bj_FORCE_PLAYER array by direct player specification but do not allow you to access its indices arbitrarily, so instead of getting the existing force for a player, converting a player to player group creates a new handle each time.

TL;DR: (All players) and the 16 forces which have the player index next to them do not leak; the others do.
 
Status
Not open for further replies.
Top