[Suggestion] Support for Custom Dynamic Objects through CreateObject()

Started by GangstaRas, Aug 03, 2019, 12:43 AM

Previous topic - Next topic

GangstaRas

It's as the title says, unless I missed something, I would like the capability to properly load dynamic objects via the script.

Currently, AFAIK if you use CreateObject(), you lose all the physically interactive settings set forth in XML, and thereby have yourself a static object. Idk if it applies for every dynamic setting but my interest lies in the physics aspect.

What do I hope to accomplish? Bringing destructive physics to VC:MP to do stuff like this:

https://youtu.be/r9DcsuOPVf8?t=00m10s

But I need the control from the available functions for this. So, is it doable?

Xmair

What you're trying to achieve can be done by creating some left over object pieces, removing the wall on explosion and using object.MoveTo & object.RotateTo on the custom left over object pieces. Or you can use the glass flag property on a custom object and treat it as a wall. It will however break when it is fired with any gun and not just explosives.

About the suggestion, I don't think it is possible as someone else (probably strummus) already explained that the server does not have any physics, only the client does.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

GangstaRas

Quote from: Xmair on Aug 04, 2019, 08:00 AMWhat you're trying to achieve can be done by creating some left over object pieces, removing the wall on explosion and using object.MoveTo & object.RotateTo on the custom left over object pieces. Or you can use the glass flag property on a custom object and treat it as a wall. It will however break when it is fired with any gun and not just explosives.

About the suggestion, I don't think it is possible as someone else (probably strummus) already explained that the server does not have any physics, only the client does.

To answer the first point, the idea was to let the game handle the physics of the object pieces, as doing object.MoveTo and object.Rotate is a whole lot of work that still won't come out particularly "accurate" to the context of any given scenario of a scene. So for example, the direction of a blast that would push the pieces one way versus another, the floor beneath, all of that I'd have to tediously account for. That window breaking flag is not direction I want to go.

That 2nd point, I'm having a hard time understanding why not. I'm not asking for the server to run the physics, I'm asking for it not to ignore the object properties so say for example an in-game object, explosive barrel, sync issues aside, if I do CreateObject() on its model ID, I'm expecting that object to blow up if I shoot at it, so the only thing the server did, was just to load and move that object into my presence, but the game did the rest of its "natural" work, accounting for the object properties present in the client's object.dat.

Even closer to home, just like how your player runs, shoots and jumps off a roof, its the client's game handling all of that processing, not the server right? Server only syncing the actions. We can teleport players via script all over the map etc. The same of vehicles, both dynamic objects. So if all that's so, why can't objects loaded by script be done in the same fashion, i.e. properly treat it for what it is. I'm having a hard time seeing the impossibility

GangstaRas


Stormeus

Sorry, I haven't investigated this too much since we stopped accepting feature requests for 0.4.7 to get it in a releasable state. This seems like it might be reasonable to implement but figuring out the details would have to wait.

GangstaRas

I hear ya, thank you for that. In the next minor update then or so, we all looking forward to this change