Announcement

If you are having trouble logging in, please reset your password.
If you are not getting an activation email, please check your spam or
use the "Contact Us" to contact an admin.
August 21, 2012, 06:43:06 PM Last Edit: January 01, 1970, 12:00:00 AM by Guest
Hello guys




Let's just tell, that I have two script


 




1. is like:




bla bla bla bla.....




let flt[0] = 2




bla bla bla bla.....




label 1




let flt[0] = flt[0]-1


 




2. is like:




bla bla bla bla.....




if flt[0]=1,1000,-1




bla bla bla bla.....




label 1000




do something


 




It doesn't work. How do I mafia get to share flt[0] between scripts? It seems like variables are local for each script.




I temporrary edited scripts so they are like:


 




1. is like:




findactor 1, "script2"




let flt[0] = 2




bla bla bla bla.....




bla bla bla bla.....




label 1




let flt[0] = flt[0]-1




label 69




if flt[0]=1,1000,-1




label 1000




setevent 1,100,-1


 




2. is like:




bla bla bla bla.....




bla bla bla bla.....




event 100




do something


 


 




It doesn't work. What am I doing wrong?




let flt[0] = 2 is before any labels, so it will do only once

#1 August 21, 2012, 08:54:19 PM Last Edit: January 01, 1970, 12:00:00 AM by Guest
Use get_remote_float or set_remote_float


 




get_remote_float xx, yy, zz - returns to xx a value in variable zz which is in script yy




xx - ID of variable in current script




yy - ID of actor remote script




zz - ID of remote variable in script yy


 




set_remote_float xx, yy, zz - sets variable xx as variable zz in script yy




xx - ID of variable in current script




yy - ID of actor remote script




zz - ID of remote variable in script yy


 




In your script:







<pre class="ipsCode">script_1:

...

let flt[1] = 2

...

label 1

let flt[1] = flt[1] - 1</pre>






 







<pre class="ipsCode">script_2:

// eg

findactor 3, "script_1"

...

// you have to use get_remote_float always, when you want to get a value from remote variable

get_remote_float 0, 3, 1

if flt[0] = 1, 1000, -1

...

label 1000

...</pre>

#2 August 21, 2012, 10:10:42 PM Last Edit: January 01, 1970, 12:00:00 AM by Guest
As far as I was aware, variables have to be flagged in the hex, otherwise the script bypasses them as ordinary and inanimate commands.

#3 August 21, 2012, 10:21:35 PM Last Edit: January 01, 1970, 12:00:00 AM by Guest
Thanks guys, I've already solved it. I typed "fintactor" instead "findactor", I am such a dickhead  :-[