Help

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

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

Post Reply
fikrethos
Posts: 6
Joined: Mon, 22. Aug 11, 09:13
x4

Help

Post by fikrethos » Fri, 30. Aug 19, 15:47

How can i get ships virtualmacros (e.g. thruster macro)..

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13298
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Help

Post by euclid » Sun, 1. Sep 19, 12:48

Hi fikrethos,

Please check this sticky for a start. It explains, amonst other things, how to unpack the game files, including the xml files you are looking for.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: Help

Post by teleportationwars » Sun, 1. Sep 19, 15:59

Dude probably has the game unpacked if he knows the term "virtual macro." I assume he tried to use loadouts in some way and came across the issues with virtual macros there. You might be able to do some typecasting like you do with $Component.macro

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13298
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Help

Post by euclid » Sun, 1. Sep 19, 20:29

teleportationwars wrote:
Sun, 1. Sep 19, 15:59
Dude probably has the game unpacked if he knows the term "virtual macro." I assume he tried to use loadouts in some way and came across the issues with virtual macros there. You might be able to do some typecasting like you do with $Component.macro
Maybe, I'm not sure what "get ship virtualmacros" means. Anyway, if you have unpacked all files then you'll find the thrusters in assets\props\Engines\macros\.

Hope that helps.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

fikrethos
Posts: 6
Joined: Mon, 22. Aug 11, 09:13
x4

Re: Help

Post by fikrethos » Sun, 1. Sep 19, 22:19

i use ing debug mod , yes that thruster macro is install when create ship in loadout with <virtualmacros> prop., i dont it.

I use ;

<find_object_component name="$Equipment" multiple="true" object="$ship"/>

checked all getting items but found weapon, engines, shields macros on installed ship thats all k but i cant get installed thruster macros.

teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: Help

Post by teleportationwars » Sun, 1. Sep 19, 23:46

fikrethos wrote:
Sun, 1. Sep 19, 22:19
i use ing debug mod , yes that thruster macro is install when create ship in loadout with <virtualmacros> prop., i dont it.

I use ;

<find_object_component name="$Equipment" multiple="true" object="$ship"/>

checked all getting items but found weapon, engines, shields macros on installed ship thats all k but i cant get installed thruster macros.
I dont know of a way to get the macro from md. You can get it from lua with stuff like:

Code: Select all

ffi.string(C.GetVirtualUpgradeSlotCurrentMacro(inputobject, upgradetype.type, j))
You might be able to do something with loadout flags to get hold of it.

I suggest keeping a list of thruster macros and letting the generate_loadout pick one.

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13298
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Help

Post by euclid » Mon, 2. Sep 19, 00:59

teleportationwars wrote:
Sun, 1. Sep 19, 23:46
I dont know of a way to get the macro from md....
Yes, you are right. Atm there is no way to get vm via md (xml) and thrusters are vm. However the Devs are aware and thus there is hope it will be changed eventually ;-)

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

fikrethos
Posts: 6
Joined: Mon, 22. Aug 11, 09:13
x4

Re: Help

Post by fikrethos » Mon, 2. Sep 19, 13:36

teleportationwars wrote:
Sun, 1. Sep 19, 23:46
fikrethos wrote:
Sun, 1. Sep 19, 22:19
i use ing debug mod , yes that thruster macro is install when create ship in loadout with <virtualmacros> prop., i dont it.

I use ;

<find_object_component name="$Equipment" multiple="true" object="$ship"/>

checked all getting items but found weapon, engines, shields macros on installed ship thats all k but i cant get installed thruster macros.
I dont know of a way to get the macro from md. You can get it from lua with stuff like:

Code: Select all

ffi.string(C.GetVirtualUpgradeSlotCurrentMacro(inputobject, upgradetype.type, j))
You might be able to do something with loadout flags to get hold of it.

I suggest keeping a list of thruster macros and letting the generate_loadout pick one.
yes, i saw in lua cods but i need in md codes, thx m8 for r effort..

fikrethos
Posts: 6
Joined: Mon, 22. Aug 11, 09:13
x4

Re: Help

