«RetVar/IF» «RefObj» is autojump activated / return value

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

«RetVar/IF» «RefObj» is autojump activated / return value

Post by lostProfitssssArrgh » Sat, 9. Sep 17, 07:06

Hello,

I noticed that the command :
«RetVar/IF» «RefObj» is autojump activated

returns 2048 when true, instead of 1 like "«RetVar/IF» «RefObj» exists", for example.

Is this normal? If so, why 2048 instead of 1?

Thanks,
-lpa

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Sat, 9. Sep 17, 08:43

Why would you check this value in the first place? :)

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Sat, 9. Sep 17, 09:12

Why shouldn't I check it..? :P

I came across this because of a CmdChk prerequisite written like this:

Code: Select all

* check autojump
$autoJ = $Ship-> is autojump activated
skip if $autoJ == [TRUE]
    return [CmdConCheck.Disabled]
and wondered why the command would be locked no matter what.

So after printing the return value to the logbook to verify it and noticed that it gives 2048 instead of 1, I changed the condition to:

Code: Select all

* check autojump
$autoJ = $Ship-> is autojump activated
skip if $autoJ
    return [CmdConCheck.Disabled]
to make it work.

I'm just curious to know whether having 2048 as return value on a true/false check is intended and what would be reason to do so.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Sat, 9. Sep 17, 09:25

Huh. This sounds like a bug. This is LU, right?

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Sat, 9. Sep 17, 09:28

Yes. LU 1.7.2 and Mayhem 2.1.3.

Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13093
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer » Sat, 9. Sep 17, 11:35

Does the returned value change whether autojump is active or not? And does the 'is emergency jump activated' command have the some problem?

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Sat, 9. Sep 17, 11:44

@Xenon_Slayer

Yes, the value changes. It's 0 when autojump is off and 2048 when autojump is on.

---

I just checked 'is emergency jump activated', and it apparently has a similar problem: returns 0 when off and 4096 when on. (tested on PLAYERSHIP and another ship. shield threshold % doesn't affect the return value)

Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13093
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer » Sat, 9. Sep 17, 12:04

Whoops, looks like it's returning the flag value. Will poke someone to take a look into that.

In the meantime, you'll have to check whether those commands return 0 or not.

Thanks for reporting it.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”