Home   Help Search Login Register  

Author Topic: Cars Wreck  (Read 4681 times)

0 Members and 2 Guests are viewing this topic.

LTS-1GT

  • Guest
Cars Wreck
« on: 25 Dec 2005, 07:05:16 »
Hello all, Merry Christmas.

This is LTS-1GT. I am looking for script about cars wreck, anyone know?  

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Cars Wreck
« Reply #1 on: 25 Dec 2005, 18:31:02 »
can you be a bit more vague please, so you can really help us answer your query
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

LTS-1GT

  • Guest
Re:Cars Wreck
« Reply #2 on: 25 Dec 2005, 23:52:58 »
Hi Terox, I mean looking for script about cars wreck.  I am mission maker for coop multiplayer. My mission file name call "Steal the cars".  I am trying make for steal enemy cars to escape freedom.  I need the script for cars wreck, try anyone don't get cars wreck more than 1 or 2 mission will failed. Try to be careful , do not damage any them. Sorry my english bad, hope you understand.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Cars Wreck
« Reply #3 on: 29 Dec 2005, 14:46:37 »
do you want

something to wreck cars
something to stop damage

what

try to explain what you want the script to do
« Last Edit: 29 Dec 2005, 14:47:29 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

LTS-1GT

  • Guest
Re:Cars Wreck
« Reply #4 on: 29 Dec 2005, 18:09:37 »
Yes, something cars wreck like accident you the hit tree, hit anywhere house fence, or enemy spot shoot you in car were stole  when you drive cars run  too fast escape to freedom.  If the car has damage window, flat tire can't move it  that is car wreck  more than 1 or 2  cars wreck so  mission could be failed. Steal enemy cars and drive to be careful do not hurt them.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Cars Wreck
« Reply #5 on: 29 Dec 2005, 18:21:58 »
OK......my tentative translation:

He wants to know how to check whether you have wrecked more than x number of vehicles.......if so........mission fail.

I think:   :P

Happy Hogmanay.   :beat:


Planck
I know a little about a lot, and a lot about a little.

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Re:Cars Wreck
« Reply #6 on: 29 Dec 2005, 18:34:01 »
you could do it yourself using Eventhandlers or maybe putting the dammage command to good use
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Cars Wreck
« Reply #7 on: 29 Dec 2005, 22:54:47 »
OK......my tentative translation:

He wants to know how to check whether you have wrecked more than x number of vehicles.......if so........mission fail.

I think:   :P

Happy Hogmanay.   :beat:


Planck

Ok, well the system would incorporate a trigger counting the damage of a set of vehicles contained in an array

basically

INIT.SQS
;; add the name of every car to the following array that you need to monitor
;; in this example, i called them car1, car2 etc etc
tx_Veh = [Car1,Car2,Car3,Car4,Car5]

MISSION EDITOR
Create a once only trigger
Condition:{count canmove _x == 0}foreach tx_vehicles
On Activation: [] exec wreckedveh.sqs



basically the above condition when reached will activate a script
called "wreckedVeh.sqs"
(The trigger waits until all the cars in the array can no longer move)
Create a script called wreckedVeh.sqs do run whatever code you require when the condition is reached

{count canmove _x == 0}foreach tx_vehicles
the canmove command returns whether or not a vehicle can move, based on the damage it has suffered, rather than fuel etc



other conditions you could use are
Condition:({alive _x }count tx_vehicles==0)

for completely destroyed vehicles



« Last Edit: 29 Dec 2005, 23:05:41 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

LTS-1GT

  • Guest
Re:Cars Wreck
« Reply #8 on: 31 Dec 2005, 09:07:27 »
Hi Terox, thank for make nice script surprise me. I don't understand what tx mean?  Each cars I name them:  EastCar1,  EastCar2, EastCar3, EastCar4, EastCar5.

Hmm what is the name code I need for wreckedVeh.sqs files? Is this only 1 file script?

{count canmove _x == 0}foreach tx_vehicles

