Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Global variables and Local Map variables.
Homicide13 Offline
Senior Member

Posts: 323
Threads: 41
Joined: Nov 2010
Reputation: 14
#8
RE: Global variables and Local Map variables.

By your string list implementation do you mean your functions for parsing strings? (and if not could you provide a link to what you're referencing? D: Unless I just completely missed something haha)

But so in other words if I use a lot of different local map variables in a specific map, it will keep these variables in memory (or will re-load them to memory whenever I load a save) until I use the ClearSavedMaps() function (supposedly).

But would I be able to clear specific variables by setting them to a null value? I know there was something similar to this back when I used to script for Warcraft 3 maps, and certain variables wouldn't necessarily be removed (specifically "location" variables) unless they were manually destroyed and set to null.
(For example, a function might look something like this: Although it was only really location variables that would leak if not set to null, it was considered good form to do this with all of your variables.)
PHP Code: (Select All)
function Trig_ModeAR_Func002A takes nothing returns nothing
    local player p 
GetEnumPlayer()
    
local location l GetUnitLoc(udg_Base[GetConvertedPlayerId(p)])
    
local location sl GetPlayerStartLocationLoc(p)
    
set udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetLastCreatedUnit()))] = GetLastCreatedUnit()
    
   
//Do stuff

    
call RemoveLocation(l)
    
call RemoveLocation(sl)
    
set l null
    set sl 
null
    set p 
null
endfunction 

04-29-2012, 03:24 AM
Find


Messages In This Thread
RE: Global variables and Local Map variables. - by Homicide13 - 04-29-2012, 03:24 AM



Users browsing this thread: 2 Guest(s)