Jump to content

Recommended Posts

Posted (edited)

Hi, I made this chunk:

 

DC_AMVI.addF10menu = {}
function DC_AMVI.addF10menu:onEvent(event)
	if event.id == S_EVENT_PLAYER_ENTER_UNIT then	--world.event.S_EVENT_BIRTH 

		if debugProcess == true then
			env.info(("DAWS AIE Logistic: detected BIRTH event"))
		end
	
		local init_name 		= event.initiator:getPlayerName()

		if init_name then	
			local init_group		= event.initiator:getGroup()
			local init_group_id		= init_group:getID()
			local init_group_name	= init_group:getName()

			if debugProcess == true then
				env.info(("DAWS AIE Logistic: adding f10 menù for group ID: " .. init_group_id))
			end				
			commandDB[init_group_name] = missionCommands.addCommandForGroup(init_group_id, "DAWS - Get Available fuel & ammo", nil, retrieveLogTable, {unit = event.initiator, groupName = init_group_name, groupID = init_group_id})
		end
	end
end
world.addEventHandler(DC_AMVI.addF10menu)

 

that should start each time a player enter an helicopter.

I tested that in single player and it doesn't work (the env.info call isn't showed in dcs.log.

 

What am I doing wrong?

 

PS:

DC_AMVI table exist.

 

PS2:

in log , only if I test it in MP environment, I can see this:

Scripting: event:type=under control,initiatorPilotName=AMVI_Chromium,target=Chevy 1.1,t=43200,targetMissionID=2,
Edited by chromium

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Github for latest version: https://github.com/Chromium18/DSMC

Posted

From my experience using this, this event does not fire in single player (but I would need to confirm if that's still the case).

 

This fires when you have selected a slot in multiplayer, and have clicked the button where you are physically put into an airframe.

 

If you need this mission to work both in SP and MP, I think you'll need to handle the S_EVENT_BIRTH in SP and call your code above. Otherwise use S_EVENT_PLAYER_ENTER_UNIT in MP. I don't think there is a way to check using DCS script if current mission is Multiplayer or not (you can do this in a mod however).

Developer of Kaukasus Insurgency - a customizable Dynamic PvE Campaign with cloud hosting and stats tracking. (Alpha)

 

http://kaukasusinsurgency.com/

  • Recently Browsing   0 members

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