How to read a macro's properties?

The place to discuss scripting and game modifications for X Rebirth.

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

Ginger470
Posts: 158
Joined: Sun, 20. Jun 04, 03:24
x2

How to read a macro's properties?

Post by Ginger470 »

So I want to find out what the max speed of a ship is... I can find the engines, but I can't seem to be able to pull the info from the macro.

This would be useful for all/any macro.... but how to do it?

Here's the macro... now how would I go about getting, say, speed 'forward'?


Thanks!

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!--Exported by: Michael (192.168.3.113) at 11.10.2013_10-33-35-->
<macros>
  <macro name="engine_player_bal_mk1_dam1_macro" class="engine">
    <component ref="generic_engine" />
    <properties>
      <identification name="{20108,101}" description="{20108,102}" unique="0" />
      <acceleration forward="30" reverse="45" strafe="60" pitch="75" yaw="75" roll="120" />
      <angular />
      <speed forward="90" reverse="-30" strafe="45" pitch="25" yaw="25" roll="60" />
      <typeinfo mk="1" type="1" />
      <hull min="250" max="1000" hittable="0" />
      <efficiency>
        <threshold threshold="1" value="1" />
        <threshold threshold="0.5" value="0.9" />
        <threshold threshold="0.25" value="0.8" />
      </efficiency>
      <sounds>
        <ambient ref="eng_player_ambient" />
      </sounds>
    </properties>
  </macro>
</macros>
Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker »

I asked the exact same question once. Nobody knew how to do it. Therefore, I assume it's not possible.
Ginger470
Posts: 158
Joined: Sun, 20. Jun 04, 03:24
x2

Post by Ginger470 »

but but but....... :?

:evil:

There has to be a point in making these macros easily editable -- seems weird that none of the definitions would be read except by functions in the exe.
iforgotmysocks
Posts: 1244
Joined: Fri, 8. Nov 13, 22:35
x4

Post by iforgotmysocks »

?? you can read most properties once a object did load them from the macro.

Just search for the component/object and check with .speed

What annoys me is that you can't set properties of macros.
You only can do that by using functions.
losthart2611
Posts: 22
Joined: Fri, 27. Dec 13, 01:04

setting speed

Post by losthart2611 »

I read in a post that you can only set speed as -1, 0 or 1 namely full reverse, full stop or full forward.

dont know if this will help
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: setting speed

Post by UniTrader »

losthart2611 wrote:I read in a post that you can only set speed as -1, 0 or 1 namely full reverse, full stop or full forward.

dont know if this will help
sounds to me like that function expects a float. dont know if this will help, too.
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 ;)
User avatar
Observe
Posts: 5341
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe »

I'm not exactly sure what you are trying to do, and I don't have access to my computer atm to verify, but if memory serves correctly, perhaps you can use something like <set_value name="$speed" exact="player.primaryship.speed"/> to get current speed and <force_player_speed speed="somenumber"/> to set it? This of course won't change the macro settings on-the-fly, but you could have your own custom engines with their own settings and use <upgrade_object_by_macro> to install those engines.

I don't know if the above has any relevance to what you are after.
Ginger470
Posts: 158
Joined: Sun, 20. Jun 04, 03:24
x2

Post by Ginger470 »

Thanks for the tips guys, but ....

Code: Select all

<find_object_component name="$MIC_engines" class="class.engine" object="player.primaryship" multiple="false"/>
returns $MIC_engines.speed = current speed, not max speed :headbang:

Return to “X Rebirth - Scripts and Modding”