[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Modding > JASS Resources


JASS Resources Find JASS code snippets and functions here or write your own and post it on the Submissions sub-forum.

Reply
 
Thread Tools
Old 04-24-2012, 10:48 PM   #16 (permalink)
Registered User Troll-Brain
cool != useful
 
Troll-Brain's Avatar
 
Join Date: Apr 2008
Posts: 1,948
Troll-Brain is just really nice (377)Troll-Brain is just really nice (377)Troll-Brain is just really nice (377)Troll-Brain is just really nice (377)
Quote:
Originally Posted by Magtheridon96 View Post
After realizing that calling a struct Player makes it impossible for me to call the function Player even inside the library itself, I changed my system to use:
function PlayerEx takes integer i returns player
I gave it TESH Highlighting too <:
It's true than you won't be allowed to use the native function Player anymore in "bottom" libraries, and scopes.
But if you really want to spell your struct Player, you can still use a second library used by your player library, where a global player array is filled with the 16 players.
And then, inside your player library you use this global variable.

Or if jasshelper memorize this struct name in the whole vJass scripts, you still can use a custom common.j or blizzard.j for this global array.

And if you use the Player native when there is now a great way to use a global instead, it will even give you a nice senseless error on compilation to prevent this heresy to happen.
__________________
- There are bugs with wc3, but most of time, the bug is between the keyboard and the chair.
- Never believe some warcraft "fact" without a proof, even from an "experienced" user, that's how myths & legends born.

You spam "...", "lol", and smilies such as "; p", "^)^",">.>"? You think you're the best and all other ones are stupids or at least less clever than you ? You think your errors are funny, while the other ones are incredibly lame ?
Maybe you've too much ego,or worse, you're a douchebag
Troll-Brain is offline   Reply With Quote
Old 06-14-2012, 07:38 AM   #17 (permalink)
Forum Moderator Bribe
Keep it simple
 
Bribe's Avatar
Spells, Help Zones & JASS Moderator
 
Join Date: Sep 2009
Posts: 5,581
Bribe has much of which to be proud (1209)Bribe has much of which to be proud (1209)
PayPal Donor: This user has donated to The Hive. 
I have seen PlayerManager by Nestharus but I will accept this as a simpler alternative.
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.

Bribe is offline   Reply With Quote
Old 06-25-2012, 08:35 PM   #18 (permalink)
Registered User LuizBills
...
 
LuizBills's Avatar
 
Join Date: Jun 2011
Posts: 80
LuizBills has little to show at this moment (28)LuizBills has little to show at this moment (28)LuizBills has little to show at this moment (28)
These locals need not be nulled?

Jass:
private function IndexPlayers takes nothing returns nothing
  local player  pl
  local code    c = function DetectLeavers
  //...
  set pl=null
  set c=null
endfunction
__________________
My Resources: BuffGenerator
LuizBills is offline   Reply With Quote
Old 06-25-2012, 08:38 PM   #19 (permalink)
Forum Moderator PurgeandFire
ʕ•͡ᴥ•ʔ
 
PurgeandFire's Avatar
Resource & Tutorial Moderator
 
Join Date: Nov 2006
Posts: 3,665
PurgeandFire has much of which to be proud (1144)PurgeandFire has much of which to be proud (1144)PurgeandFire has much of which to be proud (1144)PurgeandFire has much of which to be proud (1144)PurgeandFire has much of which to be proud (1144)PurgeandFire has much of which to be proud (1144)PurgeandFire has much of which to be proud (1144)
The reason we null locals is because of a bug where, upon destroying an object, the handle id will not be recycled unless all locals pointing to the object have been nulled. (or assigned to point to something else) However, since we are dealing with players and code variables which will never be destroyed, we don't really have to null them.
PurgeandFire is offline   Reply With Quote
Old 06-26-2012, 04:15 AM   #20 (permalink)
Registered User LuizBills
...
 
LuizBills's Avatar
 
Join Date: Jun 2011
Posts: 80
LuizBills has little to show at this moment (28)LuizBills has little to show at this moment (28)LuizBills has little to show at this moment (28)
Oh thanks man =)
__________________
My Resources: BuffGenerator
LuizBills is offline   Reply With Quote
Old 06-26-2012, 06:29 AM   #21 (permalink)
Forum Moderator Bribe
Keep it simple
 
Bribe's Avatar
Spells, Help Zones & JASS Moderator
 
Join Date: Sep 2009
Posts: 5,581
Bribe has much of which to be proud (1209)Bribe has much of which to be proud (1209)
PayPal Donor: This user has donated to The Hive. 
Just null all handles. There are semi-confirmed reports of people who reduced lag in their game simply by nulling player handles.
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.

Bribe is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 01:48 PM.





Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle