Jump to content

New Trigger "Run Script" [v1.2.0]


STP Dragon

Recommended Posts

Hi guys,

 

how powerful is this trigger? What can I do with it?

Is it replacing Speed's SLmod?

 

Are there some examples? I'm a perfect script-noob.

 

Can I e.g. display a GPS coordinate of a specific ground unit into a triggered message?

Link to comment
Share on other sites

Its replaces the need to put scripts in the triggered actions of a unit and then using a trigger for "AI Task> Run Script". It simply removes the need for a unit to be there.

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

Link to comment
Share on other sites

Currently SLMod and other relevant scripts like some of the randomization stuff Druid has made.

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

Link to comment
Share on other sites

No, the new run script does not replace Slmod, but one thing it does is makes a "scriptman" unit no longer necessary.

 

Sorry, but I can't really tell you any more at this time.

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.

Link to comment
Share on other sites

Umh, this trigger have the advantage to "run" the script whithout using an AI action...

 

SLmod add script capabilities AFAIK, this action add a less "invisible" way to get any script started :).

 

But keeping script in a units (or more) have a big advantage: you can copy and paste them between missions, if you use the same group name structure every time.

 

I have to say that a really interesting wish could be the ability to save waypoints, adv waypoints actions and triggered actions in templates :)... but it's OT :p

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.

Link to comment
Share on other sites

Guys, please can anybody give me a script example for this trigger and explain what it does?

I have still no idea what to do with it...

 

Is there a list of functions somewhere?

I even don't know what script language is needed? lua?

Link to comment
Share on other sites

Indeed. SLmod is where most of the use comes from. This is an example of code from On Station. If the server uses SLMod it will look for the words in single quotes in the player chat box. If it detects someone typed in "getupdate" then SLmod will set flag 38 to true which does a bunch of silly stuff within the mission that breaks half the time. This is code specific to SLMod.

 

slmod.chat_cmd('getupdate', 38, -1, 'all')

slmod.chat_cmd('spawntask', 9951, -1, 'all')

slmod.chat_cmd('easybutton', 8962, -1, 'all')

slmod.chat_cmd('normalbutton', 8961, -1, 'all')

slmod.chat_cmd('hardbutton', 8964, -1, 'all')

slmod.chat_cmd('realismmode', 8994, -1, 'all')


slmod.chat_cmd('normalmode', 9991, -1, 'all')

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

Link to comment
Share on other sites

Guys, I know SLmod is awesome but I only want a little script-example for the trigger. Without SLmod!

 

I don't know what I can do with the trigger. I even have no idea what I want to do with it because the normal triggers provides enough functions for me.

The only thing I'm missing is the radio items function in the MP.

Maybe there is a script for adding radio items to clients with this script-trigger?

Link to comment
Share on other sites

i found this in the WIKI:

 

http://en.wiki.eagle.ru/wiki/Drafts/Simulator_Scripting_Engine_%281.2.0%29/Part_1 (here i found script lines für "Radio Command Panel")

http://en.wiki.eagle.ru/wiki/Drafts/Simulator_Scripting_Engine_%281.2.0%29/Part_2

 

and http://en.wiki.eagle.ru/wiki/Drafts/Simulator_Scripting_Engine

 

I have only flew over it, up to now. A sample "Hello World" script would be nice.

[sIGPIC][/sIGPIC]

360th TFW Falconeers

last video ->

 

ASUS P6X58D Premium, Intel Core i7 920, 6GB DDR3, SAPPHIRE TOXIC HD 5850, Win7 64 Bit. X52, Track IR 4, Momo Racing.

ArmA1+2+3, DCS: World, K-50, A-10C, CA, P-51D, UH-1H, Mi-8FC1+2+3, FalconAF, FC1+FC2, IL2'46, rFactor.

Link to comment
Share on other sites

ONCE -> whateverCondition -> run script
trigger.action.outText('Hello World')

 

the whole point of script is to use a much more powerful programming language to construct/enable events in the mission that you couldn't do in the GUI. So providing simple examples are fine but its the complicated ones that you will want to use. That being said its possible that simple functions will become available in script that aren't in the GUI. The wiki is a work in progress and will be updated as more functions become available.

 

An example of some testing code I did to instruct the tanker who was flying between waypoints to orbit in his present position. I used a flag set to 1 in the F10 menu to do so (e.g. "Texaco orbit in your present position").

 

 

-- Orbit in present position and altitude, speed 250 kts
local orbitPos = Unit.getByName('Tanker1'):getPosition().p
local circleOrbit = { 
id = 'Orbit', 
params = { 
pattern = 'Circle', 
x = orbitPos.x, 
y = orbitPos.z, 
speed = 128.000,      -- in m/sec
altitude = orbitPos.y
}
}

local combo = {
id = 'ComboTask',
params = {
tasks = {
[1] = circleOrbit
}
}
}
Unit.getByName('Tanker1'):getController():setTask(combo)

 

Another possibility is to change the 'Tanker1' (the name assigned in the ME) to the name assigned to the players aircraft (e.g. 'player'). He will then head over to your position and orbit at his current altitude.

 

 

An example of where script could be used is in the DCS P51D racing mission , where you can time the lap of each aircraft and output his time (stored in a string variable) to the screen along with his fastest lap so far.

i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q

Link to comment
Share on other sites

i found this in the WIKI:

 

http://en.wiki.eagle.ru/wiki/Drafts/Simulator_Scripting_Engine_%281.2.0%29/Part_1 (here i found script lines für "Radio Command Panel")

http://en.wiki.eagle.ru/wiki/Drafts/Simulator_Scripting_Engine_%281.2.0%29/Part_2

 

and http://en.wiki.eagle.ru/wiki/Drafts/Simulator_Scripting_Engine

 

I have only flew over it, up to now. A sample "Hello World" script would be nice.

 

Keep in mind that everything in there is a work in progress and subject to change. ED has not officially released this documentation yet. If it were possible to make that page access-protected, it would be.

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.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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