MOOSE - Mission Object Oriented Scripting Framework - Page 160 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 04-20-2019, 10:46 AM   #1591
Mano
ED Translator
 
Join Date: May 2010
Location: Italy
Posts: 108
Default

Quote:
Originally Posted by Hardcard View Post

:GetHeading() is a MOOSE method, only compatible with certain MOOSE classes (in this case, UNIT class), whereas Unit.getByName() is a DCS class + method which returns an incompatible DCS object.

Always pay attention to the kind of classes and methods you're using.

DCS classes require DCS methods (and vice versa), MOOSE classes require MOOSE methods (and vice versa):
Spoiler:
Unit.getByName() -- DCS class + DCS method

UNIT:FindByName() -- MOOSE class + MOOSE method

Unit:FindByName() -- DCS class + MOOSE method

UNIT.getByName() -- MOOSE class + DCS method
oh now it is really clear! I didn't have idea of this difference and was having hard time reffering to objects in my scripts! that's great.




Quote:
Originally Posted by Wingthor View Post
Code:
local carrierHeading = string.format ("Heading: %i", carrier:GetHeading())
this is another thing I was looking for, how to format text messages.

Quote:
Originally Posted by Wingthor View Post
Hope this help. I have NOT TESTED the code though. Also plz join our Discord channel for further help
The script works perfectly and is exactly what I wanted.

Guys, thank you so much for your help and infinite patience with noobs like me...Now I think I have some things clearer that should ease my study.

(Discord joined! )
__________________
Mano is offline   Reply With Quote
Old 04-22-2019, 01:00 PM   #1592
Tiramisu
Member
 
Join Date: Oct 2018
Location: Germany
Posts: 290
Default

When MOOSE is spawning aircraft their (unit)names will be some expressionless numbers. Is there a way to change this? E.g. when I use the ai-a2a-dispatcher I want the spawned aircraft to have the original names from the mission editor plus a #number as a suffix to distinguish them.
Tiramisu is offline   Reply With Quote
Old 04-22-2019, 01:16 PM   #1593
Wingthor
Junior Member
 
Wingthor's Avatar
 
Join Date: Nov 2016
Location: Oslo
Posts: 47
Default

Quote:
Originally Posted by Tiramisu View Post
When MOOSE is spawning aircraft their (unit)names will be some expressionless numbers. Is there a way to change this? E.g. when I use the ai-a2a-dispatcher I want the spawned aircraft to have the original names from the mission editor plus a #number as a suffix to distinguish them.

You need to specify? Does the Moose spawn change unit names? or do you mean Groups name. When regular spawning and also with the ai-a2a-dispatcher Groups name have the original names from the mission editor plus a #number as a suffix If spawning with warehouse class name might change.


You can have a look at this docs from Spawn class.



Regards



Wingthor
__________________
Moose framework contributor

Last edited by Wingthor; 04-22-2019 at 01:18 PM.
Wingthor is offline   Reply With Quote
Old 04-22-2019, 01:25 PM   #1594
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 366
Default

I think he meant unit names.
I seem to recall that the given ME unit names aren't kept when spawning units with MOOSE, only group names are (+ suffix, ofc).

In any case, I'd ask this sort of question in the MOOSE Discord channel.
Hardcard is offline   Reply With Quote
Old 04-22-2019, 01:31 PM   #1595
Tiramisu
Member
 
Join Date: Oct 2018
Location: Germany
Posts: 290
Default

Quote:
Originally Posted by Wingthor View Post
You can have a look at this docs from Spawn class.
Oh yeah, I will try KeepUnitNames. Thanks!

Quote:
Originally Posted by Hardcard View Post
In any case, I'd ask this sort of question in the MOOSE Discord channel.
Ok sorry. Thought it was a more general question, so I asked it here.
Tiramisu is offline   Reply With Quote
Reply

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 06:21 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.