Jump to content
Sign in to follow this  
keimosabe

Help with a couple of things

Recommended Posts

I'm working on a mission and I'm trying to wrap my head around a couple of things that I cannot seem to get. I'm trying to make a mission to go blow up a couple of things and to kill a guy.

From what I can tell I have to create a gamelogic object then attach a trigger to it using the !alive condition and that is what I'm having trouble with getting the syntax correct. I created the object and gave it a name then tried to associate a trigger to see if it was blown up or not using the !alive condition and in testing, I can blow it up, but never get the cue that it was done.

Can one of you gurus PLEASE give me the gamelogic object and trigger explanation that I need for blowing up a bridge or a house and then the same for killing an Opfor guy.

In using the wiki, I have found a huge listing of the commands but is there a detailed explanation of the correct syntax for them as well?

Thanks for th ehelp in advance guys.

Share this post


Link to post
Share on other sites

Your explanation of the problem was not very clear to me, but I assume that you need to check whether the objectives were destroyed or not.

For the OPFOR guy, it's pretty simple;

Give a name to your guy, for example: opforguy.

Then in the trigger condition line enter:

!alive opforguy

The trigger will activate when the opfor guy is dead, the statements in the "on activation" field will be executed. (!alive means "not alive").

For static objects, it's pretty similar, but first you need to retrieve the static object into a variable. You can use the nearestObject command.

http://community.bistudio.com/wiki/nearestObject

So, in order to fetch a static object into a variable, we must first find out it's ID. In the editor, switch on IDs (one of the buttons on the right) and find the ID of your static object.

Then place a gamelogic near the static object (we only need it to refer to the approximate position of the static object, since the nearestObject command finds objects within 50m radius, make sure the distance between the logic and the static object is below 50m). Give the gamelogic a name - for example: GL.

Then we need to run the following code:

staticObj = (getpos GL) nearestObject IDfromEditor;

Now the staticObj variable will refer to the static object. I'm not sure if the alive command works on static objects, so in the trigger condition line you might want to use:

(getDammage staticObj) > 0.999

Hope this helps.

Share this post


Link to post
Share on other sites

Now the staticObj variable will refer to the static object. I'm not sure if the alive command works on static objects

It does work but not sure if it works on all objects though!

Share this post


Link to post
Share on other sites

gotcha thanks guys, that helps a lot. I was missing out on the object's ID.

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  

×