Home   Help Search Login Register  

Author Topic: Weapons goddamnit!  (Read 815 times)

0 Members and 1 Guest are viewing this topic.

Offline Woodpeckersam

  • Members
  • *
  • I'm a llama! ooh! Yeah!
Weapons goddamnit!
« on: 24 Mar 2005, 12:59:56 »
Yo all, i need help so bad... I have created a cutscene during one of my missions.
Code: [Select]
; *****************************************************
; ** Operation Flashpoint Script File
; *****************************************************

enableradio false
_plyr = _this select 0
_fake = _this select 1
_ldr = _this select 2
_grp = _this select 3
_guard = _this select 4
_man1 = _this select 5
_man2 = _this select 6
_ldr allowfleeing 0
[_fake] join _ldr

_ldr setbehaviour "careless"
_fake setbehaviour "careless"
_plyr setpos getpos TRIG2
_fake setpos getpos TRIG

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal","back"]
_cam camsettarget _ldr
_cam camsetrelpos [0,1.5,1.5]
_cam camcommit 0
@camcommitted _cam
_ldr domove getmarkerpos "fence"
~6
_cam camsettarget fence
_cam camsetrelpos [-4,0,1.5]
_cam camcommit 5
@camcommitted _cam
_ldr dowatch Guard
_ldr playmove "EffectStandSalute"
_guard playmove "EffectStandSalute"
~3
_ldr switchmove "EffectStandSaluteEnd"
_guard switchmove "EffectStandSaluteEnd"
~2
_cam camsettarget _guard
_cam camsetrelpos [0,0.5,1.5]
_cam camcommit 0.1
@camcommitted _cam
~2
_guard setmimic "Ironic"
titletext ["Gate Guard: Hello, who are you? And what can I do for you?","PLAIN",2]
_guard setmimic "Cynic"
~0.5
_guard setmimic "Ironic"
~0.5
_guard setmimic "Cynic"
~0.5
_guard setmimic "Ironic"
~0.5
_guard setmimic "Cynic"
~0.5
_guard setmimic "Ironic"
~0.5
_guard setmimic "Cynic"
~0.5
_guard setmimic "Ironic"
~0.5
_guard setmimic "Cynic"
~5
_cam camsettarget _ldr
_cam camsetrelpos [0.5,0.9,1.5]
_cam camcommit 0.5
@camcommitted _cam
_ldr setmimic "Ironic"
titletext ["Sgt Wood: Hi, my name is Sergeant Wood and i have buisiness here, listen to what the colonel had to say about this \n he also mentioned that if you do not listen to this, you will be put into court martial","PLAIN",2]
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~5
_ldr playmove "EffectStandTalk"
~4
_ldr playmove "EffectStand"
letter setpos [(getpos fence select 0),(getpos fence select 1), 0.8]
~5
_cam camsettarget letter
_cam camcommit 3
@camcommitted _cam
~4
titletext ["Colonel on Radio: Hello, this is Colonel Tom speaking to the guard in charge of Aquomat Base in Normandie. I give Sgt Woo...","PLAIN",2]
~5
titlecut ["","BLACK OUT",3]
_fake domove getpos _ldr
_man1 domove getpos _ldr
_man2 domove getpos _ldr
~7
titletext [":5 hours passed:","PLAIN DOWN",2]
skiptime 5
_ldr playmove ""
_cam camsettarget _ldr
_cam camsetrelpos [0.5,0.9,1.5]
_cam camcommit 0
deletevehicle letter
_ldr setmimic "Agresive"
~3
titlecut ["","BLACK IN",3]
~3
titletext ["Sgt Wood: So you see, i am here to help you, so can you please let us in?","PLAIN",3]
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~5
_cam camsettarget _guard
_cam camcommit 4
@camcommitted _cam
titletext ["Gate Guard: Sure, let me just go and open the gate Sgt Wood","PLAIN",3]
_guard setmimic "Cynic"
~0.5
_guard setmimic "Ironic"
~0.5
_guard setmimic "Cynic"
~0.5
_guard setmimic "Ironic"
~0.5
_guard setmimic "Cynic"
~0.5
_guard setmimic "Ironic"
~0.5
_guard setmimic "Cynic"
~0.5
_guard setmimic "Ironic"
~0.5
_guard setmimic "Cynic"
~5
_guard dowatch gate
_guard playmove "FXShow4"
wire setdir 180
~5
_cam camsettarget _ldr
_cam camsetrelpos [-5,4,2]
_cam camcommit 4
@camcommitted _cam
_ldr domove getpos wire
~4
_ldr dowatch _guard
titletext ["Sgt Wood: Thank you very much sir, hope you get a promotion later for your hard work.","PLAIN",3]
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~4
_ldr dowatch _fake
titletext ["Sgt Wood: Everyone come on in and get settled down. And you Billy, follow me, we need to talk.","PLAIN",3]
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~0.5
_ldr setmimic "Ironic"
~0.5
_ldr setmimic "Cynic"
~5
_cam camsettarget _fake
_cam camsetrelpos [0,1.5,2]
_cam camcommit 2
@camcommitted _cam
titletext ["Billy: Yes sir!","PLAIN",3]
[_ldr,_fake] join null
[_grp] domove getmarkerpos "m"
_man1 domove getpos m
~4
_cam camsettarget _ldr
_cam camcommit 3
@camcommitted _cam
titletext ["Sgt Wood: right Billy, here are some mines for you, i want you to plant them on the road \n somewhere over the bridge. \n GET GUNG NOW!","PLAIN",3]
~4
_cam camsettarget _fake
_cam camsetrelpos [0,5,10]
_cam camcommit 3
@camcommitted _cam
_plyr setpos getpos _fake
_plyr setbehaviour "careless"
~0.1
_fake setpos getpos TRIG2
~3
_cam camsetrelpos [0,1.5,0.1]
_cam camcommit 2
@camcommitted _cam
_cam cameraeffect ["TERMINATE","BACK"]
_cam camdestroy "camera"
_plyr domove getpos mine
_plyr addmagazine "Mine"
_plyr addmagazine "Mine"
exit

