Home   Help Search Login Register  

Author Topic: How to simulate immobilized tank?  (Read 2045 times)

0 Members and 1 Guest are viewing this topic.

Offline lendrom

  • Members
  • *
How to simulate immobilized tank?
« on: 20 Sep 2004, 10:20:35 »
I want to simulate tank that has been immobilized but still fights. My question is how to prevent tank's crew (especially gunner) from disembarking from it after tank has been dammaged and can't move.
I tried to make a trigger:
Condition: canmove tankname
On Activation: [gunner tankname, tankname] exec "gunner.sqs"; deletevehicle commander tankname; deletevehicle driver tankname (i don't need them anymore  :P)

gunner sqs is as follows:

_gunner = _this select 0
_tank = _this select 1
#loop
_gunner moveingunner _tank
~0.01
goto "loop"

But it's strange - driver and commander disapeard as i wanted but gunner showed outside the tank and tank's turret was moving at the same time...

any help? I would be gratefull.
Blessed are those who have nothing to say and yet they remain silent.

GI-YO

  • Guest
Re:How to simulate immobilized tank?
« Reply #1 on: 20 Sep 2004, 10:59:40 »
If you could set the fuel level to zero when you reach your trigger then the tank wont move and from my experience the crews stay put. Just found this script at http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=19483;start=0.

;nogas modified by Rokket, from Johan Gustafsson's "blowup" example
; only works completely because of The Real Armstrong (thanks)

_Unit = _this select 0
_Vehicle = _this select 1
i=0

#Update
? _Unit in _Vehicle AND (nofuel == 1) AND (i == 0): goto "nogas"
? i==1: goto "done"
~1
goto "Update"

#nogas
_Vehicle setfuel 0
i=1
exit

#done
exit

Offline lendrom

  • Members
  • *
Re:How to simulate immobilized tank?
« Reply #2 on: 20 Sep 2004, 11:30:49 »
But I want the trigger to activate in the moment the tank is dammaged so it can't move - condition of trigger is 'canmove tank'. And afak when this condition is satisfied crew automaticly leavs vehicle. The trick with fuel would work after the tank is dammaged but before it is unable to move (condition canmove is satisfied) ???. I think so... :( Anyway thanks.
Blessed are those who have nothing to say and yet they remain silent.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How to simulate immobilized tank?
« Reply #3 on: 20 Sep 2004, 11:39:06 »
This is a tricky one.   I suspect what is actually happening is that the tank is both not canMove and not canFire.   I doubt the crew would disembark if it could still fire.    

The problem is that usually the two conditions occur together:  the cases when the tank can't move but can fight are relatively unusual.

Since you want a particular effect I would recommend scripting the whole thing.     Add an eventhandler "hit" to the tank, and, based on the dammage received, set fuel, ammo and general dammage states accordingly.    I would also recommend experiments to discover the levels of dammage that will create the various conditions in which you are interested.

In other words, forget canMove:  what you actually want is a tank dammaged 0.7 (or whatever) with setFuel 0 and plenty of ammo.   That is the endstate you actually want, how you get from the [first, second or third, etc.] hit to that state is up to you, the mission designer.
Plenty of reviewed ArmA missions for you to play

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:How to simulate immobilized tank?
« Reply #4 on: 20 Sep 2004, 16:57:53 »
Quote
I doubt the crew would disembark if it could still fire.
afaik they do jump out after the vehicle is damaged so that it can't move...
It's same with all vehicles...

I agree with macca on the other parts though...
And this is tricky as the OFP damage stuff is very unreliable and crappy... >:(
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How to simulate immobilized tank?
« Reply #5 on: 20 Sep 2004, 17:24:42 »
Quote
afaik they do jump out after the vehicle is damaged so that it can't move...

I stand corrected.   I've never tested it, but of course as soon as I think about it it must be right since you can damage a tank, slot the crew when they hop out then jump in yourself and start blowing things up.
« Last Edit: 20 Sep 2004, 17:25:30 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline lendrom

  • Members
  • *
Re:How to simulate immobilized tank?
« Reply #6 on: 20 Sep 2004, 19:46:07 »
Thanks. I tried some other trick but without any result ???. But your solution with setfuel is no good for me. I want to give player objective to immobilize the tank (he has no antitank weapon besides hawkins mines). I tried and it is possible to immobilize (even to destroy) i44 tiger tank with two well placed hawkinses. I'd rather the crew did't leave dammaged tank but priority has objective to immobilize tank - i dont want to immobilize it by 'cheating'  ;) with setfuel. Thanks for help - at least i know there is no obvious solution  :)
Blessed are those who have nothing to say and yet they remain silent.

