Xonotic Forums
[SUGGESTION] Xonotic and NetRadiant: Start Animated Model with trigger event? - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Help & Troubleshooting (https://forums.xonotic.org/forumdisplay.php?fid=4)
+--- Thread: [SUGGESTION] Xonotic and NetRadiant: Start Animated Model with trigger event? (/showthread.php?tid=3064)



Xonotic and NetRadiant: Start Animated Model with trigger event? - Soelen - 05-27-2012

As threadname already mentioned, I want to know if there's a possibility to play/stop an animated model (md3) by touching a trigger? Or even telling the md3 model on which frame to start?

Thanks in advance


RE: Xonotic and NetRadiant: Start Animated Model with trigger event? - CuBe0wL - 05-27-2012

I'd do it with changing the models spawnflag to 16 with a func_spawn, just like I change models on Newtonian Nightmare on the even of destroying the generators (=destroying an invisible entity, that when dies, triggers off other entities.)


RE: Xonotic and NetRadiant: Start Animated Model with trigger event? - Soelen - 05-27-2012

unfortunately I can't analyse Newtonian Nightmare until tomorrow night, but what I understand is by destroying the generator you made one (the not-broken generator) invisible and the other (broken generator) visible? Sounds interesting indeed, gonna check that out soon heh thanks Mr.Brutail

But still, I need to know if there's a way to manipulate the frame from a gamemodel somehow, manupulating like where to start, stop the animation, restarting again etc.

Thanks in advance!

Edit: I was thinking about to design a map like a music video, this is why I need to know


RE: Xonotic and NetRadiant: Start Animated Model with trigger event? - CuBe0wL - 05-27-2012

Haha, actually, no, I lied! Or rather, I've totally forgotten what the hell I've done there Big Grin It's an entity hell, I'll rather describe.
I was right about the func_breakable part. You actually damage that, the generator is only for the looks. However, when you kill the func_breakable, it has:

mdl_dead : optional replacement model to show when destroyed

So the model switching is handled here. It also has:

mdl : particle effect name to show when destroyed

set, so there's a nice explosion played too. Now, the actual generator model is a misc_gamemodel, that is attached to the func_breakable with "target" key - this way when the func is killed, the model is removed too, and placed back, when the func respawns (with a chained trigger_multiple the fires off multiple trigger_relays, that has a delay key of 60s), so no spawnflags magics where used there. Like I said, entity hell Big Grin Have fun figuring out the trigger routes Big Grin

I've looked a little further in the descriptions of NetRadiant. There's now an entity called:

misc_breakablemodel
This is a model which can be damaged.
Once all health is consumed it'll disappear and trigger the targeted entity/entities.
When triggered, it resets to full health, and unbreaks.

When I made NN this entity was not avaible, so you might be able to skip the trigger brush part entirely. However, it might have some quirks, so better ask divVerent about those.
For animation, you can use the "frame" or "_frame" keys on misc_model and misc_gamemodel entities. misc_clientmodel and misc_breakablemodel doesn't have the key in their descriptions, however this doesn't automatically means it won't work - might be only undocumented, you have to try.
Now playing actual animations might be tricky. For md3 models, DP certainly can only use the the animation frame, but iirc it can't animate (fun, lesser known fact: the xonotic launchramp model has multiple frames, so by setting those you can get different angles of the launcher Big Grin).
The only case when animated models were shown on a map iirc was on the ONS map of Nexuiz (can't recall it's name atm.), and those were zym models, and Morphed made them, so on this issue you should poke him and ask for directions.


RE: Xonotic and NetRadiant: Start Animated Model with trigger event? - Mr. Bougo - 05-28-2012

I don't see anything in the code for animation control using triggers. I thought there was a trigger that could modify entity fields but I was mistaken -- it's actually target_spawn that I was thinking about and I don't think it's of any use here.

This could be a good feature request.

Also, keep in mind that the bg music doesn't start at the same time for every client. Maybe use a music trigger. I hope it'll work fine for you. func_pointparticles' bgmscript works great because it's done clientside. gamemodel animation unfortunately isn't.