Home   Help Search Login Register  

Author Topic: attach a carbomb....  (Read 795 times)

0 Members and 2 Guests are viewing this topic.

Dubieman

  • Guest
attach a carbomb....
« on: 28 Jul 2004, 02:09:01 »
Well I am havin a little problem with my mission.

One of the easier objs is a complicated one to script for me...

I hve a car called vehicle. And a person who is named unit.
The unit gets into the car and you have to attach the carbomb via action menu and I have a decent script for detecting th right unit and detonating the car at a certain speed. As the car doesn't go boom! I added a little heat125 but I'm not sure if its right...

Well I know its not right cause the thing didn't work... ::)

Anyways I wanted to do this via action menu, no satchels. So I did a little east trigger around the car so when you enter the action comes up to attach the bomb. Then starting the script so once the person gets in and drives, boom!

This is what is in my trigger but the action is everpresent even though the trigger is not activated...

activation: s addaction ["Attach bomb","carbomb.sqs"]

And the script needs general editing and I'm kinda stuck...
 :P
Code: [Select]
_Unit = _this select 0
_Vehicle = _this select 1

#Update
? (_Unit in _Vehicle) && (speed _Vehicle > 5) : goto "BlowUp"
~2
goto "Update"

#BlowUp
~5
_Vehicle setdammage 1
_vehicle = camcreate "Heat125" (getpos _vehicle)
exit

Thanks a bunch. ;)

Cannon

  • Guest
Re:attach a carbomb....
« Reply #1 on: 28 Jul 2004, 03:05:26 »
I didnt have any problems with your script. Except for camcreate which should be like this:

Code: [Select]
heat1 = "Heat125" camCreate getpos _Vehicle
About the everpresent problem you got, this is the way I did it: (hmm,, my scripting is very basic as well as triggers etc, but I guess its ok if it works :))

Create a trigger [0,0, Repeatedly] group it with player (Any group member? thats depends on what you want):
condition: bomb == "no" && player distance car1 < 3
on activation: attach = player addaction ["Attach bomb","bomb.sqs"]
on deactivation:player removeaction attach

Create a trigger  [0,0, Once]
condition: true
on activation: bomb == "no"

Create a trigger [0,0, Once]
condition: bomb == "yes"
on activation = [] exec "explode.sqs" (the script you got above with the following change:
? (bomb == "yes") && (player in car1) && (speed car1 > 5) : goto "BlowUp")

bomb.sqs will have:
hint "Bomb attached"
bomb == "yes"

You might want to have a dettach in case you dont want to punish the poor guy or YOU want to use the jeep :P lol, in that case, add the following:

Trigger [0,0, Repeatedly] group it with player too:
condition: bomb == "yes" && player distance car1 < 3
on activation: dettach = player addaction ["Dettach bomb","nobomb.sqs"]
on deactivation:player removeaction dettach

nobomb.sqs will have:
hint "Bomb removed"
bomb == "no"

For code optimization, Im not the guy  ;D
« Last Edit: 28 Jul 2004, 04:58:05 by Cannon »

Dubieman

  • Guest
Re:attach a carbomb....
« Reply #2 on: 28 Jul 2004, 18:31:25 »
Err thanks, your triggers are a little confusing but they look alright.

By the way, all I have to do is have the script run. Once its running, as you can tell by reading it, the car is got into by the certain person, unit, and after she drives over 15 mph? the car blows up. ;D

No need for the detatch  part as I don't no how you can miss this red sports car that's there.... ;D

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:attach a carbomb....
« Reply #3 on: 28 Jul 2004, 21:32:59 »
  :) hey m8. arent there plenty of bomb scrolls in the depot?

anyway, here's five seconds of thinking about how to pull it all off.
Make a scroll like this (you fill in the missouts ok?!) :

============

?bombAttached: goto "wait"

#loopedcheck
?player distance vehicle <8: goto "actionA"
~.3
goto "loopedcheck"

#actionA
myBomb = player addAction..... (etc.)

