Hide Broken Windows after Explosion!

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Phantomwarrior
Corporal
Posts: 27
Joined: Fri Jan 20, 2006 1:42 am
Location: Bakersfield, California

Hide Broken Windows after Explosion!

Post by Phantomwarrior »

After Der Vorposten, Stalker and I went back to the drawing table and have created the second map in a series of 3 for this scenario. We have included a train and a bridge to blow up as objectives in a mountain village setting. The new map is intense objective play and all of the exploder stuff works great except we have a problem with loosing the broken windows on the train when the bridge blows up. The problem is that broken windows are targeted by the func window entity and the broken window has a target name exclusive to corresponding func windows other than exploder with a set #. We need a script that will either hide the broken windows when the bridge blows or possibly moves them off the level out of sight. We still have a lot to learn and appreciate any help that we can get. :roll:
Phantomwarrior
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Out of curiousity, is there a possibility of a window not being broken before/during the explosion? I.e. that would mean you have to hide unbroken windows as well.

Anyway... hmm let's see how to do this... I'm afraid the only way to do this is to collect the targetnames of the func_windows/script_objects and manually delete them in the script after the explosion:

exec global/exploder.scr::explode 1 // or something like that
// use the correct targetnames here! (example only)
$t4 delete
$t7 delete
$t12 delete

etc.
Image
Phantomwarrior
Corporal
Posts: 27
Joined: Fri Jan 20, 2006 1:42 am
Location: Bakersfield, California

Post by Phantomwarrior »

The unbroken func window targets the targetname of the broken window so that leaves the func unbroken window able to use targetname exploder with set#. But the targetname of the broken window is unique to the target of the unbroken func window and can not use a second targetname exploder with a set# because it?s targetname is already used. So we figured we could use the same targetname of the broken window used by the target of the unbroken window in a script to hide them in the event of explosion. We will try the script that you suggest, it looks like it will work. We figured it could be done, but we just didn?t know how to script it. It?s late right now so I will try it manyana and get back to you on how it works. :wink:Thanks!
Phantomwarrior
Phantomwarrior
Corporal
Posts: 27
Joined: Fri Jan 20, 2006 1:42 am
Location: Bakersfield, California

Post by Phantomwarrior »

doesn't work right, but this gives me an idea for later; first we need to solve this problem, the script that you suggested causes the bomb to go off at level spawn and it does delete the broken windows along with executing all the exploder stuff. But after setting the plant bomb trigger the explosion goes off again and the broken windows come back. :cry:
Last edited by Phantomwarrior on Wed Jul 04, 2007 8:54 am, edited 1 time in total.
Phantomwarrior
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

:shock:

Errrm you shouldn't add the explode line (I assumed you had one already). Just add the delete lines (which will not cause bombs to go off, hopefully :? ).
Image
Phantomwarrior
Corporal
Posts: 27
Joined: Fri Jan 20, 2006 1:42 am
Location: Bakersfield, California

Post by Phantomwarrior »

We have drawn a blank on this one! Usually after trial and error we get something to work. But, this doesn?t seem to be as straight forward as just deleting the broken window entities since they need to go away at the event of the explosion of exploder set# 2 (the train trestle bridge). As you know, the objective timer script is tied to a global script as is the exploder stuff and the 16 func broken windows (targetname?s t1 thru t16) need to stay in tact until the exploder event happens that blows up the bridge along with a freight car, a passenger car, and a caboose. There are 4 separate set# exploders in this level. Two of them are objectives to both be completed for allies to win. The other two are incidental explosions in the map level that are just there cause they are cool. We would appreciate having the scripting guru?s to take a stab at this since it could also be used in other applications in future mapping. :?
Phantomwarrior
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

Can't you just use a custom glass texture for your windows?
Phantomwarrior
Corporal
Posts: 27
Joined: Fri Jan 20, 2006 1:42 am
Location: Bakersfield, California

Post by Phantomwarrior »

The windows that we are using on the train are custom made in Photoshop. There really were no stock windows that worked for the train since most of them are for buildings. The shader scripts are pretty much the same as the ones used in mohaa for windows, but the textures are completely custom. We used the same concept of func window unbroken connected to func broken window that is used in mohaa radiant. As currently used, the broken window can?t have targetname of exploder with set# used in global exploder script because they have targetnames that are unique to connect to func unbroken windows; the broken window targetnames are (t1 thru t16). If there were a way to do the window break and broken with custom shader script, that might work, but you would think that that would be the way they did it originally if it could have worked that way. If it could all be done with one entitiy (window unbroken and broken) then the targetname for both broken and unbroken could be exploder with set# used in the global exploder script.
Phantomwarrior
Phantomwarrior
Corporal
Posts: 27
Joined: Fri Jan 20, 2006 1:42 am
Location: Bakersfield, California

Post by Phantomwarrior »

If a scripting guru could come up with a link to a specific global exploder, it could not only be used to delete the broken windows, but it could also be used to trigger events like falling trees, func objects flying through the air, walls that fall over and remain collapsed in the level, sounding site alarms, and/or etc. Imagination is the only limit to what it could be used to do! :D
Phantomwarrior
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

post your work so it can be studied closely rather than speculated.
Phantomwarrior
Corporal
Posts: 27
Joined: Fri Jan 20, 2006 1:42 am
Location: Bakersfield, California

Post by Phantomwarrior »

Stalker and I wish that you have a happy 4th of July! We will post some of the work that we have to date on our new level after the Holiday. The new level is named "Vom_Kakteengarten" after an actual town north of the fictitious location of Der_Vorposten (Point Lighthouse). These are in Southern France located on the North Mediterranean close to Monte Carlo. This level is supposed to be mountain village with a train station. The objectives are to blow up tanker cars on train in the train station and blow up the trestle bridge for the train over a canyon in order to halt Nazi supply routes to Rommal in North Africa. The next level will have objectives at a Hydro Electric Dam north of Vom Kakteengarten. 8-)
Phantomwarrior
Stalker
Corporal
Posts: 31
Joined: Sat Oct 22, 2005 9:31 pm
Contact:

Post by Stalker »

Phantom warrior and I are posting our work in progress, (Vom Kakteengarten). This link will show the problem that we are having with the targetname of script object broken windows:

https://map.moh-central.net/forum/viewtopic.php?t=12708
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

post your .map and script or a working subsection of the problem in a .map and script.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Have you tried to give the broken windows health and does your explostion cause damage like radius damage .
Image
Phantomwarrior
Corporal
Posts: 27
Joined: Fri Jan 20, 2006 1:42 am
Location: Bakersfield, California

Post by Phantomwarrior »

Yes, we have tried health, but, it does not seem to effect the broken window script object probably because of being a nonsolid entity. :( There has to be a way to hide them in the event of explosion of the number set for that exploder. We just have not found the script language that will do that yet. Any help from scripting guru's would be appreciated.
Phantomwarrior
Post Reply