So there is my cutscene. Ok, now look at the very last part of t

_plyr addmagazine "Mine"

One problem, this dont work.... i even tried this with _plyr addweapon "Mine"

so can someone help me figure out why a mine is not being added to the player.
Thanks in advance.

Offline 456820

  • Contributing Member
  • **
Re:Weapons d**nit!
« Reply #1 on: 24 Mar 2005, 13:14:42 »
well i think in that case you might need a parametere to tell them who the player is but i may be wrong as im rather bad at scripting but you could just change it to "player" wich is the unit controlled by the person playing so that probaly should work

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Weapons d**nit!
« Reply #2 on: 24 Mar 2005, 13:23:59 »
in some cases weapons need both magazine and weapon added. hand grenade is one example i believe. mines may be another.

Offline Woodpeckersam

  • Members
  • *
  • I'm a llama! ooh! Yeah!
Re:Weapons d**nit!
« Reply #3 on: 24 Mar 2005, 13:40:24 »
Hey  i already tried what both of u said now and still it dont work..

ALSO, THIS DONT WORK

Code: [Select]
; *****************************************************
; ** Operation Flashpoint Script File
; *****************************************************
#loop
enableradio false
_grp =_this select 0
"_x moveincargo copter" foreach units _grp
?"_grp in vehicle(copter)":goto camera
goto loop

#camera
cutRsc ["Codemasters", "PLAIN"]
Playmusic "lazyboy"
_cam camcommand "inertia off"
titlecut ["","BLACK",0]
_cam = "Camera" camcreate [0,0,0]
_cam cameraeffect ["EXTERNAL","BACK"]
_cam camsettarget copter
_cam camsetrelpos [45,20,2]
_cam camcommit 0
@camcommitted _cam
copter flyinheight 30
pilot lockWp false
~5
#loopagain
_cam CamSetFOV 0.3
_cam camcommit 5
@camcommitted _cam
~5
_cam CamSetFOV 0.3
_cam camcommit 3
@camcommitted _cam
~5
_cam CamSetFOV 0.3
_cam camcommit 1
@camcommitted _cam
~5
_cam camsetrelpos [180,5,2]
_cam camcommit 5
@camcommitted _cam
_cam camsetrelpos [180,5,2]
_cam camcommit 6
@camcommitted _cam
pilot flyinheight 30
_cam CamSetFOV 1
_cam camsetrelpos [180,5,2]
_cam camcommit 6
@camcommitted _cam
#wait
_grp leavevehicle copter
_ldr ordergetin true
?"_grp in vehicle(copter)":goto wait
!"_grp in vehicle(copter)":goto carryon
#carryon
~5
_cam cameraeffect ["terminate","back"]
camdestroy _cam
enableradio true
~2
exit

this is another script. now i am having a problem.

the line ; !"_grp in vehicle(copter)":goto carryon

dont work.. i need it to work cos i want it to check if the group _grp s out of the heli, how can i do that? Thanks :)!

so, can someone help me with both scripts?
« Last Edit: 24 Mar 2005, 13:49:39 by Woodpeckersam »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Weapons d**nit!
« Reply #4 on: 24 Mar 2005, 14:00:20 »
addmagazine "mine" works just fine for me. if your loon has no free weapons slots for the weapon to be added into, it won't work. that may be the problem.

