[HELP] MD Variable Lifetime and Removal

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

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

Vectorial1024
Posts: 304
Joined: Mon, 30. Jul 18, 04:16
x4

[HELP] MD Variable Lifetime and Removal

Post by Vectorial1024 »

Some questions:

What are the scope of the variables used in libraries? Will the variables listed under <params/> go out of scope after the library is complete and thus gets cleaned up by the game? Does the scope of the variables depend on how the library is used, like in <include_actions ref/> and <cue ref/>?

Also, is it absolutely required to clean-up variables by myself (i.e., explicitly use <remove_value/>)? I am worried I might create a memory leak and forget about it.

EDIT: Title
The future awaits.

X4 Foundations mods:
Civilian Fleets: (Obsolete for X4 7.0+) Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Market Discovery: Find Black Market Traders; also rerolls them.
Logistics Optimization: Improve your station traders; improve your trade stations!
User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13479
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid »

Hi,

The parameters defined in the head of a library do not need cleanup. As you suspected correctly they are used by calls of the library from other cues or scripts.

As a rule of thumb any value you define within a cue should be removed at the end (clean up).

And sorry for the delayed reply.

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

Return to “X Rebirth - Scripts and Modding”