SP scripting a explosive flak gun as a mission objective


(demonspawn) #1

I just found out about you guys, its great to have another forum to bounce questions and ideas to and congrats on your success.

I’m in the final stages of getting my map to its alpha stage but i’m stuck on a few things.

I have 2 exploding flak guns that I would like to make mission objectives (objectivesneeded) in my SP adventure.
I have modelled the guns and have them exploding already but I havn’t been able to figure out how to script it to become an “objectivemet”.
I know I have to associate the flak entity to the “AI script” with a trigger command but how.
Do I need to target the entity to a “script script” and then trigger that in the “AI script” or am I making it too complex?

I have other questions but one at a time.
Thanks in advance

Map on


(sock) #2

Ummm, I’m not quiet sure what you mean thou with “mission objectives”. Do you mean that the player HAS to destroy the guns to progress on in the map or end it ?

SP does not really support “mission objectives” like MP so you will have to create it via the map and the script. Like for example the player cannot progress beyond a door or enter a certain building until the guns r destroyed. You would set it up so that, when the guns r destroyed it would trigger the door or access to the building.

Sock

3D Brush Monkey
http://www.splashdamage.com/

EDIT: typo’s

<font size=-1>[ This Message was edited by: sock on 2002-06-24 11:36 ]</font>


(demonspawn) #3

Yes, the guns must be destroyed in order to complete the map.
This is what I have
The “objectivesneeded” command is in player portion the AI script,
as well as
trigger gun_explode_1
{
trigger player obj1
}
and the
trigger endmap
{
trigger endnow
missionsuccess mission_evileye
changelevel evileye2 persistent
}

What i’m looking to have happen is the player MUST destroy 2 flak guns in order to trigger a successful “end map”.
What isn’t happening is
When I blow-up the guns there should be an “objective met” statement printed across the bottom of the screen (I think) and when I get to the “end map” trigger volume the objectives should read 2/2, it doesn’t it reads “objectives 0/2” and won’t end the map.

In my test map I used a “AI trigger” volume to activate the objectives (walk through the volume and the trigger statement activates) but I need it to activate when the guns are destroyed.
Do I need to “target” the flak gun entity to a script?
Sorry for the long winded post, but I hope you can help

Thanks in advance
Map on


(sock) #4

Ok from the top …

Excuse me if I go over the same ground as you may already know, but I’m not sure what state your map/script is in.

Btw, I use the word “AIentity” to mean a starting point in the AI script and a “function” as an action defined in a AIentity like spawn, trigger, death.

First you need to set a <map name>.AI file which controls the SP game and objectives. Usually the first section of the AI script is the “player” AIentity which controls the player in game and all other functions associated with the player in game.

Usually at the top of the script you setup how many objectives you have with the “objectivesneeded” script command. This is always done underneath the “player” AIentity.

Then you setup all the trigger functions below like for example “obj1_completed”, “obj2_completed” etc. These functions control the script actions to take once the requirments have been met in the map.

Then in your map you need to setup the ai_trigger’s which have the following keys. “ainame” which points to the AIentity name eg. “player” and a “target” field which points to the above function “obj1_completed”. This is done alot in RTCW where key fields are not labeled correctly and are used differently when connected to scripts. Target is usually used for connecting entities within a map file not entities to scripts.

Finally in your “obj1_completed” function you use the script command “objectivemet” followed by the objective completed. This is NOT an accumlator field but points to the exact objective completed. Plus once the objective is set it cannot be unset.

Hope that helps

Sock
3D Brush Monkey

EDIT: Damn typos :razz:

<font size=-1>[ This Message was edited by: sock on 2002-06-24 19:18 ]</font>


(demonspawn) #5

Great, thanks Sock
I’ll chew this over and get back to you if I get stuck.

Map on