#wait
bombattached=true
player removeAction myBomb
[player] exec ....(etc. ... the actual KA-BOOM script, yanno.)

=============

PS. ya dont really NEED another scroll, as a timed trigger could do it:

cond. field :
speed MyCar >40 && deadBob in MyCar && bombAttached

on Act. field :
MyShell = "bomb" createVehicle getpos Mycar



....som'n like that
« Last Edit: 28 Jul 2004, 21:35:23 by Tomb »

Dubieman

  • Guest
Re:attach a carbomb....
« Reply #4 on: 28 Jul 2004, 22:39:30 »
Well I was offline and had this script kickin around so I used it. There is probably a better one out there that already does what I want...

I'll try and fill in your script later when I'm testing if I don't find anything good (unlikely) in the editor depot. There is sure to be 5 bomb scripts.... :P

Anyways I modded Cannon's idea because  it wouldn't accept "no" in the activaton field and a few other places, I dunno...


So I changed my car name to car1 and the same in the script. Then my unit is named unit.... ::)
ss is my spetz natz player.

So I made a trigger.
repeatedly
Condition: ss distance car1 < 3
activation: ss addaction ["Attach Bomb","carbomb.sqs"]
deactivation:ss removeaction Attach Bomb

And it worked decently except I can once in the area I can attach bomb multiple times which is why I need Cannon's other triggers to stop that methinks. But they didn't work...

Anyways I attached the bomb and ran off to hit the radio to make the target get in the car and she should drive and boom! Except when I reached 15 mph, I got bombed, WTF? ;D :D

Anyways I'll try some other script... :P
thanks

DBR_ONIX

  • Guest
Re:attach a carbomb....
« Reply #5 on: 29 Jul 2004, 00:05:31 »
I'm bored so I'll try to fix this scripts (I dun really like triggers much :P)
Code: [Select]
_Unit = _this select 0
_Vehicle = _this select 1

; \/ This line is a problem!! \/
_Unit playmove "Erm"
~5

#Update
? (speed _Vehicle > 5) : goto "BlowUp"
~2
goto "Update"

#BlowUp
~5
_Vehicle setdammage 1
_bomb01 = "Heat125" camcreate [getpos _vehicle select 0,getpos _vehicle select 1, getpos _vehicle select 2]
exit
Then you call it like this
[player,this] exec "carbomb.sqs"
Put that in the CARs INIT field ;)
I removed the bit that checks if the unit is in the car.. It seems pointless to me.. The bomb shouldn't be picky who's in the car.. It doesn't think, "Hmm, I like this person, better not blow up now".. If you see what I mean.. It will blow up no matter who gets in it (Say the player, if he gets in it, after he's put the carbomb on, it won't work)

Oh, I added a playmove line, followed by a delay.. I'm not sure of the correct name (It is 11:30, so please excuse me :P), but in the editors depot, search for Switchmove list (Or playmove, maybe), and it has a bit list of ones.. Then use the find thing to look for Repair.. That should look like tampering with the car...
---- Here is the end of the script fix :P ----

Just an idea.. Not so much for the script as the mission.. I'm reading a book (Chris Ryan - Stand By, Stand By), that the first, about 1/2, is set in Northern Irland.. Where carbombs are used a lot.. Maybe if the random number is under 2, the person who will get in the car, uh, won't.. As he will have checked for, and noticed the carbomb? Then maybe the player would have to shoot him, and that would make something else happen near the end (Like the weapon is linked to the shooting it linked to you, and the poice attack you or something..?)
Anyway, heres the code :
Code: [Select]
_randnum = random 20
?(_randnum < 2): GOTO "noticed"
EXIT
#noticed
noticedbomb = true
_Unit say "Whatsthis"
;Not sure what to put here, setWP or something

In another script, you can check if noticedbomb is true (Like this ?(noticedbomb): GOTO "somewhere"), and use that to move the police or what ever into place..


Sorry if I got carried away :P
I tend to do that sometimes..
But I hope you might get a few ideas from it :)