Why don't you try help me make list script for wrechedVeh.sqs, send it to me yangtong72@hotmail.com, need zip it or winrar before you send.

LTS-1GT

  • Guest
Re:Cars Wreck
« Reply #9 on: 31 Dec 2005, 11:12:46 »
Hmmm Terox, this code: {count canmove _x == 0}foreach tx_vehicles doesn't work, it's give me bad error say: Invalid number expression from condition.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Cars Wreck
« Reply #10 on: 31 Dec 2005, 12:35:16 »
oops sorry silly syntax erros, use the following

to be honest you dont even need a trigger, it would be more efficient if the server simply ran a slow looping script of say 5 second delay between each loop
Use the following

INIT.SQS
tx_EastLose = false
?(local server):[] exec "CarMonitor.sqs"


MISSION EDITOR
1) Create a gamelogic
Name it  "Server"    (without the speech marks)

2) Create your end trigger, have its condition
tx_EastLose
and have it execute whatever script you want to run for the outro etc in the On Activation field


CARMONITOR.SQS
Quote
~3
_Ecars =  [EastCar1,EastCar2,EastCar3,EastCar4,EastCar5]
#START
~5
if({canmove _x}count _Ecars>0)then{goto "START"}

#WRECKED
hint "Add commands here for whatever you need to do, when all of the cars are wrecked"
;;;; eg
tx_EastLose = true; Publicvariable "tx_EastLose"
exit








very basically
the server will run a local script, checking every 5 seconds to see how many vehicles listed in _Ecars can move, based on their damage (not fuel)
When none of the cars are able to move, it will stop looping and start reading the code under the "Wrecked" label

Under this label, baring in mind, only the server will run this code, you will need to Publicvariable a boolean to true, and have a trigger, your end trigger waiting on that boolean condition


tx_  is a tag i use for all my global variables, it simply stops any conflicts with hidden OFP reserved variables and any badly tagged addons

« Last Edit: 31 Dec 2005, 13:03:12 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

LTS-1GT

  • Guest
Re:Cars Wreck
« Reply #11 on: 31 Dec 2005, 19:11:25 »
Hmmm, I am so confuse not clear understand well: Can you explain example for hint? What is the commands to add, how? What to say in hint?

 #WRECKED
hint "Add commands here for whatever you need to do, when all of the cars are wrecked"
;;;; eg
tx_EastLose = true; Publicvariable "tx_EastLose"
exit

About Create my end trigger, have its condition
tx_EastLose?

Ok I create trigger for End#4
condition: tx_EastLose is that all you need?


LTS-1GT

  • Guest
Re:Cars Wreck
« Reply #12 on: 31 Dec 2005, 22:59:43 »
Hi Terox, I have problem same time.

It give me error again here:

'if|#|({canmove _}count _Ecars>0)then{goto "START"}': Error Unknow operator

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Cars Wreck
« Reply #13 on: 31 Dec 2005, 23:16:45 »
Shouldn't that be:

if({canmove _x}count _Ecars>0)then{goto "START"}


Planck
« Last Edit: 31 Dec 2005, 23:17:04 by Planck »
I know a little about a lot, and a lot about a little.

LTS-1GT

  • Guest
Re:Cars Wreck
« Reply #14 on: 01 Jan 2006, 03:04:28 »
Oop I forget add x post here message, but it is still problem not working. Planck

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Cars Wreck
« Reply #15 on: 01 Jan 2006, 13:14:21 »
have just done a working test and mthe following doesnt get any simpler
It works

INIT.SQS
tx_Ecars = [Ecar1,Ecar2,Ecar3,Ecar4,Ecar5]

MISSION EDITOR
Create 5 empty vehicles andm name them
Ecar1 to Ecar5

Create a trigger with the following attributes
Axis A: 0
Axis B: 0
Activation: None
Once/Repeatedly:  Once
Type: #End1
Condition: ({canmove _x}count tx_Ecars)==0

