[MOD] Immediate Orders (updated April 18, 2021)

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Hornet108
Posts: 343
Joined: Thu, 15. Nov 12, 13:46
x4

Re: [MOD] Immediate Orders

Post by Hornet108 » Sun, 2. Jun 19, 12:36

Berserk Knight wrote:
Thu, 30. May 19, 05:22
Hornet108 wrote:
Wed, 29. May 19, 19:53
Sorry to pester, any word on this? :D
Gah, 2.50 got pushed to live on the one day I was too busy to check.

Mod updated.
Sorry mate!

Take it as a compliment - im a huge fan of your work!

Hornet108
Posts: 343
Joined: Thu, 15. Nov 12, 13:46
x4

Re: [MOD] Immediate Orders (updated May 30, 2019)

Post by Hornet108 » Mon, 18. Nov 19, 02:18

Just a quick one if anyone finds this absolutely essential but is having problems with it in the 3.0 beta - here is a (very hacky) solution to make this work. I have disabled some of the right click functionality that was causing issues, but they are things that I personally don't miss. Some of the things disabled may still work, but they haven't been tested because I don't need them.

To use this, replace the function capi.InsertLuaAction in the right_click_api.lua in the root of the RightClickAPI extension with the following code:

Code: Select all

function capi.InsertLuaAction(actiontype, istobedisplayed)
	local doIt = true
	
	-- process your own action
	if actiontype == "accountmanagement" then
		capi.OnAccountmanagement()
		doIt = false
	elseif actiontype == "assign" then
		capi.OnAssign()
		doIt = true
	elseif actiontype == "attack" then
		capi.OnAttack()
		doIt = true
	elseif actiontype == "attackinrange" then
		capi.OnAttackinrange()
		doIt = true
	elseif actiontype == "attackmultiple" then
		capi.OnAttackmultiple()
		doIt = true
	elseif actiontype == "attackplayertarget" then
		capi.OnAttackplayertarget()
		doIt = false
	elseif actiontype == "board" then
		capi.OnBoard()
		doIt = true
	elseif actiontype == "build" then
		capi.OnBuild()
		doIt = true
	elseif actiontype == "buildships" then
		capi.OnBuildships()
		doIt = true
	elseif actiontype == "changeformation" then
		capi.OnChangeformation()
		doIt = false
	elseif actiontype == "configurestation" then
		capi.OnConfigurestation()
		doIt = true
	elseif actiontype == "collect" then
		capi.OnCollect()
		doIt = false
	elseif actiontype == "collectlockbox" then
		capi.OnCollectlockbox()
		doIt = false
	elseif actiontype == "collectspace" then
		capi.OnCollectspace()
		doIt = false
	elseif actiontype == "deployhere" then
		capi.OnDeployhere()
		doIt = true
	elseif actiontype == "deployat" then
		capi.OnDeployat()
		doIt = true
	elseif actiontype == "depositinventory" then
		capi.OnDepositinventory()
		doIt = true
	elseif actiontype == "dockat" then
		capi.OnDockat()
		doIt = true
	elseif actiontype == "dockatplayer" then
		capi.OnDockatplayer()
		doIt = true
	elseif actiontype == "dockrequest" then
		capi.OnDockrequest()
		doIt = true
	elseif actiontype == "dropinventory" then
		capi.OnDropinventory()
		doIt = true
	elseif actiontype == "explore" then
		capi.OnExplore()
		doIt = false
	elseif actiontype == "exploreupdate" then
		capi.OnExploreupdate()
		doIt = false
	elseif actiontype == "flyto" then
		capi.OnFlyto()
		doIt = true
	elseif actiontype == "follow" then
		capi.OnFollow()
		doIt = true
	elseif actiontype == "getsupplies" then
		capi.OnGetsupplies()
		doIt = true
	elseif actiontype == "guidance" then
		capi.OnGuidance()
		doIt = true
	elseif actiontype == "hire" then
		capi.OnHire()
		doIt = false
	elseif actiontype == "logicalstationoverview" then		
		capi.OnLogicalstationoverview()
		doIt = true
	elseif actiontype == "manageassignments" then
		capi.OnManageassignments()
		doIt = false
	elseif actiontype == "mining" then
		capi.OnMining()
		doIt = true
	elseif actiontype == "orderoverview" then
		capi.OnOrderoverview()
		doIt = false
	elseif actiontype == "paintmod" then
		capi.OnPaintmod()
		doIt = false
	elseif actiontype == "player_docktotrade" then
		capi.OnPlayer_docktotrade()
		doIt = true
	elseif actiontype == "proceedwithorders" then
		capi.OnProceedwithorders()
		doIt = true
	elseif actiontype == "protectstation" then
		capi.OnProtectstation()
		doIt = true
	elseif actiontype == "recallsubs" then
		capi.OnRecallsubs()
		doIt = true
	elseif actiontype == "removeallorders" then
		capi.OnRemoveallorders()
		doIt = true
	elseif actiontype == "sellships" then
		capi.OnSellships()
		doIt = true
	elseif actiontype == "stopandholdfire" then
		capi.OnStopandholdfire()
		doIt = true
	elseif actiontype == "targetview" then
		capi.OnTargetview()
		doIt = false
	elseif actiontype == "teleport" then
		capi.OnTeleport()
		doIt = true
	elseif actiontype == "upgrade" then
		capi.OnUpgrade()
		doIt = true
	elseif actiontype == "upgradeships" then
		capi.OnUpgradeships()
		doIt = true
	elseif actiontype == "venturedockat" then
		capi.OnVenturedockat()
		doIt = false
	elseif actiontype == "wareexchange" then
		capi.OnWareexchange()
		doIt = true
	elseif actiontype == "withdrawandhold" then
		capi.OnWithdrawandhold()
		doIt = true
	elseif actiontype == "withdrawfromcombat" then
		capi.OnWithdrawfromcombat()
		doIt = true
	elseif actiontype == "cheat_satellite" then--I don't know if modders can get access to these, so Im adding them anyway.
		capi.OnCheat_satellite()
		doIt = false
	elseif actiontype == "cheat_navbeacon" then
		capi.OnCheat_navbeacon()
		doIt = false
	elseif actiontype == "cheat_resourceprobe" then
		capi.OnCheat_resourceprobe()
		doIt = false
	elseif actiontype == "cheat_takeownership" then
		capi.OnCheat_takeownership()
		doIt = false
	elseif actiontype == "cheat_warp" then
		capi.OnCheat_warp()
		doIt = false
		
		
	elseif actiontype == "rename" then		
		doIt = false
	elseif actiontype == "fleetrename" then
		doIt = false
	elseif actiontype == "removeallordersandwait" then
		doIt = false
	elseif actiontype == "collectdeployables" then
		doIt = false
	elseif actiontype == "crewtransfer" then
		doIt = false			
		
	else 
		DebugError("Unknown order type")
		DebugError(actiontype)
		doIt = false
	end
	
	if doIt == true then
		--then call original function first
		orig.insertLuaAction(actiontype, istobedisplayed)
	end
	
