Destroyable static object?

There are no stupid questions, just stupid answers.
  • 1
  • 2
11 posts Page 1 of 2
Code_Man
Posts: 55
Joined: Fri Jan 26, 2018 9:12 pm
by Code_Man » Sun Jun 24, 2018 7:52 pm
I tried creating a staticshape instance however for some reason it is indestructable despite having health and isinvincible attribute set properly.
For the object i used same values as cheetah but i simply cannot destroy it.
I skimmed over t3d code, documentations and forum already for answers.

Would much appreciate any hints.
Duion
Posts: 1120
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sun Jun 24, 2018 9:00 pm
I have destructible objects in Uebergame, there is a hidden ability that allows you to place/build objects that can also be destroyed or collected again and placed somewhere else.
Code_Man
Posts: 55
Joined: Fri Jan 26, 2018 9:12 pm
by Code_Man » Sun Jun 24, 2018 9:27 pm
I assume you refer to specials/platform.cs?

I copied the whole datablock to see what happens, now there seems to be an explosion when i shoot enough but the object is still there.
Duion
Posts: 1120
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sun Jun 24, 2018 9:45 pm
Use it from within Uebergame it should work, it is part of an ability to build objects. I don't want to bother reconstructing how it works now.
Code_Man
Posts: 55
Joined: Fri Jan 26, 2018 9:12 pm
by Code_Man » Sun Jun 24, 2018 9:49 pm
Assuming you meant 1.1.1.0?
Same problem with your platform there.

I can check the git version if you made any changes there.

Guess that means we both have some things to figure out.
Duion
Posts: 1120
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sun Jun 24, 2018 10:06 pm
Well the issue is probably pretty simple.
The ShapeCharge for example can be destroyed by shooting at it, then it will explode and be removed, this is done through the line
"%obj.schedule(50, "delete");"
in "function ShapeChargeDeployed::onDestroyed"

So you have to see that you add a delete function on destroyed or spawn a destroyed shape. I think the platform disappears if you pick it up again, maybe for the case of destruction it was just forgotten to remove it from the world as well.
Code_Man
Posts: 55
Joined: Fri Jan 26, 2018 9:12 pm
by Code_Man » Sun Jun 24, 2018 10:26 pm
I hadnt thought the shape charge could be destroyed, i think i tried at one point but maybe i screwed up.

Also i found the actual error, the onDestroyed override i used had a check for renderWhenDestroyed set to true resulting in the OnDestroyed function not being called, same for your platform, assuming its not intentional.

All in all it should have been obvious for me, but lesson learned and mission accomplished, thanks for the help.
Code_Man
Posts: 55
Joined: Fri Jan 26, 2018 9:12 pm
by Code_Man » Mon Jun 25, 2018 11:14 am
The reason i tried to make this is to introduce destructable objects and even objetive based gameplay to ubergame.
Is there some reason uebergame doesnt have destructable objects builtin?
I think it would add some good spice to the game.

This is offtopic but since im on top of this section anyhow and the issue is closed better than making a new.
Duion
Posts: 1120
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Mon Jun 25, 2018 11:29 am
As said I have destructible objects, but I had no use for them yet, so I disabled them. Sure you can let players build objects, but this would require a lot more code to avoid ugly scenarios like objects floating around in the air or blocking things, since static objects are not rigid objects and rigid objects have their own issues, mostly performance.
Code_Man
Posts: 55
Joined: Fri Jan 26, 2018 9:12 pm
by Code_Man » Mon Jun 25, 2018 12:33 pm
For now i just meant things like destructable walls and bridges and such that change the map a little to enable new tactics as the games on.
  • 1
  • 2
11 posts Page 1 of 2

Who is online

Users browsing this forum: No registered users and 11 guests