Jump to content

Recommended Posts

Posted (edited)

Hi,

 

2 questions:

 

is there a way to clear a flag by script in "Perform command - Run Script" option?

is there a way to use "IS USER" flag option with flags > 100 (es. Flag 3111)?

 

thanks in advance :)

Edited by chromium

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

Concerning the "IS USER" flag, maybe you could circumvent the Mission Editor by directly editing the "mission" file inside the "*.miz" one and see what it does ?

 

As for your first question, I couldn't find of any way not involving some other flag... I'm eager to get my hands on some reference about the lua-scripting abilities of the ME.

Posted

My objective is to create "advanced" templates (to be use with copy & paste instead the template format itself, cause I need to paste waypoints and triggered actions also) that are ready-to-go for standard triggered actions and behaviours... al without having to insert more than one trigger for group placed (and the trigger will be the SLmod options activations only).

 

The first problem is that I can use flags 1-to-100 only in the CONDITIONS and STOP CONDITIONS "IS USER" control. And I need to use 1-to-9999. Overcome the issue by manually editing the mission file is not suitable for this purpose, even if it's a good suggestion! ;).

 

The second one (that I figured out last night) is that I need to learn some trigger command in lua and I do not know where to find a reference file...

 

I figured out the "clear flag option" by lua searching in google, it seems to be something like trigger.clrflag(number-flag, true/false) (I do not remember exactly now :) )

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted (edited)

I figured out that to be helped I need you to understand my objectives.

 

OBJECTIVE: Create a ground units group that can be controlled entirely by 2 flags for “hold” and “group resume” action, without the use of the conventional trigger system. (in the examples the flags will be 115 for hold and 116 for resume).

 

The flag for “hold” and “resume” commands will be called by SLmod, which also is a script run inside the triggered actions of the group (by Perform command -> Run script option).

 

The actual situation needs me to create almost three triggers for every group in the trigger system:

 

ONCE/SW.CONDITION -> (various conditions) -> AI TASK (groupN-“SLmod_Commands”)

CONTINOUS CONDITION -> Flag on (115) -> AI TASK (groupN-“Hold”)+Flag off (115)

CONTINOUS CONDITION -> Flag on (116) -> GROUP RESUME (groupN) + Flag off (116)

(plus additional informative actions)

 

The first calls in the SLmod options in the options menu. The options will be “Group move” and “Group hold” or something similar. The “Group move” will set true the flag 116 and the “Group hold” will set true the flag 115 every time that they are called. And this work like a charm, it’s also possible to use switched condition and something else… but it’s not the subject now.

 

The idea is to keep only the first trigger, while creating all the other commands inside the group.

Skip the obvius issue that I will need to set 2 different flags for every group, I already overcome that :).

 

Now, this is already possible and working for flights because I can use waypoint advanced actions to “call in” the hold task: I’m only limited to use the 1-100 flags interval due to the STOP CONDITIONS “IS USER” limitation (while I want and need to use the 1-9999 flags interval). For ground units it’s a bit different, cause I need to hold the group everytime I want and in every position of their path, that means that I will need to call an “hold” in triggered actions instead that in waypoint advanced actions. The main difference is that while ad advanced actions is automatically executed in order when the groups reach that waypoint, the triggered actions could be called only by the trigger system… or not?

 

Now the preliminary idea is:

 

1. I create a single trigger for every group that calls the “AI TASK” Slmod script when the group have to be used (The SLmod script contain 2 command that set true 2 different flags, one for saying to the group to resume and one for saying the group to hold.. as said above)

2.I will set an Hold triggered task. The task has to be called when flag 115 became true (*), and the stop condition will become true when flags 116 became true.

3. Also I will have two scripts of “trigger.” functions in lua that clear the flags, and they will have to became true also when the flag itself became true (they will emulate the clear flag actions).

 

To obtain this the only thing I need are:

 

-a script to be run at the group activation that could check every seconds if a flag is true (115 in the example), and then execute a particular triggered action (es. The action at the index number “5”).

-the ability to use the 1-9999 flags interval in the “IS USER” STOP CONDITIONS options for the Hold command.

 

