Forum Jump :

Author Message


Posts: 20279
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#16 Posted at 2007-09-18 18:17        
     
Commands - Init/Trigger/Activation (2 pages + download) by 6thStorm

:thumb

Another excelent resource for mission makers :)

Visit my family webshop desteigerhoutshop.nl.

Author Message

Myke  

Mc Script


Posts: 1034
Rank:


Level: Member

Country: ch
Location: St. Gallen
Occupation: Armaholic addon tester
Age: 47
In-game name: Myke

 
#17 Posted at 2008-08-06 16:07        
     
What's "this"?
PUN intended

While editing and scripting, almost everywhere you'll encounter the word "this". Sometimes with, sometimes without previous underline.
And mostly you overlook it since you don't know what it is for but anything works as you like, so why care about.

Here a brief overlook what's "this" for, where you may ancounter it and what does it there.


Let's begin with the most obvious: "this" in scriptcalls.

Many times you may encounter scripts (no matter if .sqf or .sqs style) that are called like this:
this exec "script.sqs"
[this] exec "another_script.sqs"
You may have noted, these scriptcalls are always in objects (unit, vehicle, building, just anything) initialization lines. Never you'll find such a scriptcall inside another script.

Here, "this" just means: "this object/man/vehicle, not the other 2 meters on the left".
So if you have a unit WEST/AT Soldier/Myke, then this is this unit. No one else.
So anything that the script does, as long it refers to the unit passed, will be done to/with this unit.


This leads us to the second place where you may encounter "this": inside scripts.

Each script can get one or multiple variables through the exec/execVM command:
variable exec "script.sqs"
Ok, we've passed the variable to the script. But inside the script we have to read the variable:
_myvariable = _this;
Here it is: "_this"
Don't be confused about the underlines, they mean only that the value of the variable isn't shared with other scripts.
In this example we pass a single variable to the script but we could also pass multiple variables by using an array (this is mostly the case):
[variable1, variable2, variable3] exec "script.sqs"
Now if we use the line above
_myvariable = _this;
then "_myvariable would contain the whole array, not a single variable. So we use the "select" command:
_myvariable1 = _this select 0;
_myvariable2 = _this select 1;
_myvariable3 = _this select 2;
Now we've splitted the array up into independent variable. All this by using "this".


Now there's another place where you encounter "this" but maybe you didn't noticed it yet: in triggers.

Whenever you create a new trigger, in the condition line already stands "this". What does it there?
Well, for sure you already used triggers by setting size, shape, position, activated by and all those drop down settings. All these settings are "this".
As long "this" is in the condition line, all the above settings are used as condition to fire the trigger.
You can extend the conditions by extending "this" with other conditions. Practical example:
In a mission you would have destroyed vehicle "Shilka" and players must reach extraction point. Well, extraction point is easy: trigger with settings "players side/present". But this trigger will also fire if the player runs directly to the extraction point without killing the Shilka.
Now we extend the conditions:
this AND (! alive Shilka)
So now our end trigger will only fire if players side is present in trigger area AND the shilka is destroyed. If you remove "this AND", then all above settings are irrelevant and the trigger will fire as soon the Shilka is destroyed, no matter of all settings.


Well, this was a short introduction of "this". Hope you can use "this".


Advertisement


Author Message


Posts: 20279
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#18 Posted at 2008-08-31 18:56        
     
Blackhawk : Here is a little setacctime Tutorial I made. It features the basics of it, I hope to make a more advanced one in the future.



if you want to see the Hi-def one go to Youtube and type in Setacctime Tutorial.

Visit my family webshop desteigerhoutshop.nl.

Author Message


Posts: 44
Rank:


Level: Member

Country: au
Location:
Occupation: Distribution Manager (yes I lose your stuff)
Age: 44
In-game name:

 
#19 Posted at 2008-09-26 03:11        
     
I wan't to keep the radio hidden at the start of my mission. How do I activate the radio to allow me to call a script, after certain units are dead or conditions are met

So to get it to work as you are asking we need to create the radio trigger on the fly.

1st create this trigger

; activation- none
; type- switch
; name- radioAlpha
; condition-this
; onAct-

2nd create this trigger

; activation- none
; type- none
; name-
; condition- (not alive a1) and (not alive a2)
; onAct- PAPABEAR=[West,"HQ"]; PAPABEAR SideChat "Artillery is now available"; this = execVM "RadioTrigger.sqf"

Or add your condition instead of the not alive check. EG:- this && player in thislist

This is the script that will create our radio trigger and luanch the script.

RadioTrigger.sqf

if (local player) then
{
radioAlpha = createTrigger["EmptyDetector",getPos player];
radioAlpha setTriggerArea[0,0,0,false];
radioAlpha setTriggerText "Request fire mission";
radioAlpha setTriggerActivation["ALPHA","PRESENT",true];
radioAlpha setTriggerStatements["this", "[] exec ""artillery.sqs""", ""];
sleep 1;
};

