Jump to content
Sign in to follow this  
Specter

Questions:

Recommended Posts

1) i want to make an object (name target2) appear when the object target1 is destroyed.

2) i want the mission to end when target1, target2, target3, target4, target5, target6, target7 and target8 are destroyed.

3) how can i convert the mission file to a playable mission?

4) how can i make a description for this mission?

Share this post


Link to post
Share on other sites

1 ) Appear?? What do you mean? Create a vehicle, unit?

2 ) The dirty way...

Place an end# trigger and in the condition :

Quote[/b] ]

!alive target1 && !alive target2 && !alive target3 && !alive target4 && !alive target5 && !alive target6 && !alive target7 && !alive target8

3) Save as SP mission / MP mission

4) Do you mean a description.Ext or the description in the weather tab?

Share this post


Link to post
Share on other sites

1) i mean, when one target is destroyed i want another target pop up at a certain position. it should be invisible before or beamed there...

2) thanks

3) thanks

4) w00t?!

Share this post


Link to post
Share on other sites
Quote[/b] ]3) how can i convert the mission file to a playable mission?

just a thought for the future, get a make .pbo program (i'll post a direct link in this when i get back to my comp), it works better than the saving the mission to mp or sp i find...depends, if i have a lot of scripts and files, i would use the make pbo.... but thats just me.

Quote[/b] ]4) how can i make a description for this mission?

if you are talking about the briefing, that is done through a .html file that is put in the missions file before compressing into a .pbo... BIS has a tutorial that helped me, you can download it here

Quote[/b] ]1) i want to make an object (name target2) appear when the object target1 is destroyed.

what do you mean by this, do you want the 2nd target to appear physically or do you what the objective to show up so the player knows they have another thing to kill? if you want the object to apear that could be done through a script, i'm not that great and i aint to great with scripts, maybe someone else could help you with that one...

Share this post


Link to post
Share on other sites
Quote[/b] ]1) i want to make an object (name target2) appear when the object target1 is destroyed.

what do you mean by this, do you want the 2nd target to appear physically or do you what the objective to show up so the player knows they have another thing to kill?  if you want the object to apear that could be done through a script, i'm not that great and i aint to great with scripts, maybe someone else could help you with that one...

yes, i want the object to appear physically...

Share this post


Link to post
Share on other sites

Making an empty vehicle pop out of thin air is easy. For instance, the following short snippet will create an empty

T-80 50 meters in front of the player:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_pos = getpos player

_px = _pos select 0

_py = _pos select 1

_pz = _pos select 2

_tank = "t80" createvehicle [_px,(_py+50),_pz]

_tank setdir 180

Share this post


Link to post
Share on other sites
Quote[/b] ]4) how can i make a description for this mission?

Do you mean a description.ext, briefing.html, or overview.html?

Share this post


Link to post
Share on other sites
Making an empty vehicle pop out of thin air is easy. For instance, the following short snippet will create an empty

T-80 50 meters in front of the player:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_pos = getpos player

_px = _pos select 0

_py = _pos select 1

_pz = _pos select 2

_tank = "t80" createvehicle [_px,(_py+50),_pz]

_tank setdir 180

ok, but i want the object (a "target e" btw) to pop up at a certain location independent from the players position. and what exactly do i do with the code?

Share this post


Link to post
Share on other sites

Make a gamelogic where you want it and name it GL1

then in a trigger/script put

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">target setpos getpos GL1

target setdir 180

or whatever dir you want.

Share this post


Link to post
Share on other sites

Open an empty textfile.

Type in the following (variation of code above)-

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

private ["_pos","_target","_targetMarkers","_counter"]

TargetsAllDead = false

_targetMarkers = ["tgtMark1","tgtMark2","tgtMark3","tgtMark4","tgtMark5","tgtMark6","tgtMark7"]

;loop for popping up targets

_counter = 0

#makeTarget

_pos = getmarkerpos (_targetMarkers select _counter)

_target = "target e" createvehicle _pos

_target setdir 0;change this to whatever direction you want them in

;wait for target to be almost dead

@(damage _target > 0.9)

_counter = _counter + 1

