Home   Help Search Login Register  

Author Topic: Makeing a house "indestructable"  (Read 763 times)

0 Members and 1 Guest are viewing this topic.

xXNismoXx

  • Guest
Makeing a house "indestructable"
« on: 03 Jan 2004, 02:47:38 »
I'm makeing a CTF map and have been playing around with it looking for problems, I noticed after nading mutipul times one of the houses got destroyed.  This is what i did:

Made a game logic

put in "game logic's" init field this:

house= "dum09" createvehicle getpos this; house setdir getdir this; this addeventhandler ["hit",{_this select 0 setdammage 0}]

what happens is this, house is created exactly where I want it, but it still gets destoyed after nading it... can anyone plz point me in the right direction?

j-man

  • Guest
Re:Makeing a house "indestructable"
« Reply #1 on: 03 Jan 2004, 03:02:08 »
Quote
house= "dum09" createvehicle getpos this; house setdir getdir this; this addeventhandler ["hit",{_this select 0 setdammage 0}]

Since you added the event handler into the gamelogics init field, the house can still be destroyed (i think).

I have no idea on how to make a house indestructable, sorry :(

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Makeing a house "indestructable"
« Reply #2 on: 03 Jan 2004, 08:21:18 »
In that line you're assigning the eventhandler to the gamelogic, rather than the house (the this refers to the gamelogic, as it's in the gamelogic's init field).

Try this instead:

house = "dum09" createvehicle getpos this; house setdir getdir this; house addeventhandler ["hit",{_this select 0 setdammage 0}]

;)

xXNismoXx

  • Guest
Re:Makeing a house "indestructable"
« Reply #3 on: 04 Jan 2004, 09:48:21 »
dude, it totally worked !!!!   ;D thanks

xXNismoXx

  • Guest
Re:Makeing a house "indestructable"
« Reply #4 on: 04 Jan 2004, 10:34:18 »
hmmm, I spoke too soon, this is what I've found after using the script:

first house:

w/out "invinsable script"

destroyed after 20 shots of 30 mm cannon fire

second house:

w/ "invinsable script"

destroyed after the same ammount but ai I had targeting it went and shot same building for another 20 rounds equaling a total of 40 rounds into house...

any ideas?
« Last Edit: 04 Jan 2004, 10:35:24 by =TERA=-Forrest »

xXNismoXx

  • Guest
Re:Makeing a house "indestructable"
« Reply #5 on: 05 Jan 2004, 08:21:52 »
bump-ity bump!

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Makeing a house "indestructable"
« Reply #6 on: 05 Jan 2004, 20:47:43 »
The "hit" eventhandler only goes off if a unit/building is hit for 5% or more of its max life. So maybe the 30mm gun does just under that amount of damage (100% / 20 = 5%), or maybe the eventhandler really takes like 6% damage to go off. Try laying satchel charges next to the building with the invincibility on it, and see if you can destroy it.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Makeing a house "indestructable"
« Reply #7 on: 06 Jan 2004, 19:32:51 »
the technique I use is this:
#start
"_x setdammage 0" foreach [hh2,hh3, .............]
~2
goto "start"

where hh is the house name.  Name each house hh2,hh3 etc

then name the above script, I call mine "build.sqs"

then exec the script from the init.sqs

as long as the house isn't destroyed withing every 2 seconds or so, it will never be destroyed

xXNismoXx

  • Guest
Re:Makeing a house "indestructable"
« Reply #8 on: 07 Jan 2004, 07:52:47 »
thanks I'll try it out ;)