Jump to content
Sign in to follow this  
Toasticuss

Can I trigger a game logic?

Recommended Posts

I am using DTMs convoy manager and I have it working fine, the thing I would like to do is be able to activate it via a trigger.

Its called by a game logic.

I've tried making a trigger thats called in by a radio with condition

this

activation is

convoy0 = true;

convoy0 being the game logics name, but this hasn't worked.

Any ideas?

Edited by Toasticuss

Share this post


Link to post
Share on other sites
convoy0 = true;

Here you are just telling that convoy0 is equal to true.

What you can do is create a waitUntil statement in the script that wait for the convoy0 to became true.

Put the following on the start of the convoy script

waitUntil { convoy0 };

Then you can use the Radio trigger to make it true.

And the code that is after the waituntil command will only execute when convoy0 is equal to true.

_neo_

Share this post


Link to post
Share on other sites
Here you are just telling that convoy0 is equal to true.

What you can do is create a waitUntil statement in the script that wait for the convoy0 to became true.

Put the following on the start of the convoy script

Then you can use the Radio trigger to make it true.

And the code that is after the waituntil command will only execute when convoy0 is equal to true.

_neo_

Alright so when the game loads the mission it already assumes the game logic is true, and when the radio trigger fires off it just tells it, it's true again? I think I get that.

Ill try it out. Thank you.

Share this post


Link to post
Share on other sites
Alright so when the game loads the mission it already assumes the game logic is true, and when the radio trigger fires off it just tells it, it's true again? I think I get that.

Ill try it out. Thank you.

No, on the mission begin, the Game logic is Created.

This is what is making it equal true.

convoy0 = true;

_neo_

Share this post


Link to post
Share on other sites
No, on the mission begin, the Game logic is Created.

This is what is making it equal true.

convoy0 = true;

_neo_

But since the radio is triggering the trigger why isnt it becoming true when calling the radio since it is set to ON ACTIVATION of the trigger it will be come true.

Share this post


Link to post
Share on other sites
But since the radio is triggering the trigger why isnt it becoming true when calling the radio since it is set to ON ACTIVATION of the trigger it will be come true.

Yes, if you have that on the OnAct it will became true.

=P

_neo_

Share this post


Link to post
Share on other sites
Yes, if you have that on the OnAct it will became true.

=P

_neo_

But I do like the original post shows, doesn't not work though.

Share this post


Link to post
Share on other sites

Can you show me how you are executing the convoy script?

_neo_

Share this post


Link to post
Share on other sites
Can you show me how you are executing the convoy script?

_neo_

In a game logic called logic

null= [this,WEST,["convoywp1","convoywp2","convoywp3"],false,0,7,["HMMWV_M2","MTVR","HMMWV_M2"],["veh1","veh2","veh3"],true,false]execvm "convoy.sqf";

Share this post


Link to post
Share on other sites

Ok so do the following.

In the gamelogic put the following:

nul = [] execVM "convoy_start.sqf";

Now create a file in your mission folder called convoy_start.sqf

convoy_start.sqf

waitUntil { convoy0 };

null= [NAMEOFGAMELOGIC,WEST,["convoywp1","convoywp2","convoywp3"],false,0,7,["HMMWV_M2","MTVR","HMMWV_M2"],["veh1","veh2","veh3"],true,false]execvm "convoy.sqf";

Then create a trigger:

Condition: t

this

OnAct:

convoy0 = true;

Have fun.

=P

_neo_

Edited by neokika

Share this post


Link to post
Share on other sites

I got a problem with this 0 = [position this, "Infantry", 100] execVM "crB_scripts\crB_taskPatrol.sqf";

I have game logic called "b"

So 0 = [position b, "Infantry", 100] execVM "crB_scripts\crB_taskPatrol.sqf"; --> It doesn't work

and I also tried 0 = [b, "Infantry", 100] execVM "crB_scripts\crB_taskPatrol.sqf"; ---It doesn't work

A little help would be appreciated. Any idea ?

Share this post


Link to post
Share on other sites

Maybe replace 0 = with _nil =, not sure if that script returns anything, but it certaintly wouldn't be 0. :)

Also try getPos b perhaps. Or name it something more useful, like patrolPointB.

_nil = [getPos patrolPointB, "Infantry", 100] execVM "crB_scripts\crB_taskPatrol.sqf";

Share this post


Link to post
Share on other sites

I just recently went through the same thing using that crb script from Wolfy. Since you're asking in this thread, I assume you're using a trigger to call that game logic... from an sqf?

Here's what my "crbsquad1_spawn.sqf" looks like, and it seems to work;

waitUntil { crbsquad1 }; 

0 = [position crbsquad1_logic, "Infantry", 100, ["BIS_TK_INS"]] execVM "crB_scripts\crB_taskPatrol.sqf";

which looks pretty much like your 1st example. So maybe the problem is with your trigger or something else?

If you wish, feel free to look at/use this spawntest mission folder I have, where I was figuring out how to spawn UPSMON squads and crb squads by trigger (up till now I've been loading whole map up with enemies right from start of mission. now I"m calling them as I need them.) I'm no expert, but this seems to be working. Select the player at bottom of list in lobby, and you'll spawn in the area where spawn testing setup is at.

https://sites.google.com/site/rflaggtoc/wip-missions/Spawn20Test.Takistan.7z?attredirects=0&d=1

Share this post


Link to post
Share on other sites

Thanks for your help, your mission was helpfull. Now it's working.

Missing group the unit to the trigger.

:))

Share this post


Link to post
Share on other sites

In fact, it's not working really good.

When you group your unit with only one trigger it works but more than one trigger it's not working at all or by half. (I don't get error message, sorry I've forgotten to give you an answer).

Anyway it was curiosity but the idea to activate crB_scripts and upsmon via a logic is very interresting to create aleatory missons. Unfortunatlly I am not good enough in scripting to create a working script for this. :)

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  

×