Home   Help Search Login Register  

Author Topic: unit PLAYmove "CombatStrokeGunEnd";  (Read 774 times)

0 Members and 1 Guest are viewing this topic.

magnar

  • Guest
unit PLAYmove "CombatStrokeGunEnd";
« on: 13 Jan 2005, 08:56:35 »
Hi again guys.......I'm hoping for some help with having an AI guy kill people with the stoke gun.  Its for an MP mission. 1.  Now, I'm going to disable the AI "move" on the East guy (call him "Unit") who I want to do this.  2. I'll place a trigger activiated by west over  "Unit".  3. init the script to kill the west guy.  4. start script with stroke gun animation. 4.  Ok, now its help time.  How would you script it so the west guy in the area is killed.  My limited experience, really limited, experience in scripting is not getting me anywhere......... I tried using a script I down loaded, made By "A Talking Penguin- Close combat script" (nice script, works for player to kill people) to get some ideas, but I stuck.  I dont think it needs to be as elaborate as that one, because the AI wont be moving, so no trigger needs to follow him.  Can this be done with 1 trigger and 1 script?  Any help is appreciated.........as always.   Thanks in advance!  :-\

magnar

  • Guest
Re:unit PLAYmove "CombatStrokeGunEnd";
« Reply #1 on: 13 Jan 2005, 08:59:21 »
Sorry, I forgot, will the animiations show up in a MP game like this. I dont think it will be a problem, so the public variable situation shouldnt be an issue.  thanks once again...........

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:unit PLAYmove "CombatStrokeGunEnd";
« Reply #2 on: 13 Jan 2005, 11:21:26 »
I would start to elaborate around these lines:

?westGuy distance eastGuy < 2

eastGuy doWatch westGuy; eastGuy playMove "combatStrokeGunETC"
~2*

westGuy setDamage 1;**

* Time the delay with the length of the animated playMove-sequence
** Maybe some playMove for westGuy before he dies (FXdismay for example)

OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:unit PLAYmove "CombatStrokeGunEnd";
« Reply #3 on: 13 Jan 2005, 11:22:57 »
The scripting should be fairly simple. If you stick to triggers you don't have to worry about publicVariables at all
OFPEC | Intel Depot
RETARDED Ooops... Retired!

magnar

  • Guest
Re:unit PLAYmove "CombatStrokeGunEnd";
« Reply #4 on: 13 Jan 2005, 11:50:28 »
Thanks for your input.    From the looks of it, I forgot to mention that I want the event to work for any west guy inside the 3 meter trigger.  I think your suggestion was based on the "westguy" being named as such.    But I could be wrong........I'm no good at all with original scripting.  That was my fault for not being more specific, if thats the case.   Is a solution possible? ::)

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:unit PLAYmove "CombatStrokeGunEnd";
« Reply #5 on: 13 Jan 2005, 12:27:33 »
yes, but itÂ's a little bit mnore complicated and I canÂ't help you now, because I'm working. Study the _this select part of any script, and hit the comref. But my experience tells me that the playMove and facing of the striking soldier will produce a crude and unrealistic effect. It might look good in a cutscene, but in a player controlled MP-environment the effects will be too unpredictable. The AI will face the wrong way, the strokeGun will miss itÂ's target, the victim will die before the stroke is finished, etc
OFPEC | Intel Depot
RETARDED Ooops... Retired!

magnar

  • Guest
Re:unit PLAYmove "CombatStrokeGunEnd";
« Reply #6 on: 13 Jan 2005, 22:50:24 »
the effects will be ok........I can mess with that part.  Plus, it will be for a Civil War mission, so there will be lotsof combat going on around the area.  I dont think anyone will have time to notice ::).  I'll try researching the topic you suggested, but feel free to provide any additional help.  thanks again.   ;)

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:unit PLAYmove "CombatStrokeGunEnd";
« Reply #7 on: 14 Jan 2005, 21:25:48 »
I have a fear of public variables, since I never have a chance to test my MP-missions before I play them with my LAN-group. ThatÂ's why I usually tryu to solve as many MP-issues as possible with triggers and Waypoints.

I'm still working and have no possiblity to test syntax, but this is my suggestion:

Place eastGuy on the battlefield and write this disableAI "MOVE" in his init field.

Make two 3 meter triggerZones around eastGuy. Make sure both are centered exactly on him. Set them to WEST-PRESENT-REPEATEDLY

TRIGGER1
C: this
A: eastGuy doWatch this; this joinGrp "NULL"; stroke=true

