Need help understanding the debugger and RPN

The place to discuss scripting and game modifications for X²: The Threat.

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

HashtagMC
Posts: 181
Joined: Sun, 23. Nov 14, 18:22
x3

Need help understanding the debugger and RPN

Post by HashtagMC »

Since I realised my game crashes are almost certainly caused by one of my scripts, I gotta figure out where exactly the issue lies. The MSCI manual is, unfortunately, quite brief on debugging, in particular RPN.

On page 25, there's a screenshot of the trace mode (which is what I'll need) and a link to an explanation of RPN (which, miraculously, isn't a dead link). The first problem arises here: the explanation linked to gives examples where all operators are after the numbers (i.e. "3 2 1 + x"), while Wikipedia gives examples where pairs of operands are followed by operators, followed by more pairs (i.e., to stick with the same example, "2 1 + 3 x").

Moreover, I can't manage to translate this principle to X2 script code. The example given in the manual, "!move.movetosector:4:1:0:580632506:0:while |ENVIRONMENT|$targetsector !=", is utterly incomprehensible to me. Where one operator or operand ends and another begins, or why these instructions look so utterly different from the quite human-readable code usually present in the editor, I can't make heads nor tails of it. I can see that some "while $targetsector != something, move to sector something" is happening, but I couldn't reconstruct the editor code from this.

Any help would be very appreciated! Best case, someone's already written up an explanation somewhere; I've searched the forum but couldn't find one.
My scripts' t-files use the namespace xx111x (e.g 491101, 441101, ... )
User avatar
Zeron-mk7
Posts: 593
Joined: Sat, 23. Feb 08, 12:38
x3

Re: Need help understanding the debugger and RPN

Post by Zeron-mk7 »

You tried to search into the other authors scripts, maybe something similar was used into the other scripts.
I myself don't understand too much about scripting, therefore, I look in other author scripts and use these scripts as example to make my own scripts.
Image

Return to “X²: The Threat - Scripts and Modding”