end
Again, this is a hacky work-around (I'm not familiar with how this mod actually works, I was just able to hack this together to get it working) until 3.0 is released properly and Berserk Knight hopefully keeps up his excellent work and updates the mod :D

kringol
Posts: 2
Joined: Sat, 1. Dec 18, 22:03
x4

Re: [MOD] Immediate Orders (updated May 30, 2019)

Post by kringol » Thu, 21. Nov 19, 17:01

Hornet108 wrote:
Mon, 18. Nov 19, 02:18
Just a quick one if anyone finds this absolutely essential but is having problems with it in the 3.0 beta - here is a (very hacky) solution to make this work. I have disabled some of the right click functionality that was causing issues, but they are things that I personally don't miss. Some of the things disabled may still work, but they haven't been tested because I don't need them.

To use this, replace the function capi.InsertLuaAction in the right_click_api.lua in the root of the RightClickAPI extension with the following code:

Code: Select all

function capi.InsertLuaAction(actiontype, istobedisplayed)
	local doIt = true
	
	-- process your own action
	if actiontype == "accountmanagement" then
		capi.OnAccountmanagement()
		doIt = false
	elseif actiontype == "assign" then
		capi.OnAssign()
		doIt = true
	elseif actiontype == "attack" then
		capi.OnAttack()
		doIt = true
	elseif actiontype == "attackinrange" then
		capi.OnAttackinrange()
		doIt = true
	elseif actiontype == "attackmultiple" then
		capi.OnAttackmultiple()
		doIt = true
	elseif actiontype == "attackplayertarget" then
		capi.OnAttackplayertarget()
		doIt = false
	elseif actiontype == "board" then
		capi.OnBoard()
		doIt = true
	elseif actiontype == "build" then
		capi.OnBuild()
		doIt = true
	elseif actiontype == "buildships" then
		capi.OnBuildships()
		doIt = true
	elseif actiontype == "changeformation" then
		capi.OnChangeformation()
		doIt = false
	elseif actiontype == "configurestation" then
		capi.OnConfigurestation()
		doIt = true
	elseif actiontype == "collect" then
		capi.OnCollect()
		doIt = false
	elseif actiontype == "collectlockbox" then
		capi.OnCollectlockbox()
		doIt = false
	elseif actiontype == "collectspace" then
		capi.OnCollectspace()
		doIt = false
	elseif actiontype == "deployhere" then
		capi.OnDeployhere()
		doIt = true
	elseif actiontype == "deployat" then
		capi.OnDeployat()
		doIt = true
	elseif actiontype == "depositinventory" then
		capi.OnDepositinventory()
		doIt = true
	elseif actiontype == "dockat" then
		capi.OnDockat()
		doIt = true
	elseif actiontype == "dockatplayer" then
		capi.OnDockatplayer()
		doIt = true
	elseif actiontype == "dockrequest" then
		capi.OnDockrequest()
		doIt = true
	elseif actiontype == "dropinventory" then
		capi.OnDropinventory()
		doIt = true
	elseif actiontype == "explore" then
		capi.OnExplore()
		doIt = false
	elseif actiontype == "exploreupdate" then
		capi.OnExploreupdate()
		doIt = false
	elseif actiontype == "flyto" then
		capi.OnFlyto()
		doIt = true
	elseif actiontype == "follow" then
		capi.OnFollow()
		doIt = true
	elseif actiontype == "getsupplies" then
		capi.OnGetsupplies()
		doIt = true
	elseif actiontype == "guidance" then
		capi.OnGuidance()
		doIt = true
	elseif actiontype == "hire" then
		capi.OnHire()
		doIt = false
	elseif actiontype == "logicalstationoverview" then		
		capi.OnLogicalstationoverview()
		doIt = true
	elseif actiontype == "manageassignments" then
		capi.OnManageassignments()
		doIt = false
	elseif actiontype == "mining" then
		capi.OnMining()
		doIt = true
	elseif actiontype == "orderoverview" then
		capi.OnOrderoverview()
		doIt = false
	elseif actiontype == "paintmod" then
		capi.OnPaintmod()
		doIt = false
	elseif actiontype == "player_docktotrade" then
		capi.OnPlayer_docktotrade()
		doIt = true
	elseif actiontype == "proceedwithorders" then
		capi.OnProceedwithorders()
		doIt = true
	elseif actiontype == "protectstation" then
		capi.OnProtectstation()
		doIt = true
	elseif actiontype == "recallsubs" then
		capi.OnRecallsubs()
		doIt = true
	elseif actiontype == "removeallorders" then
		capi.OnRemoveallorders()
		doIt = true
	elseif actiontype == "sellships" then
		capi.OnSellships()
		doIt = true
	elseif actiontype == "stopandholdfire" then
		capi.OnStopandholdfire()
		doIt = true
	elseif actiontype == "targetview" then
		capi.OnTargetview()
		doIt = false
	elseif actiontype == "teleport" then
		capi.OnTeleport()
		doIt = true
	elseif actiontype == "upgrade" then
		capi.OnUpgrade()
		doIt = true
	elseif actiontype == "upgradeships" then
		capi.OnUpgradeships()
		doIt = true
	elseif actiontype == "venturedockat" then
		capi.OnVenturedockat()
		doIt = false
	elseif actiontype == "wareexchange" then
		capi.OnWareexchange()
		doIt = true
	elseif actiontype == "withdrawandhold" then
		capi.OnWithdrawandhold()
		doIt = true
	elseif actiontype == "withdrawfromcombat" then
		capi.OnWithdrawfromcombat()
		doIt = true
	elseif actiontype == "cheat_satellite" then--I don't know if modders can get access to these, so Im adding them anyway.
		capi.OnCheat_satellite()
		doIt = false
	elseif actiontype == "cheat_navbeacon" then
		capi.OnCheat_navbeacon()
		doIt = false
	elseif actiontype == "cheat_resourceprobe" then
		capi.OnCheat_resourceprobe()
		doIt = false
	elseif actiontype == "cheat_takeownership" then
		capi.OnCheat_takeownership()
		doIt = false
	elseif actiontype == "cheat_warp" then
		capi.OnCheat_warp()
		doIt = false
		
		
	elseif actiontype == "rename" then		
		doIt = false
	elseif actiontype == "fleetrename" then
		doIt = false
	elseif actiontype == "removeallordersandwait" then
		doIt = false
	elseif actiontype == "collectdeployables" then
		doIt = false
	elseif actiontype == "crewtransfer" then
		doIt = false			
		
	else 
		DebugError("Unknown order type")
		DebugError(actiontype)
		doIt = false
	end
	
	if doIt == true then
		--then call original function first
		orig.insertLuaAction(actiontype, istobedisplayed)
	end
	
end
Again, this is a hacky work-around (I'm not familiar with how this mod actually works, I was just able to hack this together to get it working) until 3.0 is released properly and Berserk Knight hopefully keeps up his excellent work and updates the mod :D


Worked for me too not perfect but at least working

XTC0R
Posts: 401
Joined: Sat, 1. Dec 18, 19:58
x4

Re: [MOD] Immediate Orders (updated May 30, 2019)

Post by XTC0R » Thu, 21. Nov 19, 18:24

Hornet108 wrote:
Mon, 18. Nov 19, 02:18
Just a quick one if anyone finds this absolutely essential but is having problems with it in the 3.0 beta - here is a (very hacky) solution to make this work. I have disabled some of the right click functionality that was causing issues, but they are things that I personally don't miss. Some of the things disabled may still work, but they haven't been tested because I don't need them.

To use this, replace the function capi.InsertLuaAction in the right_click_api.lua in the root of the RightClickAPI extension with the following code:

Code: Select all

function capi.InsertLuaAction(actiontype, istobedisplayed)
	local doIt = true
	
	-- process your own action
	if actiontype == "accountmanagement" then
		capi.OnAccountmanagement()
		doIt = false
	elseif actiontype == "assign" then
		capi.OnAssign()
		doIt = true
	elseif actiontype == "attack" then
		capi.OnAttack()
		doIt = true
	elseif actiontype == "attackinrange" then
		capi.OnAttackinrange()
		doIt = true
	elseif actiontype == "attackmultiple" then
		capi.OnAttackmultiple()
		doIt = true
	elseif actiontype == "attackplayertarget" then
		capi.OnAttackplayertarget()
		doIt = false
	elseif actiontype == "board" then
		capi.OnBoard()
		doIt = true
	elseif actiontype == "build" then
		capi.OnBuild()
		doIt = true
	elseif actiontype == "buildships" then
		capi.OnBuildships()
		doIt = true
	elseif actiontype == "changeformation" then
		capi.OnChangeformation()
		doIt = false
	elseif actiontype == "configurestation" then
		capi.OnConfigurestation()
		doIt = true
	elseif actiontype == "collect" then
		capi.OnCollect()
		doIt = false
	elseif actiontype == "collectlockbox" then
		capi.OnCollectlockbox()
		doIt = false
	elseif actiontype == "collectspace" then
		capi.OnCollectspace()
		doIt = false
	elseif actiontype == "deployhere" then
		capi.OnDeployhere()
		doIt = true
	elseif actiontype == "deployat" then
		capi.OnDeployat()
		doIt = true
	elseif actiontype == "depositinventory" then
		capi.OnDepositinventory()
		doIt = true
	elseif actiontype == "dockat" then
		capi.OnDockat()
		doIt = true
	elseif actiontype == "dockatplayer" then
		capi.OnDockatplayer()
		doIt = true
	elseif actiontype == "dockrequest" then
		capi.OnDockrequest()
		doIt = true
	elseif actiontype == "dropinventory" then
		capi.OnDropinventory()
		doIt = true
	elseif actiontype == "explore" then
		capi.OnExplore()
		doIt = false
	elseif actiontype == "exploreupdate" then
		capi.OnExploreupdate()
		doIt = false
	elseif actiontype == "flyto" then
		capi.OnFlyto()
		doIt = true
	elseif actiontype == "follow" then
		capi.OnFollow()
		doIt = true
	elseif actiontype == "getsupplies" then
		capi.OnGetsupplies()
		doIt = true
	elseif actiontype == "guidance" then
		capi.OnGuidance()
		doIt = true
	elseif actiontype == "hire" then
		capi.OnHire()
		doIt = false
	elseif actiontype == "logicalstationoverview" then		
		capi.OnLogicalstationoverview()
		doIt = true
	elseif actiontype == "manageassignments" then
		capi.OnManageassignments()
		doIt = false
	elseif actiontype == "mining" then
		capi.OnMining()
		doIt = true
	elseif actiontype == "orderoverview" then
		capi.OnOrderoverview()
		doIt = false
	elseif actiontype == "paintmod" then
		capi.OnPaintmod()
		doIt = false
	elseif actiontype == "player_docktotrade" then
		capi.OnPlayer_docktotrade()
		doIt = true
	elseif actiontype == "proceedwithorders" then
		capi.OnProceedwithorders()
		doIt = true
	elseif actiontype == "protectstation" then
		capi.OnProtectstation()
		doIt = true
	elseif actiontype == "recallsubs" then
		capi.OnRecallsubs()
		doIt = true
	elseif actiontype == "removeallorders" then
		capi.OnRemoveallorders()
		doIt = true
	elseif actiontype == "sellships" then
		capi.OnSellships()
		doIt = true
	elseif actiontype == "stopandholdfire" then
		capi.OnStopandholdfire()
		doIt = true
	elseif actiontype == "targetview" then
		capi.OnTargetview()
		doIt = false
	elseif actiontype == "teleport" then
		capi.OnTeleport()
		doIt = true
	elseif actiontype == "upgrade" then
		capi.OnUpgrade()
		doIt = true
	elseif actiontype == "upgradeships" then
		capi.OnUpgradeships()
		doIt = true
	elseif actiontype == "venturedockat" then
		capi.OnVenturedockat()
		doIt = false
	elseif actiontype == "wareexchange" then
		capi.OnWareexchange()
		doIt = true
	elseif actiontype == "withdrawandhold" then
		capi.OnWithdrawandhold()
		doIt = true
	elseif actiontype == "withdrawfromcombat" then
		capi.OnWithdrawfromcombat()
		doIt = true
	elseif actiontype == "cheat_satellite" then--I don't know if modders can get access to these, so Im adding them anyway.
		capi.OnCheat_satellite()
		doIt = false
	elseif actiontype == "cheat_navbeacon" then
		capi.OnCheat_navbeacon()
		doIt = false
	elseif actiontype == "cheat_resourceprobe" then
		capi.OnCheat_resourceprobe()
		doIt = false
	elseif actiontype == "cheat_takeownership" then
		capi.OnCheat_takeownership()
		doIt = false
	elseif actiontype == "cheat_warp" then
		capi.OnCheat_warp()
		doIt = false
		
		
	elseif actiontype == "rename" then		
		doIt = false
	elseif actiontype == "fleetrename" then
		doIt = false
	elseif actiontype == "removeallordersandwait" then
		doIt = false
	elseif actiontype == "collectdeployables" then
		doIt = false
	elseif actiontype == "crewtransfer" then
		doIt = false			
		
	else 
		DebugError("Unknown order type")
		DebugError(actiontype)
		doIt = false
	end
	
	if doIt == true then
		--then call original function first
		orig.insertLuaAction(actiontype, istobedisplayed)
	end
	
end
Again, this is a hacky work-around (I'm not familiar with how this mod actually works, I was just able to hack this together to get it working) until 3.0 is released properly and Berserk Knight hopefully keeps up his excellent work and updates the mod :D
I tried your hotfix. The context menu opens again. But is missing the mass crew transfer option which was introduced in Beta 3.0

XTC0R
Posts: 401
Joined: Sat, 1. Dec 18, 19:58
x4

Re: [MOD] Immediate Orders (updated May 30, 2019)

Post by XTC0R » Fri, 22. Nov 19, 11:08

I get the following error in the debug log:

Code: Select all

[=ERROR=] 199789.79 Table row height mismatch in row 4: expected height = 10, actualheight = 15 [Klaus]
The context menu opens but does not show the mass crew transfer option.

XTC0R
Posts: 401
Joined: Sat, 1. Dec 18, 19:58
x4

Re: [MOD] Immediate Orders (updated May 30, 2019)

Post by XTC0R » Fri, 22. Nov 19, 11:31

XTC0R wrote:
Fri, 22. Nov 19, 11:08
I get the following error in the debug log:

Code: Select all

[=ERROR=] 199789.79 Table row height mismatch in row 4: expected height = 10, actualheight = 15 [Klaus]
The context menu opens but does not show the mass crew transfer option.
I removed all mods step by step and it's the Right Click API which prevents to show the mass crew transfer option which was newly introduced in Beta 3.
But I still get the error:

Code: Select all

Table row height mismatch in row 4: expected height = 10, actualheight = 15 [Klaus]
So this error has nothing to do with it. Unfortunately using the right click API MOD does not bring any other error in my debug log. So I don't know what is causing the issue.

Berserk Knight
Posts: 398
Joined: Tue, 17. Dec 13, 01:34
x4

Re: [MOD] Immediate Orders (updated March 31, 2020)

Post by Berserk Knight » Tue, 31. Mar 20, 18:17

Updated to 3.00.

Sirilius
Posts: 303
Joined: Fri, 26. Dec 03, 23:59
x4

Re: [MOD] Immediate Orders (updated March 31, 2020)

Post by Sirilius » Sat, 18. Apr 20, 16:13

Does this work with SirNuke's rghtclick API? I heard that the G workout doesn't work with the 3.1 update.

Berserk Knight
Posts: 398
Joined: Tue, 17. Dec 13, 01:34
x4

Re: [MOD] Immediate Orders (updated March 31, 2020)

Post by Berserk Knight » Sun, 18. Apr 21, 19:08

Updated for 4.00.

...Well, the Right Click API was.

This mod didn't really need an update, but I decided on reducing the ridiculous amounts of tables and functions in Right Click API.
The only changes made to this particular mod is the switch to the new functions.

Post Reply

Return to “X4: Foundations - Scripts and Modding”