as for the second script, goto commands need the script markers to be in inverted commas. goto "camera", goto "carryon" and goto "wait" will work.

« Last Edit: 24 Mar 2005, 14:02:46 by bedges »

Offline Woodpeckersam

  • Members
  • *
  • I'm a llama! ooh! Yeah!
Re:Weapons d**nit!
« Reply #5 on: 24 Mar 2005, 14:06:23 »
thxs ill have a go..

Offline Woodpeckersam

  • Members
  • *
  • I'm a llama! ooh! Yeah!
Re:Weapons d**nit!
« Reply #6 on: 25 Mar 2005, 15:06:17 »
right, what u said for the 2nd script dont work.. is there a mistake in what i wrote down or what? Thxs in advance :D

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Weapons d**nit!
« Reply #7 on: 25 Mar 2005, 18:51:07 »
okay, well looking at the first few lines -

Code: [Select]
#loop
enableradio false
_grp =_this select 0

"_x moveincargo copter" foreach units _grp
?"_grp in vehicle(copter)":goto camera
goto loop

a few things:

you are disabling the radio and defining the local variable _grp within the loop. this may be one problem.

the second last line, where you check if the group is in the vehicle, doesn't need inverted commas "". also, assuming 'copter' is the name of the vehicle, asking whether the copter is in itself may also not work...

and the goto command needs inverted commas.

so.

Code: [Select]
enableradio false
_grp =_this select 0

#loop

"_x moveincargo copter" foreach units _grp

?_grp in copter:goto "camera"

goto "loop"

is what you want. looking farther down the script, the inverted commas need to be taken out of the other checks you do.

try the above, and repost with any further problems.
« Last Edit: 25 Mar 2005, 18:51:28 by bedges »

Offline Woodpeckersam

  • Members
  • *
  • I'm a llama! ooh! Yeah!
Re:Weapons d**nit!
« Reply #8 on: 25 Mar 2005, 19:18:20 »
hey dude, that works, it is this that dont work.

Code: [Select]
_cam CamSetFOV 1
_cam camsetrelpos [180,5,2]
_cam camcommit 6
@camcommitted _cam
#wait
[_grp] leavevehicle copter
_ldr ordergetin true
?"_grp in vehicle(copter)":goto wait
!"_grp in vehicle(copter)":goto carryon
#carryon
~5
_cam cameraeffect ["terminate","back"]
camdestroy _cam
enableradio true
~2
exit

it is this line that dont work

!"_grp in vehicle(copter)":goto carryon

i want it to check if _grp are NOT in the chooper
« Last Edit: 25 Mar 2005, 19:19:15 by Woodpeckersam »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Weapons d**nit!
« Reply #9 on: 25 Mar 2005, 19:21:43 »
mhmm, well like i say,  you don't need the 'vehicle' before (copter)...

a few other mistakes (as far as i can see) - just copy n paste the following and it should be fixed...

Code: [Select]
#wait

_grp leavevehicle copter
_ldr ordergetin true

?_grp in copter:goto "wait"
!_grp in copter:goto "carryon"

#carryon
~5
_cam cameraeffect ["terminate","back"]
camdestroy _cam

enableradio true
~2

exit

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Weapons d**nit!
« Reply #10 on: 25 Mar 2005, 19:53:48 »
Things that are wrong:
- Your if/then sentences (?:) are in quotes ("")
- Your not/then sentence is wrong, it should be if/not/then...
- You can not check whether an entire group is in a vehicle with in...
- gotos are without quotes... The label to goto needs to be in quotes (goto "label")

So, all if/thens should be without quotes and goto labels in quotes, and all group members need to be checked individually:
Code: [Select]
? "_x in vehicle copter" count _grp == count _grp: goto "wait"All of your if group in chopper checks are wrong...

Your not sentence would need to be like this:
Code: [Select]
? !(_grp in vehicle copter): goto "carryon"Altough in this case it's completely wrong and if you read your code you will see you do not need this kind of sentence at all because if the ? "_x in vehicle copter" count _grp == count _grp: goto "wait" returns true (is true, equal, whatever..) the script goes to label "wait" but if the check is not true it continues onwards...

Of course these examples of mine can be utterly wrong because you don't tell us how you call the scripts...

What I mean is that we don't have a clue what the different variables like _grp, _ldr, _fake etc. are 'holding'...

And I'm a bit drunk at the moment... :P ::)

So no guarantees on any syntaxes as usual... And now in particular ;D
« Last Edit: 25 Mar 2005, 19:54:50 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Woodpeckersam

  • Members
  • *
  • I'm a llama! ooh! Yeah!
Re:Weapons d**nit!
« Reply #11 on: 25 Mar 2005, 23:30:02 »
Thanks! It works now cheers :) :D