Nexus Skirmisher
Nexus Modding => Scripting => Topic started by: DreamorCZ on February 01, 2011, 11:47:07
-
Here is a simple question about difficult matter: Can be animations like #anim attacked# or #anim def# activated/deactivated through script?
For what?: Jump in/out animations (Destiny engine charging, Galactica's docks etc.). In-game cinematic without need of CGIs for simple animations. And other things you can think off.
-
Yep, there are two commands available:
AnimateShip(ship, animate) (http://nexusthegame.net/wiki/AnimateShip)
... for starting or stopping the default animation loop (#anim def x y#)
PlayShipAnim(ship, anim_name, backward) (http://nexusthegame.net/wiki/PlayShipAnim)
... for playing back any other named animation (#anim <name> x y#)
Set "backward" to something non-zero for reverse playback, so as to revert to the original state before the animation.
-
That's more than great, actually. This way might be possible to create any animation we need by adding these commands as include to the mission folder. Theoretically we should be able to easily add weapon fire animation and jump animation with help of some conditional scripts.
I would do some testing of this theory myself but my scripting knowledge is too much basic for this. So, would someone here be willing to spare some of his/her time to create a script for weapon animation for me or even test it right away?
-
I don't think fire animations will work that way. The animation would need to be create in the turret's model file, which is then ingame attached to the ship (possibly multiple times for different weapon slots) - I don't know if you can play back any turret animations by using PlayShipAnim().
If the turret is directly modelled into the ship's mesh, you could create a firing animation for each of these turrets (#anim turretFire1#, #anim turretFire2#, etc.) and play them back (maximum of only 10 animations available, though, it seems). The problem is, that you'd have to choose the correct animation depending on what weapon slot currently fires... and I don't know a way to actually find this piece of information with scripting.
Sure, you can request a Fired event for all weapon systems and then get the firing weapon in E.location ... but how do you get the actual weapon slot? How do you know what of your X fire animations to play?
Jumping animations surely are possible, although you'd have to add that animation to all models separately in order to support jumping animations for all of your ships.
-
True, there is more then one problem. I'm not entirely sure but I think there can be added script witch can denote what happens when player activates certain device.
Well, I'm going to learn much more about scripting soon and then I will try these impossible things myself and maybe will find some solutions.
Anyway, thank you Arparso.