Page 1 of 3

Disable truck

Posted: Wed Apr 20, 2005 2:35 pm
by k47a
I got a problem with the script to disable trucks. I found the whole script (it's, I think 1?2b). I found the disabling truck part but I don't know what parts I have to take over for my script and what I don't need...
Please, can anybody help me with this?
(Btw, to disable a truck, is this just scripting, or is there a special model with the open motor?)
Thanks in advance!

Posted: Wed Apr 20, 2005 4:08 pm
by Green Beret
find out the targetname of the truck, I use BSP View.
Then
$targetname remove

Posted: Wed Apr 20, 2005 5:51 pm
by lizardkid
i think she wants to make her own version ;)

make two trucks, should be two separate models something like opeltruck_open_damaged.tik and give them separate targetnames. put a trigger_use around the open part of the engine of the intact one, give it a setthread of clipWire, and a cnt of 1. in your script...

Code: Select all

level waittill spawn

thread prepTruck

end

prepTruck:

$truck_dmg hide
$truck_dmg notsolid

end

clipWire:

$truck_intact remove

$truck_dmg show
$truck_dmg solid

iprintlnbold  "You've disabled the truck!"

end
it's pretty self-explanitory with the names ;)

Posted: Wed Apr 20, 2005 6:41 pm
by Rookie One.pl
You need the model of an Opel with the engine open, 2 script_objects and a trigger_use. The 1st script_object will be the normal wire, the 2nd one will be the cut one. Place the trigger_use over the engine and give it the key/value entry:
setthread / wire_cut
Have this code:

Code: Select all

// put this at the beginning of the script
$cut_wire hide // hides the cut wire
And this at the end:

Code: Select all

wire_cut:
   local.player = parm.other // parm.other is the player who activated the trigger
   //               cansee <target> <FOV> <distance>
   if (local.player cansee $normal_wire 30 64) // if the player can see the normal wire
   {
      self nottriggerable // turn off the trigger (cannot trigger it anymore)
      $cut_wire show // show the hidden cut wire
      $normal_wire delete // delete the normal wire
   }
end

Posted: Thu Apr 21, 2005 6:45 pm
by k47a
The darn truck doesn't really work...
Here's the script:

main:

exec global/ai.scr

//////////

level waittill prespawn

$enemyspawn ai_on


/////////


level waittill spawn

// player weapons
$player item weapons/colt45.tik
$player item weapons/m1_garand.tik
$player item weapons/mp40.tik


// give him some ammo!
$player ammo pistol 32
$player ammo smg 100
$player ammo rifle 60

// disable truck
$cut_wire hide

thread global/ai.scr::spawngroup #1 #1

//disable truck
wire_cut:
local.player=parm.other // parm.other is player whi activated the trigger
// cansee <target> <FOV> <distance>
if (local.player cansee $normal_wire 30 64) // if the player sees normal wire
{
self nottriggerable // can't trigger it anymore
$cut_wire show // show hidden cut wire
$normal_wire delete
}
end


end
I don't know, did I miss anything? Or does the script just suck?! :?
Do I actually have to draw the wire? And what about the normal_wire? It's in the script, but I don't think it's in the map...
And, would you please, please be so kind to check this one out:
level waittill spawn


level.script = "maps/m1l2b.scr" // Initialize variables
level.disabledtrucks = 0
level.opentruck01_disabled = 0
level.opentruck02_disabled = 0
level.opentruck03_disabled = 0
level.bombedtanks = 0
level.tank01_bombplanted = 0
level.tank02_bombplanted = 0
level.tank03_bombplanted = 0
level.tank04_bombplanted = 0
level.munitionscache_bombplanted = 0
level.bombsleft = 5
level.scoldsmoker = 0



$cutwire01 hide // Initialize entities
$cutwire02 hide
$cutwire03 hide
$crate1_end hide
$crate2_end hide
$crate3_end hide
$bomb02 hide //TEMP
$door01 lock
$door02 lock
$radio1 loopsound m1l2b_radio1 // Looping radio sounds
$radio2 loopsound m1l2b_radio2

bla

//******************************************************//
// MAIN PROGRAM //
//******************************************************//

bla

//*********************************************
// Disable truck 1
//*********************************************
opentruck01_disabled:
$wire01 remove
$opentruck01 playsound m1l2b_disabletruck
$cutwire01 show
level.opentruck01_disabled = 1
thread nexttruck


That's the script of 1?2b - or the parts which seemed to me to have someting to do with the truck...

Posted: Thu Apr 21, 2005 8:19 pm
by Rookie One.pl
:roll:
Rookie One.pl {sfx} wrote:You need the model of an Opel with the engine open, 2 script_objects and a trigger_use.
These script_objects are the wires.

Posted: Fri Apr 22, 2005 9:20 am
by k47a
H??
What's that s'posed to mean, Rookie One?
What's the problem with my truck then? Sorry, but I really don't understand what I actually have to change to make it work...
The truck's there in the game but there are NO bloody wires... :?

Edit: Do I have to make two brushes with texture script_objects where the wire should be?

Posted: Fri Apr 22, 2005 11:44 am
by Rookie One.pl
Well, let's clarify 1 thing. Are you editing m1l2b or making a new map?

Posted: Fri Apr 22, 2005 12:14 pm
by k47a
I'm making a new SP map.

Posted: Fri Apr 22, 2005 2:33 pm
by lizardkid
ok the two script objects are flat brushes set across the engine, one with an intact pulsing wire texture, the other the broken wire texture. If you cant find them you can make new ones to jazz up your map.

once the trigger is used then you "clip" the wires by removing the whole one and showing the broken one.

Posted: Fri Apr 22, 2005 3:56 pm
by Rookie One.pl
I'll make you a prefab of this stuff.

Posted: Fri Apr 22, 2005 4:01 pm
by k47a
Hmm, I'm not really sure whether I understand how to make but I'm gonna check it out asap. Thanks anyway... I'll let ya know when I got the next problem :D
Rookie One.pl {sfx} wrote:I'll make you a prefab of this stuff.


Wow, would you?! :D That'd be real great!

Posted: Fri Apr 22, 2005 4:16 pm
by Rookie One.pl
Here you go. A prefab and a piece of script included.

Posted: Fri Apr 22, 2005 6:03 pm
by k47a
F**k!!!!! I can't connect to moh.gamesnet.pl....
Is that just me or is it the link?! :?
:evil:

Edit: Ey, check that out!!!!! It's my 101st post! :D (Jes' like 101 Airborne (Screaming Eagles)) :D :D :D

Posted: Fri Apr 22, 2005 6:44 pm
by Rookie One.pl
Well, the server might be sometimes down. Check if my signature appears correctly - if it does, the server's up.

I can download it, no problem...