[MOOSE] RAT - Random Air Traffic - Page 26 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 10-19-2018, 10:38 AM   #251
doodenkoff
Member
 
Join Date: Oct 2015
Posts: 399
Default

You shouldn't have to delete the trigger and re-create it. If you edit a .lua file that is called as a "DO SCRIPT FILE" action, browse to the file and select it like you did when originally creating the trigger, then save the mission. It should work as expected now.


In a nutshell; go back and re-select the file called in the trigger if you make a change.
__________________
Win 10 | i7 4770 @ 3.5GHz | 32GB DDR3 | 6 GB GTX1060
doodenkoff is offline   Reply With Quote
Old 10-19-2018, 11:41 AM   #252
Cornelius
Junior Member
 
Cornelius's Avatar
 
Join Date: Apr 2018
Location: Germany
Posts: 58
Default

Quote:
Originally Posted by doodenkoff View Post
You shouldn't have to delete the trigger and re-create it. If you edit a .lua file that is called as a "DO SCRIPT FILE" action, browse to the file and select it like you did when originally creating the trigger, then save the mission. It should work as expected now.


In a nutshell; go back and re-select the file called in the trigger if you make a change.
Why solve it easy, if there's a complicated way
Wouldn't have guessed that would help, too. Is this documented or explained somewhere?
Cornelius is offline   Reply With Quote
Old 10-19-2018, 04:44 PM   #253
funkyfranky
Senior Member
 
funkyfranky's Avatar
 
Join Date: Sep 2015
Location: Asgård
Posts: 1,806
Default

Quote:
Originally Posted by Cornelius View Post
Is this documented or explained somewhere?
Maybe, but usually that's a DCS "feature" we all have to learn the hard way
__________________
Of all the things I've lost, I miss my mind the most. --- Mark Twain
i7-8700K | Asus GTX 1080 Ti Strix OC| 32 GB Ram 3200 MHz DDR-4| Win 10 64-bit | Asus Maximus Hero X | Samung EVO 960 Pro SSD | VKB Gunfighter Pro | MFG Crosswind | CV1
funkyfranky is online now   Reply With Quote
Old 10-19-2018, 08:13 PM   #254
Ragnar65
Member
 
Join Date: Oct 2017
Location: Germany
Posts: 330
Default

Guys,
i have tried the RAT script, did it as described, but the AI doesn´t spawn. I´ll enclose my files, maybe someone can have a look and find the issue... I´d really appreciate that. ;-)
Attached Files
File Type: miz MIG-29G Multirole Training.miz (2.99 MB, 2 views)
File Type: lua RAT_MIG-21.lua (53 Bytes, 2 views)
__________________
TM Cougar Stick, TWCS Throttle, TM TFRP Pedals
Modules: F-5E, FC3, F/A-18C
Ragnar65 is offline   Reply With Quote
Old 10-19-2018, 08:40 PM   #255
funkyfranky
Senior Member
 
funkyfranky's Avatar
 
Join Date: Sep 2015
Location: Asgård
Posts: 1,806
Default

Quote:
Originally Posted by Ragnar65 View Post
Guys,
i have tried the RAT script, did it as described, but the AI doesn´t spawn. I´ll enclose my files, maybe someone can have a look and find the issue... I´d really appreciate that. ;-)
Just had a quick glance at your code, Ragnar. But there is one problem in your script
Code:
local MIG-21=RAT:New ("RAT_MIG-21")
MIG-21:Spawn (2)
The hyphen (Bindestrich) is a "magic" character in scripting since it denotes a minus sign. So for the script you deduce 21 from MIG, which is not defined and causes an error. Also there is a space between "New " and the opening "(" and "Spawn " and "(". This is also not valid in scripting.

Try
Code:
local MIG21=RAT:New("RAT_MIG-21")
MIG21:Spawn(2)
__________________
Of all the things I've lost, I miss my mind the most. --- Mark Twain
i7-8700K | Asus GTX 1080 Ti Strix OC| 32 GB Ram 3200 MHz DDR-4| Win 10 64-bit | Asus Maximus Hero X | Samung EVO 960 Pro SSD | VKB Gunfighter Pro | MFG Crosswind | CV1
funkyfranky is online now   Reply With Quote
Old 10-19-2018, 09:10 PM   #256
Ragnar65
Member
 
