@wacov said:
@unknownuser said:
Never really got back to this one: Are we going to be able to set an object's scripting from an external source code?(ie setting an emitted object to explode on impact.)
Any SU ruby would work, ao you might be able to load an external .rb file as an ontick func, or whatever. But you don't need that to do what you're asking, as Jav has shown; and anything that SU can detect can be acted upon.
Hi everyone. Sorry I have been quiet lately. Been taking some time off and enjoying the summer.
I think it is possible to set events externally with this version. I know the the syntax is a bit weird and I plan to clean it up.
Create a good sized cone and put this in its scripted field.
b=copy
b._setEvent("ontick",
<<CODE
push([0,0,1])#go forward
if(frame>50)
destroy #die after 50.
end
CODE
)
The cone will copy itself and then set the "ontick" event in the copy.
I tried to make an example that uses "ontouch" but it didnt work for some reason. I will have to debug it.