AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   respawning func_breakables? (https://forums.alliedmods.net/showthread.php?t=58286)

Lotion 07-23-2007 04:23

respawning func_breakables?
 
Is it possible to make every func_breakable come back after it is destroyed? I'm trying to make a The Specialists mod that does this, because in the new version, The Specialists 3.0, windows no longer come back after broken, so is it possible to make a plugin to bring them back around a minute after they break? And if so, how would I go about doing this?

Thanks

Greenberet 07-23-2007 06:17

Re: respawning func_breakables?
 
pseudocode:
Code:

plugin_init
      get all func_breakable entities and save needed values such as origin, angle, min/max boxes, id
      register remove_entity forward

remove_entity forward:
      set task restore ent

restore ent:
      create new entity
      set all needed data you saved in plugin init and replace the entityid in the saved data with the new one


VEN 07-23-2007 08:50

Re: respawning func_breakables?
 
Try to review that one: http://forums.alliedmods.net/showpos...01&postcount=5

Lotion 07-23-2007 17:22

Re: respawning func_breakables?
 
VEN, plugin not working for me, I get this error in console:
Quote:

L 07/23/2007 - 17:06:02: [FAKEMETA] Invalid entity
L 07/23/2007 - 17:06:02: [AMXX] Displaying debug trace (plugin "breakables_restorer.amxx")
L 07/23/2007 - 17:06:02: [AMXX] Run time error 10: native error (native "set_pev")
L 07/23/2007 - 17:06:02: [AMXX] [0] breakables_restorer.sma::task_restore (line 51)
line 51 is
Quote:

set_pev(ent, pev_health, g_health[i])
I have fakemeta enabled and all :\ And Greenberet I'm too much of an amx noob to know how to do that :P

Rolnaaba 07-23-2007 23:08

Re: respawning func_breakables?
 
add this line before set_pev()
Code:
if(!pev_valid(ent)) return FMRES_IGNORED;

Lotion 07-24-2007 03:47

Re: respawning func_breakables?
 
I put it above the
#if !defined RESTORE_ALL
line, and now i don't get any errors, but i don't get any windows back either...This is a sample func_breakable from the map in ripent:

Quote:

{
"model" "*30"
"renderamt" "120"
"rendermode" "2"
"health" "1"
"rendercolor" "0 0 0"
"classname" "func_breakable"
}
I dont see why it would think that's invalid. I'm using The Specialists btw

SenzuV3 07-27-2007 22:53

Re: respawning func_breakables?
 
I'd also like to see a solution to this problem

VEN 07-29-2007 07:32

Re: respawning func_breakables?
 
Quote:

VEN, plugin not working for me
Actually it should work well at least in CS (tested it).

SenzuV3 07-30-2007 03:00

Re: respawning func_breakables?
 
Quote:

Originally Posted by VEN (Post 509707)
Actually it should work well at least in CS (tested it).

This isn't working for The Specailists though. Can you have a look and see why?

sawce 07-30-2007 12:22

Re: respawning func_breakables?
 
ExecuteHam(Ham_TS_BreakableRespawn, idbreakable, 1)

I haven't actually tested this function from within ham sandwich.


All times are GMT -4. The time now is 21:24.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.