Join Date: Oct 2017
Location: Germany
Posts: 330
Default

Thanx, funkyfranky, didn´t realize that the Bindestrich isn´t allowed in scripting... I´ll give that a try immediately.
__________________
TM Cougar Stick, TWCS Throttle, TM TFRP Pedals
Modules: F-5E, FC3, F/A-18C
Ragnar65 is offline   Reply With Quote
Old 10-19-2018, 09:41 PM   #257
Ragnar65
Member
 
Join Date: Oct 2017
Location: Germany
Posts: 330
Default

nope, doesn´t work... edited the file, buit the Mig21 doesn´t spawn... They are neither anywhere in the air nor on any runway... Could you please have a look at th mission? I reckon there´s some subtle issue anywhere...
Attached Files
File Type: miz MIG-29G Multirole Training.miz (3.15 MB, 2 views)
__________________
TM Cougar Stick, TWCS Throttle, TM TFRP Pedals
Modules: F-5E, FC3, F/A-18C
Ragnar65 is offline   Reply With Quote
Old 10-19-2018, 09:55 PM   #258
funkyfranky
Senior Member
 
funkyfranky's Avatar
 
Join Date: Sep 2015
Location: Asgård
Posts: 1,806
Default

Quote:
Originally Posted by Ragnar65 View Post
nope, doesn´t work... edited the file, buit the Mig21 doesn´t spawn... They are neither anywhere in the air nor on any runway... Could you please have a look at th mission? I reckon there´s some subtle issue anywhere...
Code:
local MIG21=RAT:New("RAT_MIG21")
MIG-21:Spawn(2)
There is still a minus sign in the script.
__________________
Of all the things I've lost, I miss my mind the most. --- Mark Twain
i7-8700K | Asus GTX 1080 Ti Strix OC| 32 GB Ram 3200 MHz DDR-4| Win 10 64-bit | Asus Maximus Hero X | Samung EVO 960 Pro SSD | VKB Gunfighter Pro | MFG Crosswind | CV1
funkyfranky is online now   Reply With Quote
Old 10-19-2018, 10:11 PM   #259
Ragnar65
Member
 
Join Date: Oct 2017
Location: Germany
Posts: 330
Default

Unfortunately not, here´s the actual wording:
local MIG21=RAT:New("RAT_MIG21")
MIG21:Spawn(2)

Can it be that the MIGs spawn later? I expect them being on a runway right at the beginning of the mission, but maybe they appear later?


EDIT: got it! found this sentence on one of the older posts:

"So when you make changes to the script, e.g. correct errors add stuff and so on, you need to go back to the trigger section in the ME and reopen the script file and save the mission again.
Otherwise the changes are not taken over."

This was the issue... I didn´t reload the script after editing it...

Thanks again for your immediate replies!
__________________
TM Cougar Stick, TWCS Throttle, TM TFRP Pedals
Modules: F-5E, FC3, F/A-18C

Last edited by Ragnar65; 10-19-2018 at 10:28 PM.
Ragnar65 is offline   Reply With Quote
Old 10-19-2018, 10:52 PM   #260
Ragnar65
Member
 
Join Date: Oct 2017
Location: Germany
Posts: 330
Default Radom spawntime?

Hi,


is there any possibility to let the AI-planes spawn at random times? Let´s say, one group spawns at the mission start, another randomly and for me surprisingly?
I´d like to build some CAP missions and want to get a picture or bogey-dope from the E3 or E2 without knowing when the bogeys spawn...
Currently I know the time the bogeys spawn ´cos i have built the mission... ;-)
__________________
TM Cougar Stick, TWCS Throttle, TM TFRP Pedals
Modules: F-5E, FC3, F/A-18C
Ragnar65 is offline   Reply With Quote
Reply

Tags
moose, random air traffic, rat

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 07:24 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.