Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
oh - I should mention that it's used inside a monster definition
THOM formaly known as tschrage _______________________________________________ My MOD (LoG1):Castle RingfortThread My MOD (LoG2):Journey To JusticeThread | Download
delayedCall is like a connector. It essentially calls [first parameter].controller:[third parameter]([fourth+ parameters]) after [second parameter] seconds. If the component named "controller" is a ScriptControllerComponent rather than a ControllerComponent, it essentially calls [first parameter].script.[third parameter]([fourth+ parameters]). I didn't forget to type ':' instead of '.', it actually is an "unbound" call unlike the ControllerComponent version.
So if your object doesn't have a ScriptControllerComponent named "controller" and a ScriptComponent named "script" with a function "shootProjectile", it won't work.
function castFrostbolt()
"frostbolt", 1.0, 15 or whatever
end
delayedCall(self.go.id, 0.2, "castFrostbolt")
self.go.id if the function you call is in the same script as the delayed call.
castFrostbolt is thus the name of the function. You cannot pass parameters with this, it seems.
Hope it helps.
Thank you all.
delayedCall is still a mystery for me - with minmays explanation I'm a little bit wiser now...
cromcrom - I know that this is the way to trigger a function inside a script entity - but I doubt (without having tried it) that this would work to call inside a monster definition (it is a monster i my case that is supposed to cast a frostball...)
Last edited by THOM on Fri Sep 11, 2015 9:58 am, edited 1 time in total.
THOM formaly known as tschrage _______________________________________________ My MOD (LoG1):Castle RingfortThread My MOD (LoG2):Journey To JusticeThread | Download
THOM formaly known as tschrage _______________________________________________ My MOD (LoG1):Castle RingfortThread My MOD (LoG2):Journey To JusticeThread | Download
THOM wrote:Thank you all.
delayedCall is still a mystery for me - with minmays explanation I'm a little bit wiser now...
Isaac - I know that this is the way to trigger a function inside a script entity - but I doubt (without having tried it) that this would work to call inside a monster definition (it is a monster i my case that is supposed to cast a frostball...)
delayedCall with a monster as the target is a bad thing to do: monsters tend to die, and their object is destroyed shortly after that. Trying to execute a connector on an object that doesn't exist won't cause a crash, but it will print a warning to the console. Why not use an animation event instead?
hi, its only possible to place cinematics.ivf ? im trying to place a cinematic to end my mod, but i dont know how to change the format from mp4 to ivf. someone can help please ?