Gd luck
- Ben
BTW, I forrgot to ask, where is the mission set? Norther Irland? :)
Oh, also.. Just joking, I'm finished now :P

Cannon

  • Guest
Re:attach a carbomb....
« Reply #6 on: 29 Jul 2004, 00:15:02 »
You must add carbomb = true in carbomb.sqs.

Then modify the condition field such as:
(ss distance car1 < 3) && (not carbomb)

and I think that ll take care of the endless attach action.

Also make sure you create another trigger with true condition, activation: carbomb = false, executed only once.
« Last Edit: 29 Jul 2004, 03:07:09 by Cannon »

Cannon

  • Guest
Re:attach a carbomb....
« Reply #7 on: 29 Jul 2004, 01:27:20 »

Oh, I added a playmove line, followed by a delay.. I'm not sure of the correct name (It is 11:30, so please excuse me :P), but in the editors depot, search for Switchmove list (Or playmove, maybe), and it has a bit list of ones.. Then use the find thing to look for Repair.. That should look like tampering with the car...

player playmove "CrouchToWeapon"   works wonder :D

Dubieman

  • Guest
Re:attach a carbomb....
« Reply #8 on: 29 Jul 2004, 04:21:15 »
TOO MANY SCRIPTS! AHHH! :D :D ;D ;D

Thanks for the ideas and scripts guys.

I still have to cruise the ed depot for a look. But I dunno which idea I wanna try. Being lazy as I am, tomb, I'll probably not get too yours but thanks anyways.

DBROnix: thanks I like your little script, I totally forgot the playmove thing, It'd look better. I have a good anim in mind, the medic one where it looks like I set something on the car.

But since Cannon's idea is already there I'll try and get it to work. Then mod my script to DBROnix's suggestion.

If that don't work, go with a full DBROnix thing then if that don't work, ed depot should work.... :P

I like the noticeable bomb thing but it may be too complicated after. This bomb should be under the car and no enemy force is expected so the woman, yes evil woman here. Should get in her sports car and drive off then BOOM! Yay, my job is finished. Well not totally. still got er husband... :P

What kind of bang should I give this cr, Heat125 is okay but I want this boom to go hollywood style, over the top. ;D

LaserGuidedBomb  is that the right way to say it?

Quote
BTW, I forrgot to ask, where is the mission set? Norther Irland?
Oh, also.. Just joking, I'm finished now  

Nope not Ireland. Everon, its the sequel to Nocturnal or should be in a month or two.  :)




 

Dubieman

  • Guest
Re:attach a carbomb....
« Reply #9 on: 30 Jul 2004, 02:48:05 »
Argh I tried all the stuff here and it doesn't work. I run away and get a HEAT125 on my head! >:(
Or the whole thing doesn't work! :P

If the OFPEC scripts do not work, then I'm just gonna use a cutscene and fake putting the darn bomb on. Then activate the dumb script that keeps dropping HEATs on me. :P

thanks for all your help... :)

Cannon

  • Guest
Re:attach a carbomb....
« Reply #10 on: 30 Jul 2004, 04:10:27 »
Maybe you are not running too fast :P

I tried several times attaching the bomb, speeding a bit, getting out and running away, and I didnt get killed...

Try this to know when death comes :D

Code: [Select]
#BlowUp
hint "5.."
~1
hint "5.. 4.."
~1
hint "5.. 4.. 3.."
~1
hint "5.. 4.. 3.. 2.."
~1
hint "5.. 4.. 3.. 2.. 1.."
~1
car1 setdammage 1
heat1 = "Heat125" camCreate getpos car1
exit
« Last Edit: 30 Jul 2004, 04:11:54 by Cannon »

Dubieman

  • Guest
Re:attach a carbomb....
« Reply #11 on: 30 Jul 2004, 04:19:43 »
It'd be better if its scripted in a cutscene. That way I can steer clear of any bugs present.

I'm sorry but I've followed your plans to the best of my abilities and had to mod them cause I was gettin errors.
I'm feeling a cutscene with a small animation that then starts the script would be good.

thanks once again... :)