Difference between revisions of "Simulating new functions"

98 bytes added ,  02:17, 19 April 2006
made last set of scripts safer
imported>Maian
imported>Maian
(made last set of scripts safer)
Line 149: Line 149:


begin OnActivate
begin OnActivate
   Message "start func", 1
   if IsActionRef Player != 1
  set result to param1 + param2
      Message "start func", 1
  Message "end func: %.0f", result, 1
      set result to param1 + param2
      Message "end func: %.0f", result, 1
  else
      Activate
  endif
end</pre>
end</pre>


Calling script:
Calling script:


<pre>scn testobj2script
<pre>scn testobjscript


float r
float r
ref self
begin Onload
  set self to GetSelf
end


begin OnActivate
begin OnActivate
Line 164: Line 173:
   set testfuncref.param1 to 10
   set testfuncref.param1 to 10
   set testfuncref.param2 to 20
   set testfuncref.param2 to 20
   testfuncref.Activate Player, 1 ; <-- function call
   testfuncref.Activate self, 1
   set r to testfuncref.result
   set r to testfuncref.result
   Message "after call: %.0f", r, 1
   Message "after call: %.0f", r, 1
Anonymous user