• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Storing All Players to variable question

Status
Not open for further replies.
Well, it isn't necessary. However, it is recommended to do so efficiency-wise.

When you use (All Players), it calls:
JASS:
function GetPlayersAll takes nothing returns force
    return bj_FORCE_ALL_PLAYERS
endfunction
(iirc)

So each time you use "All Players", it is performing an extra function call. This does not generate a new force, so you're not leaking. However, assigning it to a global means that you'll read a global (fast) instead of reading a function (slower).

For personal mapping, this usually doesn't matter though (except when the op limit is an issue). It is a matter of nanoseconds and no player will ever notice the difference. As such, it is up to you.
 
Level 4
Joined
Jul 20, 2012
Messages
83
Well, I reworked all functions that used All Players or Allies/Enemies of Player group when it comes to showing messages and now nothing shows at all... Yes I tried storing those group at initialization, after 0.00 seconds and even after 1.00 or 5.00 seconds... Nothing happens from now on... I doesn't even fire sound effects that have nothing in common with those groups...

EDIT: That sound firing is problem on my side I found where the problem lies but the rest is still there.
 
Level 4
Joined
Jul 20, 2012
Messages
83
This procedure would take too much time, it's like the map itself compiles like 3-4 minutes, then it loads another 1-2 minutes when it's not all optimized... I don't know what could possibly cause the issue that's why I'm going to use playergroups for text messages normally without storing anything, it will add nanoseconds to process the stuff but it will work for me :-/
 
Level 4
Joined
Jul 20, 2012
Messages
83
I hope you would understand, it's not like I'm not sharing my knowledge, if there's something people want to know I'm more than happy to help them...
DIMF: There's not much to post, I stored All Players to PlayerGroup and when there was a function that wanted to know who to post it to, instead of putting All Players group I set it to the stored variable, it just didn't work at all...
 
Level 4
Joined
Jul 20, 2012
Messages
83
Well, now that I reverted everything to old values (All Players) does no longer works, what's wrong with it???
Simple
  • Game - Display to (All players) the text: Welcome to |c00ff03...
or
  • Quest - Display to (All players) the Simple Hint message: Wait for host to ch...
doesn't work at all even the sound at Simple Hint won't fire off!

I deleted every single player group I used for it when I was storing them, it's all like before when it worked but it doesn't. I'm not saying I'm not thankful for help but yes I am now :D

EDIT: New discoveries showed that when I use storing player groups like this:
  • Set TempPlayerGroup = (All players)
  • Player Group - Pick every player in TempPlayerGroup and do (Actions)
    • Loop - Actions
      • Hero - Make (Picked player) Heroes gain 200.00% experience from future kills
  • Custom script: call DestroyForce(udg_TempPlayerGroup)
then destroying of the "temporary" group destroys it and its use entirely from the game... Is there any way to make this trigger work without destryoing the All Players function?
 
Last edited:
Level 4
Joined
Jul 20, 2012
Messages
83
All I did was before picking player group (all players) I stored All Players to TempPlayerGroup and after the function with picked player I destroyed the temp group destroying the All Players entirely never able to be used again in the map...

Here's question, now that I know I cannot destroy TempPlayerGroup variable where All Players is stored, should I leave the TempPlayerGroup without the destroying script and when I overwrite that variable with any other player group that is not All Players but only players that are playing for example I can destroy it (when it's not players of control a.k.a. All Players or Allies/Enemies of (player)) with that script?
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
All I did was before picking player group (all players) I stored All Players to TempPlayerGroup and after the function with picked player I destroyed the temp group destroying the All Players entirely never able to be used again in the map...

Uhm no, you are not supposed to do that. I just said it earlier.

Here's question, now that I know I cannot destroy TempPlayerGroup variable where All Players is stored, should I leave the TempPlayerGroup without the destroying script and when I overwrite that variable with any other player group that is not All Players but only players that are playing for example I can destroy it (when it's not players of control a.k.a. All Players or Allies/Enemies of (player)) with that script?

You should create a new global for All players altogether and use that temp variable for those other player groups.
 
Status
Not open for further replies.
Top