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


Notices

Reply
 
Thread Tools Display Modes
Old 07-14-2019, 10:33 AM   #1651
hancerPL
Junior Member
 
hancerPL's Avatar
 
Join Date: Sep 2018
Location: Poland
Posts: 67
Default

Hello
I have a request, I need a menu for the mission.
For the client he could spawn unit and menu disappears.
I have no idea because I have not made a menu in 'lua' yet.

Thanks for the help
hancerPL is offline   Reply With Quote
Old 07-14-2019, 11:33 PM   #1652
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 610
Default

@hancerPL

https://flightcontrol-master.github....Core.Menu.html

https://forums.eagle.ru/showpost.php...3&postcount=20

Last edited by Hardcard; 07-14-2019 at 11:36 PM.
Hardcard is offline   Reply With Quote
Old 07-16-2019, 05:09 PM   #1653
hancerPL
Junior Member
 
hancerPL's Avatar
 
Join Date: Sep 2018
Location: Poland
Posts: 67
Default

Thanks, but I forgot the menu right now.

Quote:
CaptureZone = ZONE:New( "CaptureZone1" )
ZoneCaptureCoalition = ZONE_CAPTURE_COALITION:New( CaptureZone, coalition.side.RED )
function ZoneCaptureCoalition:OnEnterEmpty()
MessageToBlue( "Good Job", 20 )
end
ZoneCaptureCoalition:Start( 10, 30 )
Here is the problem because a marker on the map is visible to everyone.


How to remove it from the map so that the script will continue to work.
hancerPL is offline   Reply With Quote
Old 07-16-2019, 09:42 PM   #1654
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 610
Default

I don't know about that marker, but I think your snippet has bad syntax in it (which might explain why it doesn't work):

Code:
CaptureZone = ZONE:New( "CaptureZone1" )
ZoneCaptureCoalition = ZONE_CAPTURE_COALITION:New( CaptureZone, coalition.side.RED ) 
function ZoneCaptureCoalition:OnEnterEmpty() -- The correct syntax seems to be :onenterEmpty()
MessageToBlue( "Good Job", 20 )
end
ZoneCaptureCoalition:Start( 10, 30 )
Hardcard is offline   Reply With Quote
Old 07-17-2019, 09:50 AM   #1655
hancerPL
Junior Member
 
hancerPL's Avatar
 
Join Date: Sep 2018
Location: Poland
Posts: 67
Default

@Hardcard
Thanks, the script works but it still displays this tag.

I have one thing for you.
I made a spawn menu based on yours, it works ok
How to make a spawn of one group, eg "Spawn 1", this menu disappears. Because the spawn is disposable and does not need the menu is displayed.

Quote:
Client1 = GROUP:FindByName( "Enfield")
Nblu_1 = GROUP:FindByName("Nblu #001")
Nblu_2 = GROUP:FindByName("Nblu #002")

local function Spawn1()
Nblu_1:Activate()
trigger.action.outText('Spawn 1', 1)
end
local function Spawn2()
Nblu_2:Activate()
trigger.action.outText('Spawn 2', 1)
end

MenuSpawn = MENU_GROUP:New(Client1, "Spawn Menu ")
Spawn_1 = MENU_GROUP_COMMAND:New(Client1, "Spawn 1", MenuSpawn, Spawn1)
Spawn_2 = MENU_GROUP_COMMAND:New(Client1, "Spawn 2", MenuSpawn, Spawn2)
Thanks for helping me, there are no volunteers like you. I would set you a big beer.

Last edited by hancerPL; 07-17-2019 at 10:16 AM.
hancerPL is offline   Reply With Quote
Old 07-17-2019, 12:06 PM   #1656
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 610
Default

https://flightcontrol-master.github....OMMAND).Remove
Hardcard is offline   Reply With Quote
Old 07-17-2019, 04:29 PM   #1657
hancerPL
Junior Member
 
hancerPL's Avatar
 
Join Date: Sep 2018
Location: Poland
Posts: 67
Default

Thank you, but a reference to incomprehensible instructions is a vicious circle.
It suffices to write:
Quote:
local function Spawn1()
Nblu_1:Activate()
Spawn_1:Remove( 1, nil )
trigger.action.outText('Spawn 1', 1)
end
That is: Spawn_1: Remove (1, nil)
hancerPL is offline   Reply With Quote
Old 07-17-2019, 04:56 PM   #1658
Pikey
Veteran
 
Pikey's Avatar
 
Join Date: Sep 2009
Location: Reading, UK (GMT)
Posts: 3,555
Default

https://github.com/FlightControl-Mas...i%20Player.lua

Some examples in and around here.
__________________
Whilst some parrots may jabber,
"To improve is to change; to be perfect is to change often". (W.Churchill)
=============================================
Pikey is offline   Reply With Quote
Old 07-17-2019, 05:26 PM   #1659
hancerPL
Junior Member
 
hancerPL's Avatar
 
Join Date: Sep 2018
Location: Poland
Posts: 67
Default

That's how I read it, and more. Not everyone knows everything at once.
Quote:
PlaneGroup = GROUP:FindByName( "Enfield")
Nblu_1 = GROUP:FindByName("Nblu #001")
Nblu_2 = GROUP:FindByName("Nblu #002")
local function Spawn1()
Nblu_1:Activate()
Spawn_1:Remove( 1, nil )
trigger.action.outText('Spawn 1', 1)-- info test
end
local function Spawn2()
Nblu_2:Activate()
Spawn_2:Remove( 1, nil )
trigger.action.outText('Spawn 2', 1)-- info test
end
SCHEDULER:New( nil,
function()
if PlaneGroup:IsAlive() then
Spawn_1 = MENU_GROUP_COMMAND:New( PlaneGroup, "Spawn 1", MenuManage, Spawn1 )
Spawn_2 = MENU_GROUP_COMMAND:New( PlaneGroup, "Spawn 2", MenuManage, Spawn2 )
end
end, {}, 0 )
The final working version, maybe it can be simpler, I put in a way if someone had a problem with it.
hancerPL is offline   Reply With Quote
Old 07-18-2019, 12:54 AM   #1660
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 610
Default

Quote:
Originally Posted by hancerPL View Post
Thank you, but a reference to incomprehensible instructions is a vicious circle.
Well, those "incomprehensible instructions" taught me how to do it... maybe the problem is that you didn't take the time to carefully examine the content of the several links I provided.

I mean, this post alone provided the necessary information + an example of how to add and remove menus:
https://forums.eagle.ru/showpost.php...3&postcount=20

On top of it, I linked the MOOSE documentation for MENU class (which contains all the methods + examples)...twice

Sorry, I assumed you already had all the info you required, my bad

Last edited by Hardcard; 07-18-2019 at 12:57 AM.
Hardcard 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 09:42 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.