Jump to content
Sign in to follow this  
heinzmcdurgen

Condition of Presence: alive [unit]

Recommended Posts

So, in the 2d editor, you used to be able to tell something to spawn if something else existed. As the topic says I'd typically do this via the "Condition of Presence" field. For example; If I have a MP mission, where there are 3 tanks, and the objective is to get all the tanks across the bridge, if only enough crew spawn for 2 tanks, I have no need for the third, and the 2 other tanks can't complete the objective. So I would name the tank commanders, and then place: "alive [tank commander name]" in the CoP field. This way only the tanks with commanders would spawn.

For whatever reason, it seems this functionality, or at least my implementation of it no longer works in Eden. Does anyone know of a work around that isn't a wall of scripting? That's not my strong suite, and if I could stick with in editor solutions that'd be best. Thank you for your time.

Share this post


Link to post
Share on other sites

In the condition of pres field try:

!(isNil "yourtankname")

 

That returns true if the tank by the name of yourtankname exists (is not nil).

 

The name you gave for the tank as string because that's how isNil wants it.

Share this post


Link to post
Share on other sites

Nah, that didn't work either.

I'm beginning to think it'll be easier to just make a script where the vics spawn if the commanders are there instead of trying to do it in editor. The frustrating part for me is feeling like there is no reason this functionality should have stopped working.

Share this post


Link to post
Share on other sites

Still working for me, the issue must be on your end.

Share this post


Link to post
Share on other sites

I didn't get that 'alive unitname' to work either, but that isnil thing works just fine.. :shrug:

Share this post


Link to post
Share on other sites

I didn't get that 'alive unitname' to work either, but that isnil thing works just fine.. :shrug:

 

That's with crewed tanks?  I think he wants to put down three fully crewed tanks but have each crewed tank only spawn if the commander is an active player?

 

Also Eden automatically names the crew, so if your tank is TANK1 your Driver will be TANK1D, your Gunner TANK1G and your Commander TANK1C.

Share this post


Link to post
Share on other sites

I was just checking syntax.
Wouldn't even know how to check if a player doesn't exist because I always exist, and if I didn't I couldn't check it anymore :P

I understand absolutely nothing about MP scripting so I guess !isNil "tankcommandername" could work then?
Or !isNull tankcommandername, no idea what the name in MP refers to (as in is it a variable or object)...

Share this post


Link to post
Share on other sites

I'd tested with isNull TANK1C or whatever and it ended up spawning just the commanders, no tank! :)

Share this post


Link to post
Share on other sites

Ok, so the name refers to a object. One more thing learned at my end :P

 

Hopefully the OP reports back, seems like solved problem to me :)

Share this post


Link to post
Share on other sites

Sorry for the delay!

Okay, I'll check the above and make an edit to this once I do, but I thought I'd clarify what I'm trying to do since it doesn't seem like I'm getting it across very well.

I'm creating a tank crew of three player "slots", and an empty tank. The tank should only spawn at mission start in multiplayer if the "commander" slot is taken in the role selection screen prior to the mission starting. Does that make sense?

In the 2d editor (now a thing of the past with Apex) in the empty tank's "condition presence" field you could put "alive [variable name of commander slot]" and the empty tank would only spawn at mission start if someone was in that slot because if no one was in it, that variable wasn't "alive" and being used. When I try the same thing now, the empty tank doesn't appear at all despite the commander slot being filled and therefor the variable being "alive".

Share this post


Link to post
Share on other sites

Okay, after testing, it has still yet to work. I have 3 playable units, with the commander named: AV1

I have my tank, and I've tried -

alive AV1
!(isNil "AV1")
!(isNil AV1)
!isNil "AV1"
!isNil AV1
!isNull AV1

and none of them work, in the preview or on a server.  :( 
 

Share this post


Link to post
Share on other sites

Go back to Arma 2 and test there.

If it works there it will work in Arma 3

.

Share this post


Link to post
Share on other sites

Go back to Arma 2 and test there.

If it works there it will work in Arma 3

.

I can't say this is very useful advice. As I stated in the initial post; It works in A3's 2d editor, but as I mentioned, does not work now with Eden. Furthermore, there have been syntax things that have changed between Arma 2 and Arma 3, so your logic doesn't work 100%.

If you're not going to try and help solve the problem, I'd kindly ask you to keep yourself from posting.

Share this post


Link to post
Share on other sites

It's actually a bit weird, !isNull AV1 works for AI soldiers, as in if you have one soldier named AV1 and others with presence !isNull AV1 they will not appear when AV1 doesn't and will appear if AV1 does.

 

But it doesn't work for vehicles, as in I have a AI soldier named AV1, an empty tank (or manned, doesn't matter) with presence !isNull AV1 and the tank will never appear regardless of AV1 appearing or not.. :shrug:

Are we doing something fundamentally wrong here? :shrug:

 

 

Putting this in your tanks init might work, dunno how MP friendly this is though (deletes tank if AV1 is nil):

_void = this spawn {if (isNil "AV1") then {deleteVehicle _this}}

Share this post


Link to post
Share on other sites

My initial test shows that this works. Now I'm going to try assigning some objectives to that vic and see if they remain or what happens. Thanks for the effort!

Edit: So while this method does work, it doesn't play well with the mission framework we use for objectives. Basically even after deleting the vehicle, it still counts against the objective points. :(

Share this post


Link to post
Share on other sites

Without knowing how your mission framework works none of us can really help..

Although, guessing how it might work: introducing a delay before the framework kicks i,n in lieu of tagging the tank to be deleted with some public variable and the framework disregarding said public variabled tank(s), or something to that nature.

 

 

Or, BIS fixing the issue at their end...

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  

×