Raised This Month: $ Target: $400
 0% 

respawning func_breakables?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lotion
Member
Join Date: Apr 2005
Old 07-23-2007 , 04:23   respawning func_breakables?
Reply With Quote #1

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
Lotion is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 07-23-2007 , 06:17   Re: respawning func_breakables?
Reply With Quote #2

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
__________________
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
VEN
Veteran Member
Join Date: Jan 2005
Old 07-23-2007 , 08:50   Re: respawning func_breakables?
Reply With Quote #3

Try to review that one: http://forums.alliedmods.net/showpos...01&postcount=5
VEN is offline
Lotion
Member
Join Date: Apr 2005
Old 07-23-2007 , 17:22   Re: respawning func_breakables?
Reply With Quote #4

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
Lotion is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-23-2007 , 23:08   Re: respawning func_breakables?
Reply With Quote #5

add this line before set_pev()
Code:
if(!pev_valid(ent)) return FMRES_IGNORED;
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Lotion
Member
Join Date: Apr 2005
Old 07-24-2007 , 03:47   Re: respawning func_breakables?
Reply With Quote #6

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
Lotion is offline
SenzuV3
Junior Member
Join Date: Dec 2005
Location: Brisbane, Australia
Old 07-27-2007 , 22:53   Re: respawning func_breakables?
Reply With Quote #7

I'd also like to see a solution to this problem
SenzuV3 is offline
Send a message via AIM to SenzuV3 Send a message via MSN to SenzuV3 Send a message via Yahoo to SenzuV3
VEN
Veteran Member
Join Date: Jan 2005
Old 07-29-2007 , 07:32   Re: respawning func_breakables?
Reply With Quote #8

Quote:
VEN, plugin not working for me
Actually it should work well at least in CS (tested it).
VEN is offline
SenzuV3
Junior Member
Join Date: Dec 2005
Location: Brisbane, Australia
Old 07-30-2007 , 03:00   Re: respawning func_breakables?
Reply With Quote #9

Quote:
Originally Posted by VEN View Post
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?
SenzuV3 is offline
Send a message via AIM to SenzuV3 Send a message via MSN to SenzuV3 Send a message via Yahoo to SenzuV3
sawce
The null pointer exception error and virtual machine bug
Join Date: Oct 2004
Old 07-30-2007 , 12:22   Re: respawning func_breakables?
Reply With Quote #10

ExecuteHam(Ham_TS_BreakableRespawn, idbreakable, 1)

I haven't actually tested this function from within ham sandwich.
__________________
fyren sucks
sawce is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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