[HELP] MD Variable Lifetime and Removal

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

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

Post Reply
Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

[HELP] MD Variable Lifetime and Removal

Post by Vectorial1024 » Thu, 23. Aug 18, 12:26

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: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

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

Post by euclid » Thu, 13. Sep 18, 14:59

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

Post Reply

Return to “X Rebirth - Scripts and Modding”