Click on the trigger "effects" tab and then in the "Titles / Type" drop down box, select "Text"
and then in the "Text" Box type the following

Mission failed, all vehicles wrecked



It works, so if you have a problem getting it to work, you arent doing something thats listed above

I knoiw i've caused you some problems because of syntax errors etc, for that i apologise, sometimes i quickly scan through the ofpec forums and answer from memory

« Last Edit: 01 Jan 2006, 13:15:57 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

LTS-1GT

  • Guest
Re:Cars Wreck
« Reply #16 on: 02 Jan 2006, 01:25:01 »
Hi Terox, this condition: ({canmove _x}count tx_Ecars)==0 is still give me error again won't work here:  Invalid number expression

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Cars Wreck
« Reply #17 on: 02 Jan 2006, 01:32:19 »
Did you name all your vehicles.....Ecar1, Ecar2, Ecar3, Ecar4 and Ecar5?


Planck
« Last Edit: 02 Jan 2006, 01:32:44 by Planck »
I know a little about a lot, and a lot about a little.

LTS-1GT

  • Guest
Re:Cars Wreck
« Reply #18 on: 02 Jan 2006, 03:50:15 »
Yup I did.  This Condition: ({canmove _x}count tx_Ecars)==0  not working array correct. It's give me error, Invalid number in expression in trigger won't work. Planck

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Cars Wreck
« Reply #19 on: 02 Jan 2006, 06:20:43 »
LTS-1GT,

Both Terox and myself have tried this......and it works.

I have attached an example demo mission for you to look at.

You are a LAW soldier with a buddy.......first thing to do is shoot your buddy......he is also a LAW soldier........If you don't shoot him he will shoot you after you destroy a couple of jeeps.........then you will have enough ammo for your LAW launcher to destroy 5 jeeps......Quick and Dirty.    ::)


Planck
« Last Edit: 02 Jan 2006, 06:23:38 by Planck »
I know a little about a lot, and a lot about a little.

LTS-1GT

  • Guest
Re:Cars Wreck
« Reply #20 on: 02 Jan 2006, 07:03:22 »
Oh alright, this code ({canmove _x}count tx_Ecars)==0 work only for Resistance 1.96, I didn't know it.  I only use OFP 1.46  make mission editor for coop, why don't work? Do you have any good script maker for OFP 1.46 carwreck?

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Cars Wreck
« Reply #21 on: 02 Jan 2006, 14:10:51 »
Use the following condition in your trigger

Condition: ({alive _x}count tx_Ecars)==0

this will simply return true (Inititate the trigger) when all of the cars are completely destroyed

alternatively, you could use a trigger that monitors the  getdammage value of the cars
You will have to experiment with the getdammage value that will most closely resemble the value that a car no longer can move at

You will have to do some testing yourself.

Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

LTS-1GT

  • Guest
Re:Cars Wreck
« Reply #22 on: 02 Jan 2006, 18:34:22 »
Hmmm no terox, it is still same problem Invalid number in expression, it won't let me enter trigger conditon: ({alive _x}count tx_Ecars)==0. I think this script condition might not work OFP 1.46 support. Why don't you go try create demo test trigger condition: ({alive _x}count tx_Ecars)==0, you will see won't work. Do not launch RESISTANCE 1.96, use OFP 1.46 launch only. :'(

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Cars Wreck
« Reply #23 on: 02 Jan 2006, 20:11:11 »
I tried it with 1.46......

You need to use:

("alive _x"count tx_Ecars)==0

1.46 doesn't seem to like curly braces much   ;D


Planck
I know a little about a lot, and a lot about a little.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Cars Wreck
« Reply #24 on: 02 Jan 2006, 23:10:26 »
thx Plank, shuddering starting pre res OFP
LTS, if it wasnt for the fact that ArmA is just around the corner i would have strongly urged you to get Res addon by now
« Last Edit: 02 Jan 2006, 23:12:05 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123