If you are calling SQF via the RadioTrigger script, replace the setTriggerStatements line with this,

radioAlpha setTriggerStatements["this", "execVM ""artillery.sqf""", ""];

I hope this helps somebody

"I have not failed. I've just found 10,000 ways that won't work."

Author Message


Posts: 278
Rank:


Level: Member

Country: mm
Location: Yangon
Occupation: Physics(YEU)
Age: 25
In-game name:

 
#20 Posted at 2009-08-22 08:24        
     
What does the "talk" waypoint do?

Answer :
 The talk waypoint is used in conversations.Usually, a certain Voice is selected in the Effects tab of the talk waypoint or the talk waypoint should be like that...
So that the unit will stay there until the given line/voice completes,once the voice is completed , the unit will proceed its next waypoint.

What does the "Support" waypoint do?

Answer :
The support waypoint is a special waypoint which SHOULD only be used with units/vehicles that are able to SUPPORT.They are medics(unit),Ambulance,Repair Trucks,Refuel Trucks , and Ammo Trucks...
The waypoint work this way :
If you placed a repair truck, and do a "support" waypoint for it, the truck will move to any unit on the map who request "repair" (only vehicles will request repair) also, the player can request a medic if there is a medic with a "support" waypoint on the map.

NOTE : AI units will request medic,repair, or refuel automatically if they need and there is a unit that is able to support them (WITHOUT the need of SUPPORT waypoints) and if the supporting units is a static (an unmanned ammo truck or a field hospital), then the unit requesting it will move to the supporting unit.

This post was edited by haroon1992 (2009-08-22 08:41, ago)


Author Message


Posts: 29
Rank:


Level: Member

Country: au
Location: Undisclosed (its a secret!)
Occupation: Super secret govt. spy man (shhhh)
Age: 27
In-game name:

 
#21 Posted at 2010-03-26 15:30        
     
I want to make an EXTREMELY simple para-drop, using either radio or the action menu

solution:

Step 1: In the editor, create an aircraft that can carry troops (eg. UH-60), give it a unique name (eg UH60_1) and give it a waypoint that passes through and past the drop zone

Step 2: In the editor, create as many units as you want to go in the vehicle (obviously limited by the capacity of the aircraft) and give each of them a unique name (eg. jumper1, jumper2, jumper3, ect....) in each of their init line put

this moveincargo UH60_1

Step 3: save the mission with a name (eg Parajump)

Step 4: open notepad and write

Jumper1 action ["eject", UH60_1];
~1
Jumper2 action ["eject", UH60_1];
~1
Jumper3 action ["eject", UH60_1];
~1
Jumper4 action ["eject", UH60_1];
~1
Jumper5 action ["eject", UH60_1];
~1
ect....

(the ~1 puts a 1 second gap between each troop's jump, so they don't tangle up and die. If you want a longer or shorter gap, make the number higher or lower respectively)

Step 5: Save the file as unique name (eg paradrop.sqs) (remember the ".sqs" ) to the mission folder (it should be in your Documents/Arma Other Profiles/Your name/missions directory)

Step 6: to make the paradrop start from a radio trigger, set the trigger as "radio alpha" then put this in the "activation" line of the the trigger

[] exec "paradrop.sqs"

Step 7: To make the paradrop start from using the action menu, make a "BLUFOR - Present" trigger before the drop zone on the vehicles flight path. In the "activation" line put

playername addAction ["Parajump", "parajump.sqs"]

with "playername" obviously being the unit that you want to be able to initiate the parajump

And there you go, it takes literally 2 minutes to setup and test. Hope it helped. If you have any questions, don't be afraid to reply or Personal Message me.

This post was edited by psychokillermonkey (2010-03-28 01:44, ago)


Author Message


Posts: 29
Rank:


Level: Member

Country: au
Location: Undisclosed (its a secret!)
Occupation: Super secret govt. spy man (shhhh)
Age: 27
In-game name:

 
#22 Posted at 2010-03-28 01:37        
     
How do i make exploding barrels?

Solution:

Step 1: Create a barrel in the editor

Step 2: Give the barrel a unique name (eg "barrel_1" )

Step 3: Create a trigger next to the barrel (for convenience) with this in the condition line

not alive barrel_1

then in the activation line put;

Bomb="SH_125_HE" createVehicle position barrel_1;

(this detonates a 125mm shell at the barrels location. You can change the shell type/size by changing the "SH_125_HE" to any other that you want. A list can be found here. You could even make a GBU12 explode from the barrel if you want!)

and your done! Now if you shoot or do anything that "kills" the barrel, a 125mm shell will explode from inside the barrel. The barrel will then burn for a while.