Page 1 of 1
destroying buttons
Posted: Tue Nov 06, 2012 10:05 pm
by Fhizban
hey its me and my noob questions again
i want to destroy certain dungeon objects when the dungeon loads and wonder if this is possible
right now i have a series of dungeon_secret_button_small and when starting i use a script entity to select a few of them and remove them via button:destroy()
well, this leaves a ugly gap in the wall. is there another way?
Re: destroying buttons
Posted: Tue Nov 06, 2012 11:33 pm
by Periodiko
A number of objects, including buttons, replace the walls their placed on. This has the consequence of meaning that if you delete them, there will be a huge gap. You simply need to spawn a new object in to replace the gap. The easiest way would be to place a closed secret_door there. Alternately, you can create an object that has the same model as a standard wall and spawn it to replace the gap; look at the wall_drainage entries for an example. Keep in mind that the standard wall objects only have one visible side, so you need to spawn it with the correct facing. Secret doors, on the other hand, are visible on both sides.
Re: destroying buttons
Posted: Wed Nov 07, 2012 2:03 am
by msyblade
You also may be able to define a new secret button and change replaces wall to false,then (maybe) when its removed the original wall will be there
Re: destroying buttons
Posted: Wed Nov 07, 2012 9:42 am
by Fhizban
Thanks, I am one big step closer to script a random dungeon generator now!
1. replaces wall = false , does not work - leave it as "true"
2. place all secret buttons in the level
3. when the game starts, scan all secret buttons according to your maze generator
4. save their location etc. - call secret_button.destroy()
5. then spawn a "dungeon_secret_door" with the saved location etc.
so, every time the dungeon map is startet - all secret doors, buttons and whatelse appear at different locations.
cool stuff!