Unnamed

  • Guest
Re:How to simulate immobilized tank?
« Reply #7 on: 20 Sep 2004, 20:45:05 »
You could detect when any of the crew leave a tank and when CanMove returns false, using a GetOut event. Then Setdamage the tank to a level that resets CanMove to true. Kill the crew you dont want, and move the gunner back in. Or run a getpos\setpos loop every 0.01 seconds on the repaired tank, so it wont go anywhere

Would something like this work with setDamage?

Code: [Select]
@(Call {_Vehicle SetDamge ((GetDamage _Vehicle)-0.1) ; CanMove _Vehicle})

Offline lendrom

  • Members
  • *
Re:How to simulate immobilized tank?
« Reply #8 on: 20 Sep 2004, 21:22:52 »
I tried to do sth you suggested and it combined with setfuel works fine. When trigger not(canMove tankname) is fired I remove its crew(by simple setpos [0,0,0] - for some reason deleteVehicle didn't work) and after one second slightly repair the tank (not to have it blown up), move gunner back and setfuel to 0. That's not easiest way to do it but it works ;D. Many thanks to you all for your response. Mabey I'll manage to finish my first mission after all those years of mission editing (since demo)  :)
Blessed are those who have nothing to say and yet they remain silent.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How to simulate immobilized tank?
« Reply #9 on: 21 Sep 2004, 03:19:29 »
Yeah, go for it.   It's important not to do anything that the player will notice and feel is unfair, but don't be embarressed to make a good mission by using scripting to your advantage.

If in doubt, make it and post it in the beta forum.    If it's a pile of pants we'll tell you, but if it works we'll tell you that too.
Plenty of reviewed ArmA missions for you to play

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:How to simulate immobilized tank?
« Reply #10 on: 21 Sep 2004, 23:08:58 »
Ok, haven't read the whole thread, but just replying to this part:

Quote
My question is how to prevent tank's crew (especially gunner) from disembarking from it after tank has been dammaged and can't move.
I believe that by "locking" the vehicle, you prevent anyone (AI or player) from either entering or EXITING the vehicle. So just make vehicleLock -> locked.  :)
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 macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How to simulate immobilized tank?
« Reply #11 on: 22 Sep 2004, 08:29:05 »
IIRC markers are also always at sea level.  
Plenty of reviewed ArmA missions for you to play

Offline lendrom

  • Members
  • *
Re:How to simulate immobilized tank?
« Reply #12 on: 22 Sep 2004, 11:02:12 »
Gen Baron - i tested it but ai WILL EXIT the tank when not(canMove) even when it is locked.
Blessed are those who have nothing to say and yet they remain silent.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:How to simulate immobilized tank?
« Reply #13 on: 23 Sep 2004, 09:10:16 »
I'm pretty sure the vehicle lock only works on players... I could be wrong though ;)

Comrade Joe

  • Guest
Re:How to simulate immobilized tank?
« Reply #14 on: 23 Sep 2004, 09:50:19 »
Remove its fuel?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How to simulate immobilized tank?
« Reply #15 on: 23 Sep 2004, 10:36:18 »
Sui is right, lock only works on humans.

Glad you got it to work lendrom.    Now click the green solve button so we all know that the problem has been, well, solved.    :)
Plenty of reviewed ArmA missions for you to play

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:How to simulate immobilized tank?
« Reply #16 on: 23 Sep 2004, 19:51:37 »
I seem to remember once placing an AH1, player pilot and flying on the map, only locked. And I seem to remember that my AI copilot could not eject, just like me. Perhaps it only worked pre-resistance, or maybe I just remembered wrong. Oh well :(
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 macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How to simulate immobilized tank?
« Reply #17 on: 23 Sep 2004, 21:46:39 »
Or maybe it works on AI in the player's group.    Or something.
Plenty of reviewed ArmA missions for you to play