Cue Instantiation

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

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

Post Reply
Clownmug
Posts: 418
Joined: Wed, 11. Dec 13, 02:39
x4

Cue Instantiation

Post by Clownmug » Fri, 10. Aug 18, 16:00

This is something that has bothered me for a long time. Why does having a cue set to instantiate not actually create new instances of that cue? Instead you have to create a library of what you want instantiated, then make a cue that references that library. It kind of seems likes instantiate functions no different from <reset_cue> in its current form.

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

Post by UniTrader » Fri, 10. Aug 18, 21:15

you dont have to make a lib if you want to instantiate them. works fine without that. supericially it mal look the same as reset_cue, but there are some key differences:
=> if the instantiated cue is also the namespace then each instance will have its seperate set of variables. If you use <reset_cue> then you might have values from previous runs in them (i think)
=> if an event triggers multiple times per frame (for example attacked event on multiple objects and a Area Damage Missile strikes all of them simultaneously) then the instantiated cue will spawn multiple instances in that frame, accounting for every event. If you use <reset_cue/> it might only account for the first Event because when the event is re-registered on the Group the Attack is already over.
=> Instantiated cues can have sub-cues if you want to have follow-ups. If you use <reset_cue> you technically can also have sub-cues, but you reset them each time before they can trigger, so its like they are not there..

thats the ones that come spontaneously to mind..
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 ;)

Clownmug
Posts: 418
Joined: Wed, 11. Dec 13, 02:39
x4

Post by Clownmug » Fri, 10. Aug 18, 22:17

UniTrader wrote: => if the instantiated cue is also the namespace then each instance will have its seperate set of variables. If you use <reset_cue> then you might have values from previous runs in them (i think)
Oh, so that's why some cues have "namespace=this". It seems like default namespace makes instantiated cues retain variables even if they don't have a parent cue to store them...

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

Post by UniTrader » Sat, 11. Aug 18, 00:05

in that case the static cue is the namespace i guess.. did you read the MD Guide for XR?

https://www.egosoft.com/download/x_rebi ... rGuide.pdf
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 ;)

Clownmug
Posts: 418
Joined: Wed, 11. Dec 13, 02:39
x4

Post by Clownmug » Sun, 12. Aug 18, 03:33

UniTrader wrote:in that case the static cue is the namespace i guess.. did you read the MD Guide for XR?

https://www.egosoft.com/download/x_rebi ... rGuide.pdf
Yes, along time ago and just recently to look up that namespace stuff. It's not something I'm used to. The other scripting languages I've used in the past such as Javascript and Squirrel just handle variable scope fully on their own.

Post Reply

Return to “X Rebirth - Scripts and Modding”