The question is… is there a way to obtain those?

Edited by chromium

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

Thread title modified :)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

you need to add this fuction in the script ->

 

trigger.setUserFlag(<flag_Number>,[true,false])

Simulatori: DCS A-10C II Warthog - DCS F/A-18C Hornet - DCS F-16C - VRS F/A-18E - 
HOTAS: TM Warthog - Cougar \ HP Reverb G2 \ WinWing Panels

Tally: I see the degenerate commie who wants to ruin our day.

 

Posted
you need to add this fuction in the script ->

 

trigger.setUserFlag(<flag_Number>,[true,false])

 

ok, but this will set true or false a particoular flag, do not activate a triggered actions... or I misunderstood something?

 

What I need (see fourth post) is that when a flag is set true, it will activate a defined triggered action :)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

do you need to set this in the ME -> ACTION -> AI TASK -> Triggered Action

 

For example: AI ACTION: -> "group_name" / 1. Run Script "script_name"

 

But this action is already editable in the ME, then you can simply add a trigger inside the mission editor on triggers list.

Simulatori: DCS A-10C II Warthog - DCS F/A-18C Hornet - DCS F-16C - VRS F/A-18E - 
HOTAS: TM Warthog - Cougar \ HP Reverb G2 \ WinWing Panels

Tally: I see the degenerate commie who wants to ruin our day.

 

Posted

ok there are two possibilities:

 

1. you do not read the kilometric post :D

2. I do not wrote clearly that post :p

 

I want to do that whitout using triggers, to create groups that will be duplicated entirely between misssio files simply by copy & paste (that works, already tried ;) )

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted
do you need to set this in the ME -> ACTION -> AI TASK -> Triggered Action

 

For example: AI ACTION: -> "group_name" / 1. Run Script "script_name"

 

ok ok ok wait, I tried to understand this one but maybe I do not...

 

this seems to be (for me) the way in with you create the action... and that's ok, but I'm looking for a way to activate it whitout use of the trigger logic.

 

Is there something that I do not see :cry: ?

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

try this. But I don't know if this can functional

 

--scheduleDoString(string LuaCode, Time delay, Time period)

--Time in sec

 

unitScript = 'unit_script_holder'

scriptId = 1

scriptCmd = 'net.dostring_in(\'mission\', \'a_ai_task(' .. unitScript .. ', ' .. tostring(scriptId) .. ')\')'

scheduleDoString(scriptCmd, 1, 10)

Simulatori: DCS A-10C II Warthog - DCS F/A-18C Hornet - DCS F-16C - VRS F/A-18E - 
HOTAS: TM Warthog - Cougar \ HP Reverb G2 \ WinWing Panels

Tally: I see the degenerate commie who wants to ruin our day.

 

Posted

ok I will first try to understand what you wrote and then I will try it :D

 

thanks a lot :)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

ok I do not understand how to use your script... :(

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted
try this. But I don't know if this can functional

 

--scheduleDoString(string LuaCode, Time delay, Time period)

--Time in sec

 

unitScript = 'unit_script_holder'

scriptId = 1

scriptCmd = 'net.dostring_in(\'mission\', \'a_ai_task(' .. unitScript .. ', ' .. tostring(scriptId) .. ')\')'

scheduleDoString(scriptCmd, 1, 10)

 

Yea... that's not going to work... for a couple of reasons...

 

I'm trying to get it straight in my head what you want to do this for, chromium. You're trying to do this to save yourself the trouble of creating a bunch of triggers to call group stop and group resume?

 

I do think you're out of luck with any flags higher than 100 for IS USER. However, there is an alternate method I think. If you need more than 100 start/stop conditions, examine the entry on "CONDITION(LUA EXPRESSION)" in the GUI manual. According to the GUI manual, I believe the way it works (it has been a very long time since I messed around with Lua start/stop conditions myself... which reminds me, I should probably test them out!) is that you create a chunk of Lua code whose last statement is "return <some value>". If that value evaluates as true, then the this start/stop condition is true. (false and nil evaluate as false in Lua, everything else evaluates as true.)

 

So, in theory, you could do something like this: create a global table variable named "stop_condition" or something like that with a triggered action:

stop_condition = {}

 

In the "CONDITION(LUA EXPRESSION)" box for the AI action you want to control, you would put something like:

return stop_condition['group1']

 

So now, when you want this "CONDITION(LUA EXPRESSION)" to evaluate as true, and in this example, stop the AI action, you can run this script using a triggered action:

stop_condition['group1'] = true

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Posted
I'm trying to get it straight in my head what you want to do this for, chromium. You're trying to do this to save yourself the trouble of creating a bunch of triggers to call group stop and group resume?

 

(blue: work ongoing. Red: stuck on it. Green: already tested and working)

 

I want to create a large set of groups (200+ for coalition) of "templates", to be read as complete order of battle, everyone with 5 dedicated "flag" whithin the 1-9999 flag interval and pre-attached commands inside the group (not in mission build-in trigger system) that must work when one of the flag come true, whitout adding a trigger line to run the AI task, including function to reset this flag immediately (already found). What I need is that when I copy and paste a group from the template mission to the "new mission" I only need to create one single trigger in the trigger system that call-in the SLmod POS option when the group is activated.

 

I want to be able to re-set (or create) a long-run scenery set (3+ days) with more than 100 groups lined up (AI off) starting from a empty mission in less than 30 hours of work, and I want them to be easy repositioned, whitout the need to re-define timers or triggers, so that the only triggers to be added to the trigger system will be the "scenary logic" (if exist, like active/holding scenery rotation hours, or like maximum groups "AI On" in a single session, etc) and/or mission specific triggers.

 

So, those "templates" (they won't be templates cause of when you save a template the editor do not save waypoints & actions, but when you copy & paste a group it does!) of groups will be easily controllable simply by SLmod POS command (or similar control) as you copy them in a new mission, and the only thing you will need to do is to add one single trigger per group to call-in the POS options.

 

My actual scenery beta need tons of triggers only to tell the ground groups (about 130, more or less) to:

-move;

-hold;

-do a specific triggered actions (only one, like "fire at point");

-turn AI on

 

If I copy one group elsewhere in another mission, I will keep al the SLmod script, all the actions, all the waypoint actions (repositionable), etc... but I still need to add 3-4 triggers per group in the trigger logic, that is about 60% of total time... and also could lead to errors having to check hundreds of flags every time :).

 

Believe me, I'm thinking about learning something of lua programming to try to stop pissing you all :D... but I do not have much free time :(.

 

PS: that is also why I wrote you about the possibility to add an "execute AI triggered actions" option instead of an "turn flag on" in the SLmod POS system :D ... a crack like that could definely free the group from dedicated flags and could lead also to a single group template to be added freely regardless of the flags used :).

 

So, in theory, you could do something like this: create a global table variable named "stop_condition" or something like that with a triggered action:

 

Code:

stop_condition = {}

 

Where I have to put this? in a run-script triggerd action? ... that's ok: this could let me use a stop condition whitout the 1-100 limit :). I'll test that in those days!

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

@Speed:

 

your way work, I may be free of flag use for stop condition.

 

But I needed three trigger:

one for run the first script to set the table;

another one for AI task "hold"

a third for script "remove hold".

 

If there is a lua script able of commanding the execution of a particoular triggered action, I could solve this :).

 

I messed around a lot in the mission.lua file, finding those two "commands":

 

a_group_resume(\"group name\")

a_ai_task(\"group name\", 1)

 

but I do not know how to use them in a script.... :(

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

ok thanks to your code now I can stop and move units regardless of the 1-100 flag limit. Only for optimization, is there a way to set the variable "group1" (that must be group-specific) to be something that in lua means "self", so that I do not need to specify a group name (or identifier) for every script of every group?

 

something like:

 

return stop_condition[self]

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

Can someone drive me where I can find a list of AI actions?

 

(es. "a_group_resume" )

 

:)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

  • 3 weeks later...
Posted
Hey Chrom, i know it's an old thread but check this file:

 

MissionEditor\modules\me_trigrules.lua

 

 

I'll check that ASAP!

 

Thanks!

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...