Home   Help Search Login Register  

Author Topic: Objective Trigger Question  (Read 3033 times)

0 Members and 1 Guest are viewing this topic.

Offline Dj Tano

  • Members
  • *
Objective Trigger Question
« on: 12 Mar 2007, 21:37:51 »
Hey guys,

i wanted to ask a few questions about scripting that i have:

I want to have a trigger that when i destroy a target i get a message and a new objective (get back to base).

Then i want to have a line wich if crossed, will trigger an HQ message telling you about a new objective, wich would come before the back to base one.

When this line is crossed you dont only get a  message, but also new soldiers spawn at a certain position.

Then i want to have a trigger wich when the area is secured (clear of enemies), i get the message to go back to my 2nd objective (get back to base).

How can i do that?
« Last Edit: 14 Mar 2007, 17:09:18 by Dj Tano »

Offline Walker

  • Members
  • *
Re: Scripting Question
« Reply #1 on: 12 Mar 2007, 22:20:40 »
This is simply done by using some triggers.

Make a trigger for the first objective,
condition:  !(alive targetname)
on activation: hint "Target destroyed, return to base"; "1" objStatus "Done"; obj1 = true

Second trigger, placed over the road.
activated by opfor
present
condition:this and obj1
on activation: titleText ["HQ: some messege", "BOTTOM"]; "wantedSoldierType" createvehicle wantedPosition"

Make third trigger covering the area to be secured
activated by opfor
not present
condition:this
on activation: hint "Area is secured! Reutrn to base"; "3" objStatus "Done";

Now it should work. If there are commands you do not understand how they ar used, check them up in the command reference.
http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA


Offline Dj Tano

  • Members
  • *
Re: Scripting Question
« Reply #2 on: 13 Mar 2007, 21:05:12 »
thx a lot man,

but im having a problem with that it doesnt show the HQ message, and i cant get stuff to spawn, could you please describe it further for me?

Offline Brandon

  • Members
  • *
Re: Scripting Question
« Reply #3 on: 14 Mar 2007, 16:48:47 »
*Sigh*  :thumbsdown:

Quote
2. Please think of the future searchers. When they think about asking what the unit limit's are on ArmA.. They may do a search for "Unit Cap Size" and not find anything because your thread title was very indescriptive. As I suggestion I recommend changing the thread name to something a little more "to the point". :p

Offline Dj Tano

  • Members
  • *
Re: Scripting Question
« Reply #4 on: 14 Mar 2007, 17:06:59 »
give me a good example of what i should change the thread name into then...

*edit*

i noticed in these forums that people tend more to talk around instead of just giving help...
« Last Edit: 14 Mar 2007, 17:38:54 by Dj Tano »

Offline Cheetah

  • Former Staff
  • ****
Re: Objective Trigger Question
« Reply #5 on: 14 Mar 2007, 17:53:14 »
Well, it's good to have descriptive topic titles in the board, so that's why we talk about that stuff. This helps scanning the topic titles for topics in which you can help. I for example, don't find myself replying in many MP question topics.

Anyway, now to the indeed more useful part of the post:
To spawn a soldier, look up it's class name here and type this instead of what walker told you.
soldier = "SoldierWB" createVehicle getPos trigger1

Here, trigger1 is a trigger with this name placed somewhere on the map (you can also use: markers (getMarkerPos instead of getPos), game logics, other units, invisible H or plain coordinates in the format: [0,0,0] (that is: x-y-z) ).

I suggest that you generate the HQ message with the following:
[West, "HQ"] sidechat "Well done chap, get yourself a beer at base.";

Everything clear and working?
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re: Objective Trigger Question
« Reply #6 on: 14 Mar 2007, 18:31:20 »
It is OFPEC policy that topic titles should be as descriptive as possible.      You can't and shouldn't try to explain the whole problem, just give a clue as to the area in which it lies.    Titles like "scripting question" should be avoided.   ;) 

The most important thing of course is the question itself, and the answer,   but a good title creates a better response rate because it encourages people to read the thread.
Plenty of reviewed ArmA missions for you to play

Offline Dj Tano

  • Members
  • *
Re: Objective Trigger Question
« Reply #7 on: 15 Mar 2007, 09:51:48 »
Hey dude, thx for the info, but it works, and at the same time kinda doesnt...

When i spawn a soldier, he seems to have no ai at all. I ran infront of him as an enemy, shot at him, and no reactions whatsoever.

Also when i write the HQ message it says Crossroads instead of HQ, wtf?

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Objective Trigger Question
« Reply #8 on: 15 Mar 2007, 11:06:09 »
createVehicle creates an empty shell of a AI agent.

Try using createUnit instead..
It creates a 'person' so it should do the trick..

Quote
Also when i write the HQ message it says Crossroads instead of HQ
That is because by default the HQ is called Crossroads in ArmA.

There was a tutorial on how to make custom callsigns for OFP at our ED but it doesn't seem to be there anymore (due to the last Great Crash) :(

However, IIRC it might have been done like this:
  • Create an empty text file (in your mission folder) and rename it to stringtable.csv
  • Open it with Wordpad or Notepad, not with Excell if you have it..
  • Enter the following in it
Code: [Select]
LANGUAGE,English,Comment,

STR_CFG_PAPABEAR, "My HQ name yay"
  • save the file
Should work. No guarantees though..
(Funnily enough the HQ is still called PAPABEAR in ArmA stringtables..)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Dj Tano

  • Members
  • *
Re: Objective Trigger Question
« Reply #9 on: 15 Mar 2007, 20:18:43 »
hey dude,

i tryed both the createUnit thing aswell as the HQ renaming and both didnt work...

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Objective Trigger Question
« Reply #10 on: 15 Mar 2007, 21:15:34 »
Tried createUnit myself and it works fine.
Tried the stringtable thing and it works fine.

You could always elaborate on how exactly they did not work instead of just saying 'did not work'..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Dj Tano

  • Members
  • *
Re: Objective Trigger Question
« Reply #11 on: 15 Mar 2007, 21:35:17 »
When i did the createUnit it said i missed a number(?)

When i tried the stringtable, i put it in my mission folder, is tht right?

*edit* ok, the HQ thing works! :D
« Last Edit: 15 Mar 2007, 21:52:57 by Dj Tano »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Objective Trigger Question
« Reply #12 on: 15 Mar 2007, 22:58:13 »
Quote
When i did the createUnit it said i missed a number(?)
Ok, so that probably means you just used it the wrong way..

The easiest way is to just copy/paste the example from the COMREF and the edit it to fit your needs..
If you use the example straight out it will create one unit into the player's group..

For multiple units you need to loop the createUnit, and if you need to create them into some other group than the player you need to have a soldier present on the map 'in' who you create the units..

Let's name that unit guy..

sqs
Code: [Select]
_i=1;

#loop
_unit = group guy createUnit ["SoldierWB", position guy, [], 0, "FORM"];
_i = _i + 1;
~0.5
? _i<=8: goto "loop"
That creates 7 soldiers into the group of guy and the guy is the group leader..

or if you prefer sqf
Code: [Select]
_i=1;
while {_i<=8}
 do {
_unit = group guy createUnit ["SoldierWB", position guy, [], 0, "FORM"];
_i = _i + 1;
sleep 0.5;
    };
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Cheetah

  • Former Staff
  • ****
Re: Objective Trigger Question
« Reply #13 on: 15 Mar 2007, 23:06:16 »
Made a very small demo mission, the trigger is the key.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!