User Tools

Site Tools


prpl:readglobal

<- PRPL reference <- Vars and Functions

<-*VARNAME

ArgumentsResultNotation
none value [ - r1 ]

Description

Pushes the value of global variable VARNAME to the stack. If that variable does not exist, 0 is pushed to the stack instead. Global variables can be accessed by any script on the map.

Examples

# In one script:
42 ->*myGlobalVariable
# In any script on the same map after that point:
<-*myGlobalVariable trace
# Shows 42 in the debug window.
	s1 = command.data.GetString(); 
		stack.Push(GameSpace.instance.globalHeap[s1]); 
		stack.Push(new Data(0)); 
 
prpl/readglobal.txt · Last modified: 2017/10/24 18:16 by GameGibu