Post by fikrethos » Mon, 2. Sep 19, 13:39

euclid wrote:
Mon, 2. Sep 19, 00:59
teleportationwars wrote:
Sun, 1. Sep 19, 23:46
I dont know of a way to get the macro from md....
Yes, you are right. Atm there is no way to get vm via md (xml) and thrusters are vm. However the Devs are aware and thus there is hope it will be changed eventually ;-)

Cheers Euclid
can i get any result value(s) to in md from that lua function(s) ?

teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: Help

Post by teleportationwars » Mon, 2. Sep 19, 14:23

fikrethos wrote:
Mon, 2. Sep 19, 13:39
euclid wrote:
Mon, 2. Sep 19, 00:59
teleportationwars wrote:
Sun, 1. Sep 19, 23:46
I dont know of a way to get the macro from md....
Yes, you are right. Atm there is no way to get vm via md (xml) and thrusters are vm. However the Devs are aware and thus there is hope it will be changed eventually ;-)

Cheers Euclid
can i get any result value(s) to in md from that lua function(s) ?
viewtopic.php?f=181&t=418254 is how you run lua right now. You can signalobject from lua to some entity with the result. You pick it up with:

Code: Select all

   <event_object_signalled object="player.entity" param="'lualoadout'" />

fikrethos
Posts: 6
Joined: Mon, 22. Aug 11, 09:13
x4

Re: Help

Post by fikrethos » Mon, 2. Sep 19, 16:49

teleportationwars wrote:
Mon, 2. Sep 19, 14:23
fikrethos wrote:
Mon, 2. Sep 19, 13:39
euclid wrote:
Mon, 2. Sep 19, 00:59

Yes, you are right. Atm there is no way to get vm via md (xml) and thrusters are vm. However the Devs are aware and thus there is hope it will be changed eventually ;-)

Cheers Euclid
can i get any result value(s) to in md from that lua function(s) ?
viewtopic.php?f=181&t=418254 is how you run lua right now. You can signalobject from lua to some entity with the result. You pick it up with:

Code: Select all

   <event_object_signalled object="player.entity" param="'lualoadout'" />
thx for about m8. ill .. added u my friend list :)

teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: Help

Post by teleportationwars » Mon, 2. Sep 19, 17:43

fikrethos wrote:
Mon, 2. Sep 19, 16:49
teleportationwars wrote:
Mon, 2. Sep 19, 14:23
fikrethos wrote:
Mon, 2. Sep 19, 13:39


can i get any result value(s) to in md from that lua function(s) ?
viewtopic.php?f=181&t=418254 is how you run lua right now. You can signalobject from lua to some entity with the result. You pick it up with:

Code: Select all

   <event_object_signalled object="player.entity" param="'lualoadout'" />
thx for about m8. ill .. added u my friend list :)
thanks, you can get a lot of mod help at the unofficial egosoft discord. https://discord.gg/AWNAKU9

fikrethos
Posts: 6
Joined: Mon, 22. Aug 11, 09:13
x4

Re: Help

Post by fikrethos » Mon, 2. Sep 19, 18:47

teleportationwars wrote:
Mon, 2. Sep 19, 17:43
fikrethos wrote:
Mon, 2. Sep 19, 16:49
teleportationwars wrote:
Mon, 2. Sep 19, 14:23

viewtopic.php?f=181&t=418254 is how you run lua right now. You can signalobject from lua to some entity with the result. You pick it up with:

Code: Select all

   <event_object_signalled object="player.entity" param="'lualoadout'" />
thx for about m8. ill .. added u my friend list :)
thanks, you can get a lot of mod help at the unofficial egosoft discord. https://discord.gg/AWNAKU9
cool cheat teams , thx so much again..

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: Help

Post by UniTrader » Tue, 3. Sep 19, 12:23

teleportationwars wrote:
Mon, 2. Sep 19, 17:43

thanks, you can get a lot of mod help at the unofficial egosoft discord. https://discord.gg/AWNAKU9

since a few Devs hang out there too I guess you could even call it semi official :D
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Post Reply

Return to “X4: Foundations - Scripts and Modding”