Jump to content

Engine start goes funny when I try to use dataref: ixeg/733/engine/eng1(2)_start_act


AngelOfAttack
 Share

Recommended Posts

Hi everyone, while fly 737s, on all other add-ons, I have 2 key set on my buttonpanel to make input on both starter switch, to make it easy for set CONT/OFF up on taking off and landing as it's much convenient to do so than use mouse click on high workload condition.

For default IXEG inputs, I can only set one switch with one joystick input, so I tried to make a Flywithlua script to make it work.

My code for this part is:

	dataref("IX3_ENG1S", "ixeg/733/engine/eng1_start_act", "writable")
	dataref("IX3_ENG2S", "ixeg/733/engine/eng2_start_act", "writable")

	function IX3_ENGS_CONT()
			IX3_ENG1S = 1
			IX3_ENG2S = 1
	end
	create_command("ixeg/733/overhead/ENGS_CONT", "ENGS_CONT", "IX3_ENGS_CONT()", "", "")
	
	function IX3_ENGS_OFF()
			IX3_ENG1S = 0
			IX3_ENG2S = 0
	end
	create_command("ixeg/733/overhead/ENGS_OFF", "ENGS_OFF", "IX3_ENGS_OFF()", "", "")

 

I noticed when this lua is running, even without the lower part, just the 2 dataref() part , when I try to start engine, the start switch will not automatically cutoff, AND the engine will go up to 1millon RPM to fly high and crash the airplane at start up(would not happen if just hold the switch by mouse.

 

I also tried:

	function IX3_ENGS_CONT()
		command_once("igex/733/overhead/left_engine_startswitch_to_CONT")
		command_once("igex/733/overhead/right_engine_startswitch_to_CONT")
	end
	create_command("ixeg/733/overhead/ENGS_CONT", "ENGS_CONT", "IX3_ENGS_CONT()", "", "")
	
	function IX3_ENGS_OFF()
		command_once("igex/733/overhead/left_engine_startswitch_to_OFF")
		command_once("igex/733/overhead/right_engine_startswitch_to_OFF")
	end
	create_command("ixeg/733/overhead/ENGS_OFF", "ENGS_OFF", "IX3_ENGS_OFF()", "", "")

but somehow it doesn't work at all.

Link to comment
Share on other sites

OK. I just ended up adding these 2 function:

	function IX3_ENG1_CUT_OFF()
	if (IX3_ENG1_N2 >= 46 and IX3_ENG1S == -1) then
		IX3_ENG1S = 0
	end
	end
	do_often("IX3_ENG1_CUT_OFF()")
	
	function IX3_ENG2_CUT_OFF()
	if (IX3_ENG2_N2 >= 46 and IX3_ENG2S == -1) then
		IX3_ENG2S = 0
	end
	end
	do_often("IX3_ENG2_CUT_OFF()")

to "manually" cutoff the switches, so far seems work for me, only problem is now I lack the louder click sound when it happens natually, but still a normal click sound like when manually put it back by mouse

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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