OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: LTS-1GT 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?
-
can you be a bit more vague please, so you can really help us answer your query
-
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.
-
do you want
something to wreck cars
something to stop damage
what
try to explain what you want the script to do
-
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.
-
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
-
you could do it yourself using Eventhandlers or maybe putting the dammage command to good use
-
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
-
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.
-
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.
-
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
~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
-
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?
-
Hi Terox, I have problem same time.
It give me error again here:
'if|#|({canmove _}count _Ecars>0)then{goto "START"}': Error Unknow operator
-
Shouldn't that be:
if({canmove _x}count _Ecars>0)then{goto "START"}
Planck
-
Oop I forget add x post here message, but it is still problem not working. Planck
-
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
-
Hi Terox, this condition: ({canmove _x}count tx_Ecars)==0 is still give me error again won't work here: Invalid number expression
-
Did you name all your vehicles.....Ecar1, Ecar2, Ecar3, Ecar4 and Ecar5?
Planck
-
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
-
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
-
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?
-
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.
-
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. :'(
-
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
-
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