OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: GW on 13 Jun 2010, 06:45:07
-
I make a mission,in which i want that a soldier enter into trigger,than it add as a new objective.before his entering into trigger objective remains hide.
-
Create a file called init.sqs and this in it:
"2" objStatus "HIDDEN"
Then go to your trigger, set up the "activated by" stuff and write following in "On Activation" field:
"2" objStatus "ACTIVE"; hint "You have a new objective"
That will make the status of the second objective (you can change 2 to 3 and make third objective hidden) to hidden at the start and when player enters the trigger it will make it visible and it'll hint that player has new objective.
Hope that helps,
Krieg
-
There's also a tutorial in the Editors Depot (http://www.ofpec.com/ed_depot/index.php?action=details&id=325).
Always worth searching first. :good:
-
i am busy in making my campaign,how can i stop AI units to go back again there first waypoint?
-
i am busy in making my campaign,how can i stop AI units to go back again there first waypoint?
Use a CYCLE waypoint. Place it close to the first waypoint. (The AIs will go back to whatever waypoint the CYCLE is closest to).
If you aren't sure when they will need to go back to the first waypoint, make a trigger and set its type to "Switch." Synchronize (F5) it to the waypoint BEFORE your cycle waypoint. Place the cycle waypoint close to the group's first waypoint, as before. Whenever the switch trigger is activated, the group will go back to the first waypoint.
-
i mean they will leave from kolugjev one part to another end for a battle,but when there most squad died the rest will back to there first point/starting point,from where they start,
how can i make them that they will fight till the death in there last waypoint .
-
Use the allowFleeing (http://www.ofpec.com/COMREF/index.php?action=details&id=18&game=All) command to stop them from running away.
In the Init line of the group leader, write
"_x allowFleeing 0" forEach units this
-
Either:
1. Make their last waypoint a GUARD
or
2. Make the last two waypoints: SEEK AND DESTROY followed by a CYCLE with these two waypoints next to each other.
-
i making a mission,in which whenever guards of base see any resistance soldier than trigeered the alarm and everyone inside the base get in stealth approach,
-
Assuming that it is West guarding the base; simply change it to East if necessary.
1. Make a trigger covering just the base and its guards:
West, Present, Once
and give the trigger a name, in this example: base
2. Make a second trigger, centred on the base and large enough to cover the area where the Resistance might be spotted, this might be 1500 metres in diameter:
Resistance, Detected by West, Once
write in the On Activation line:
"_x setBehaviour {STEALTH}" forEach list base
then click on the 'Effects' box in the bottom lefthand corner. You're interested in sounding the alarm, so choose
Sound - Anonymous - Play Alarm (scroll near to the bottom of the list)
-
@Walter_E_Kurtz
THANKS for your answers,
how can i make friendly units to go , where i click on map and than know there status about remaining dead and alive
-
how can i make friendly units to go , where i click on map and than know there status about remaining dead and alive
LOL GW. Really, there's all kinds of ways you could do this, and it's been done many ways. There's even a whole demo mission (http://www.ofpec.com/ed_depot/index.php?action=details&id=290&game=OFP) from SelectThis available from the editor's depot. I don't really like how SelectThis wrote his script, but that's just me.
To make a unit go where you click on the map:
onMapSingleClick {unitname move _pos}
where unitName is the name of the unit to be moved. OnMapSingleClick (http://www.ofpec.com/ed_depot/index.php?action=details&id=48&game=ArmA) has a whole tutorial devoted to it, you should read it.
To make units report how many units in the group are alive,
unitName sideChat format ["%1 are alive", {alive _x} count units groupName]
Where unitName is the name of the unit you want to communicate, and groupName is the name of the group you want to know about.
-
Quote Spinor
onMapSingleClick {[_pos, _units, _shift, _alt] exec "OnMapClick.sqs"}
i.e. whenever the player clicks on the map, a script "OnMapClick.sqs" is called with all the available parameters as arguments. This also answers your question about reading the status of the SHIFT and ALT keys. Their status is contained in the reserved boolean variables _shift and _alt (if true, key is pressed). _units is an array of the currently selected units.
Within "OnMapClick.sqs" you can do whatever you want with the info given
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
OnMapClick.sqs
_pos = _this select 0
_units = _this select 1
_shift = _this select 2
_alt = _this select 3
;block execution when player did select units
?Count _units != 0: Exit
;block execution when player is commander of a vehicle
_vehicle = Vehicle Player
?(_vehicle != Player) AND (Commander _vehicle == Player): Exit
.....
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
e.g. you can block execution of the script under some curcumstances or include a pause between click and movement.
Spinor
Thread Link : http://www.ofpec.com/forum/index.php?topic=2666.15 (http://www.ofpec.com/forum/index.php?topic=2666.15)
Regards,
Haroon1992
-
how can i make units to visits some villages from moton to sain piere again and again,by getting out from there URAL.
-
Here's a demo mission that will show you how to do that. You'll have to modify the units and waypoint locations to fit with your mission, but the basic idea should be the same.
-
I try this advice,but find one bug,if driver get killed of ural in way.than units will stay inside the truck and never come out.
-
Ah, yes. You might be able to solve that with scripting, but it depends on what you want the remaining men in the truck to do. Do you want them to disembark? Do you want them to continue the patrol somehow?
-
i want that driver of cargo unit,not a single unit. :yes:
-
I can't understand what you just wrote. Are there words missing?
-
is there a way to add soldiers one by one to side by radio anytime.
i mean when we call radio,soldier will get present there immediately wherever i was.
-
I can't quite understand. But to start with, make a radio trigger that will execute the following script:
soldier1 move getpos player
exit
soldier1 will be the name of the person you want to move.
-
Do a search for the createUnit (http://www.ofpec.com/COMREF/index.php?action=details&id=85&game=OFP) command, and maybe the keyword "spawn".
-
i making a sp mission,
i played a mission some year ago.
where i can add 3 soldier to my side anytime anywhere near to my position.
its like a magic.
-
It depends how many times this is to be done. If it is to be many times then, as bedges says, you will have to "spawn" them.
To do it just once needs less scripting:
1. Place a trigger: Radio Alpha, Repeatedly and On Activation: [] exec "help_me.sqs"
2. Place the three extra soldiers somewhere far away in a separate group. Give them names: soldier1, soldier2 and soldier3.
3. Create the script as a text file: help_me.sqs
? (count units player) > 9 : exit
1 setRadioMsg "NULL"
[soldier1, soldier2, soldier3] join (GrpNull)
[soldier1, soldier2, soldier3] join player
soldier1 setPos getPos player
soldier2 setPos getPos player
soldier3 setPos getPos player
The script first checks if there are nine or fewer units in the players group, since 3 are to be added and the maximum in any group is 12.
It then hides the radio option, assuming that you used Radio Alpha. If you used something else, you will have to change the number in the setRadioMsg (http://www.ofpec.com/COMREF/index.php?action=details&id=314&game=All) line.
Finally the troops are teleported magically to the players location.
-
Is there a easy way to assign night googles to whole group(12) of soilders.
-
{_x addweapon "NVgoggles"} foreach units groupname
-
i played a mission some year ago in which soldiers who died get extinguished,can anyone tell me script of this.
-
If you mean having dead bodies disappear, here's (http://www.ofpec.com/forum/index.php?topic=33131.msg228411#msg228411) one way.
-
@Walter_E_Kurtz
its showing distance error of 300.
-
Make sure the notes are removed by deleting the "<---" and everything that comes after.
-
@walter
i try this
make a sqs file of name deaddude.sqs
than copy all this inside the fall
_corpse = _this select 0
~120 <--- time in seconds that corpses are set to remain
@player distance _corpse > 300 <--- distance in metres player has to be away for body to be removed
deleteVehicle _corpse
exit
as you said ,i put this script under officer
for a group:
morituri = group this; {_x addEventHandler ["killed", {_this exec "deaddude.sqs"}]} forEach units morituri
but its showing error still
i do remove all things you said
than its look like
Code:
_corpse = _this select 0
~120
@player distance _corpse > 300
deleteVehicle _corpse
exit
but its not working :no: