Jump to content

Recommended Posts

Posted

Hi to all,

 

this is a clear help request, cause I’m not able to autonomously script something… I tried some times, without any good results.

 

Now that is possible to call self function on ground groups (by SE and MIST), I see the possibility to create some sort of scenery conditioned behavior over the groups. I can use MIST flag function and few general simple scripting functions also to create “behaviours” that I need to improve AI.. . but I can’t create a scripts that do the following work:

 

 

Script 1: (the most important)

Iterate the group names every seconds to check if one of a set* of four letter tag is present in the name (es. For tag “RSAM” in the group “1MRB_2Batt_RSAM”).

 

For any group with the defined tag, if the flag “9999” have the value “1”, it activate the first triggered action in the group itself. If the flag “9999” have the value “2”, it activates the second triggered action in the group itself… and so on till value “5”. The function should be executed only once everytime that it is run by a common "SWITCHED COND" trigger.

 

* like a table of tags: if the table contains 4 tags, it will look for anyone.

 

Script 2:

At mission start iterate the group names every seconds to check if a four letter tag is present in the name (es. For tag “RSAM” in the group “1MRB_2Batt_RSAM”).

 

If present, it add 5 task to the triggered actions of the group:

 

the first one will set ROE to "RETURN FIRE" and ALARM STATE to "GREEN"

the second one will set ROE to "WEAPONS FREE" and ALARM STATE to "GREEN"

the third one set ROE to "WEAPONS FREE" and ALARM STATE to "RED"

the fourth one set AWARENESS LEVEL to "SAFE"

the fifth one set AWARENESS LEVEL to "DANGER"

 

I understand that it's a difficult and maybe exagerate request, but any help is appreciated :).

 

Thanks anyway if it's impossibile o no one have time to help :)

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

Script 1. Iterate through all groups just once and add each groupname to a new table that has all of the sams in it, which you will iterate through every few seconds.

 

Script 2: No need for triggers...

function scan(groupName)
local con = Group.getByName(groupName):getController()
con:setOption(0, 4) -- hold fire
con:setOption(9, 2) -- radar on
end

 

"Group awareness" is not functional yet, but I don't exactly know what it will do when it is. But the same basic script will work for the other combinations you might want to do.

 

 

You aren't the only person working on an IADS script. :)

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

The point is that I'm not working on a IADS script, cause I can't script... I'm asking if there is someone that can make those script :).

 

The idea is not to use that structure for IADS only, even if it will be clearly the first attempt. The 5-state "9999" flag could be sobstituted by another one, and the 5 triggered actions added to any labeled group at mission start could be modified to obtain another behaviour (ie. for arty fire support). But the point is that I need some "simple" or at least "readable" structure to understand how to customize that script, given that I don't know anything about programming and even if I read Lua Programming ed2 till chapter 6 (or 7, don't remember) I onestly don't understand that much. I can recognize that it is not my area of knowledge :(.

 

I looked at your iterator in the mission said above, but onestly I didn't even archieved to copy and paste it in another file. I don't understand what it is necessary to be included... that is why after some weeks (months) I tried asking directly here.

 

It's bad to have too many workable ideas for a scenery and can't realize it cause of lack of necessary programming knowledge and/or time for learning it properly :(.

 

 

OK, coming back IT, thanks for the scripts that you wrote here, but honestly I don't understand much how I can use it: where I should use it? :(.

 

I mean... if I run it in a group triggered actions, will it work as it is? :)

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...