;next target or exit if end of list

?(_counter < count _targetmarkers):goto "makeTarget"

TargetsAllDead = true

exit

save the file as "PopUpTarget.sqs" (note: NOT "PopUpTarget.sqs.txt" !!)

in your mission folder

Add a marker for the location of every target in the list (i.e. "tgtMark1", etc..) make sure the name is exactly the same and ... if you don't want to player to see the marker... make it a dot and white in color... they are very hard to see.

To call this script either make another file called "init.sqs"

and type in:

[] exec "PopUpTarget.sqs"

and save

OR

in the init field of one of your units type in:

[] exec "PopUpTargets.sqs"

When they are all dead the mission will not end unless you put a trigger and put in the

Type: End#1

Condition Line: TargetsAllDead         (instead of "this")

P.S. To make a mission Title and Description double click on the area where you see the time and little cloud looking icon.

This does not make a breifing or overview though.

Share this post


Link to post
Share on other sites
Make a gamelogic where you want it and name it GL1

then in a trigger/script put

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">target setpos getpos GL1

target setdir 180

or whatever dir you want.

made the gamelogiv but where do i have to fill in the code in my trigger?

Share this post


Link to post
Share on other sites

me again:

1) i need a trigger or something which detects wether a unit (mePlayer1 to mePlayer6, only one unit should activate the script but not a particular one) is onboard a ship (ship1 to ship4)

2) when the unit(s) is(are) onboard, a group of enemy soldiers should run to the harbor and attack the stolen boat.

Share this post


Link to post
Share on other sites

1.

Create a trigger where condition is:

(meplayer1 in ship1) or (meplayer2 in ship1) or (meplayer3 in ship1) or (meplayer4 in ship1)

etc etc.

then when trigger fires execute script to attack ship

e.g.

"_x dotarget ship" foreach units group baddies

"_x dofire" foreach units group baddies

etc etc.

Share this post


Link to post
Share on other sites

in the init line of the officer , put the following

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">TEAM1=group this

this will name the group under this officer command " TEAM1" etc...etc..

Share this post


Link to post
Share on other sites

thanks...

one more thing for the moment:

one objective is to steal a chopper. now i want to force the player(s) to kill the crews and guards. my idea is, that the chopper is locked and the pilot has the keys, so you have to kill the pilot to unlock the chopper. is it possible to create such a thing as "keys" which unlock the chopper and put them in the pilots inventory?

Share this post


Link to post
Share on other sites

back to the boats:

i did what you said, but i get an error:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

'"_x dotarget boat2" foreach units group boatcrew |#|; "_x dofire" foreach units group boatcrew': Error group: Type group, expected Object

what did i do wrong?

Share this post


Link to post
Share on other sites

If you named the boat crew "boatcrew" as your quote seems to imply, instead of this

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x dotarget boat2" foreach units group boatcrew

try this

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x dotarget boat2" foreach units boatcrew

Share this post


Link to post
Share on other sites

don't know what my boatcrew is called... i wrote in the officers init-field:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

boatcrew=group this

and i thought that the whole group would be boatcrew...

Share this post


Link to post
Share on other sites

If you have put

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

boatcrew=gorup this

in the init of the officer of your boat crew , the whole group is named boatcrew now.

That is good

But have you done what i suggested ?

replace what gave you the error

Quote[/b] ]"_x dotarget boat2" foreach units group boatcrew
 

by this

Quote[/b] ]"_x dotarget boat2" foreach units boatcrew

notice the change , the word in bold character is not here anymore , i am sure that it was what caused the error for you.

So be sure that the target is really named boat2 and your crew named boatcrew should target it without an error poping up.

Correct the similar line by removing the word group if you have other situation like this

Share this post


Link to post
Share on other sites

made the change, now it says:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

'_x dofire|#|': Error Invalid number in expression

Share this post


Link to post
Share on other sites

You have to doFire a target, the one you 'doTargeted' earlier...

"_x doFire boat2"...

Share this post


Link to post
Share on other sites

ok, no more errors, BUT the soldiers don't shoot! could it be, that they don't shoot because their behaviour is set to "safe"?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×