TRIGGER2 (1-2 seconds delay)
C: this AND stroke
A: this setDamage 1

Messy, right? ;D

Let me know if it works.

 
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline TonyRanger

  • Members
  • *
  • I'm a llama!
Re:unit PLAYmove "CombatStrokeGunEnd";
« Reply #8 on: 15 Jan 2005, 09:35:23 »
wait,guys,I don't think these are good ideas.
this setDamage 1 is not good it's not good at all.
I think this setDamage 0.91 is better,and the fact is stroke gun only once can't bit a person to death and even wounded.
so my idea is you need to add animation named"CQB"(can't use by action meun)
onec a man be stroked he animate["CQB",1],then lying down for a second(setdammage 0.3)
do you know what I mean?
if he is down but alive and this animationPhase ""CQB"" < 0.5
he can't stroke you.
...
wait I think my script can explain all of this
all of this need 3 scripts,just remeber it's inter addons' script,I've modify USMC and PLA unit ,add a animate "CQB".
first is CQB1.sqs

_ap=_this select 0
#update
_ap dowatch objnull
#main
?not(alive _ap):goto"update"
?isnull _ap:goto"update"
_ep1=nearestobject[_ap,"SUCHpatrol"]
_ep2=nearestobject[_ap,"SUCHftldr"]
_ep3=nearestobject[_ap,"SUCHusmcgren"]
_ep4=nearestobject[_ap,"SUCHusmcmedic"]
_ep5=nearestobject[_ap,"SUCHusmcauto"]
_ep6=nearestobject[_ap,"SUCHusmcsmaw"]
_ep7=nearestobject[_ap,"SUCHusmcJAV"]
_ep8=nearestobject[_ap,"SUCHusmcrifle"]
_ep9=nearestobject[_ap,"SUCHrecon"]
_ep10=nearestobject[_ap,"SUCHusmcsmaw2"]
?isnull _ep1 and isnull _ep2 and isnull _ep3 and isnull _ep4 and isnull _ep5 and isnull _ep6 and isnull _ep7 and isnull _ep8 and isnull _ep9 and isnull _ep10;goto"main"
?_ap distance _ep1 < 2:goto"action1"
?_ap distance _ep2 < 2:goto"action2"
?_ap distance _ep3 < 2:goto"action3"
?_ap distance _ep4 < 2:goto"action4"
?_ap distance _ep5 < 2:goto"action5"
?_ap distance _ep6 < 2:goto"action6"
?_ap distance _ep7 < 2:goto"action7"
?_ap distance _ep8 < 2:goto"action8"
?_ap distance _ep9 < 2:goto"action9"
?_ap distance _ep10 < 2:goto"action10"

goto"main"
#action1
?not(alive _ep1):goto"update"
?not(alive _ap):exit
[_ap,_ep1]exec"\VME_events\CQB2.sqs"
~3+random 3
goto"main"
#action2
?not(alive _ep2):goto"update"
?not(alive _ap):exit
[_ap,_ep2]exec"\VME_events\CQB2.sqs"
~3+random 3
goto"main"
#action3
?not(alive _ep3):goto"update"
?not(alive _ap):exit
[_ap,_ep3]exec"\VME_events\CQB2.sqs"
~3+random 3
goto"main"
#action4
?not(alive _ep4):goto"update"
?not(alive _ap):exit
[_ap,_ep4]exec"\VME_events\CQB2.sqs"
~3+random 3
goto"main"
#action5
?not(alive _ep5):goto"update"
?not(alive _ap):exit
[_ap,_ep5]exec"\VME_events\CQB2.sqs"
~3+random 3
goto"main"
#action6
?not(alive _ep6):goto"update"
?not(alive _ap):exit
[_ap,_ep6]exec"\VME_events\CQB2.sqs"
~3+random 3
goto"main"
#action7
?not(alive _ep7):goto"update"
?not(alive _ap):exit
[_ap,_ep7]exec"\VME_events\CQB2.sqs"
~3+random 3
goto"main"
#action8
?not(alive _ep8):goto"update"
?not(alive _ap):exit
[_ap,_ep8]exec"\VME_events\CQB2.sqs"
~3+random 3
goto"main"
#action9
?not(alive _ep9):goto"update"
?not(alive _ap):exit
[_ap,_ep9]exec"\VME_events\CQB2.sqs"
~3+random 3
goto"main"
#action10
?not(alive _ep10):goto"update"
?not(alive _ap):exit
[_ap,_ep10]exec"\VME_events\CQB2.sqs"
~3+random 3
goto"main"

second is CQB2.sqs
_ap=_this select 0
_ep=_this select 1
_D1= (_ap knowsabout _ep)*2
_D2= (_ep knowsabout _ap)*2
_apR=random 10 + (speed _ap) +_D1
_epR=random 10 + (speed _ep) +_D2
#update
?speed _ap > 18 and speed _ep < 18:goto"action1"
?speed _ap < 18 and speed _ep > 18:goto"action2"
?speed _ap > 18 and speed _ep > 18:goto"Main"
exit
#main
?_ap animationPhase "CQB" < 0.5 and _ep animationPhase "CQB" >0.5 :goto"action1"
?_ap animationPhase "CQB" > 0.5 and _ep animationPhase "CQB" <0.5 :goto"action2"
?_ap animationPhase "CQB" > 0.5 and _ep animationPhase "CQB" > 0.5 :exit
?not(canstand _ep):goto"action1"
?not(canstand _ap):goto"action2"
?_apR-_epR>0:goto"action1"
?_apR-_epR<0:goto"action2"
?_apR==_epR:goto"work"
exit
#action1
?not(canstand _ap):goto"action2"
_ap dowatch _ep
_ap setunitpos"up"
_ap switchmove"combatstrokegun"
~1
?_ap distance _ep >2.5:exit
[_ap,_ep]exec"\VME_events\CQB3.sqs"
exit
#action2
?not(canstand _ep):goto"action1"
_ep setunitpos"up"
_ep dowatch _ap
_ep switchmove"combatstrokegun"
~1
?_ap distance _ep >2.5:exit
[_ep,_ap]exec"\VME_events\CQB3.sqs"
exit

the last one CQB3.sqs
_ap=_this select 0
_ep=_this select 1
_dammage=getdammage _ep
_rd=random 10
#main
?not(alive _ep):exit
?not(alive _ap):exit
?not(canstand _ap):exit
_ep animate["CQB",1]
_ep setdammage _dammage + 0.3
?_rd < 4:_ep playmove"crouchdying"
?_rd >= 4:_ep playmove"CombatRunFToLying"
~3+random 10
?not(alive _ep):exit
?_rd < 4:_ep setdir getdir _ep -180
?_rd < 4:_ep switchmove"Treatedlyingtolying"
~5
_ap setunitpos"auto"
_ep setunitpos"auto"
_ep animate["CQB",0]
exit



Offline TonyRanger

  • Members
  • *
  • I'm a llama!
Re:unit PLAYmove "CombatStrokeGunEnd";
« Reply #9 on: 15 Jan 2005, 09:50:55 »
look here I used switchmove"CombatStrokeGunEnd",just because I need the one who stroke gun make dammage to his target at once(If "playmove" AI can't finish the action at once you know ),than you see speed > 18,that means you must stand (stand run forward's speed is 17.81752 or more),so this can aviod AI stroke you when he is lying.also the animate"CQB" is make sure we know the man is be stroke down,he can't stroke you even he's speed is higher than 18(of crouse If you want use this script you can remove these sentance,just because in normal time you can't make your speed higher than 18 but lying)
this script can only work on USMC,exspecially you change {_ep1=nearestobject[_ap,"SUCHpatrol"]} into{_ep1=nearestobject[_ap,"soldierWB"]}
if you think that isn't enough ,you can add your own list just follow that form.
and
_ap=_this select 0
_ep=_this select 1
_D1= (_ap knowsabout _ep)*2
_D2= (_ep knowsabout _ap)*2
_apR=random 10 + (speed _ap) +_D1
_epR=random 10 + (speed _ep) +_D2
#update
?speed _ap > 18 and speed _ep < 18:goto"action1"
?speed _ap < 18 and speed _ep > 18:goto"action2"
?speed _ap > 18 and speed _ep > 18:goto"Main"
exit
#main
?_ap animationPhase "CQB" < 0.5 and _ep animationPhase "CQB" >0.5 :goto"action1"
?_ap animationPhase "CQB" > 0.5 and _ep animationPhase "CQB" <0.5 :goto"action2"
?_ap animationPhase "CQB" > 0.5 and _ep animationPhase "CQB" > 0.5 :exit
?not(canstand _ep):goto"action1"
?not(canstand _ap):goto"action2"
?_apR-_epR>0:goto"action1"
?_apR-_epR<0:goto"action2"
?_apR==_epR:goto"work"
 these means
you may success active a strokegun attack from their back when you run toward him,of crouse both you and he has chance to stroke each other down.but you may also find it has some skill,isn't it?  ;D