EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
«RetVar/IF» «RefObj» is autojump activated / return value
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
lostProfitssssArrgh





Joined: 22 Aug 2017

Location: Unknown Sector(23,19)

PostPosted: Sat, 9. Sep 17, 07:06    Post subject: «RetVar/IF» «RefObj» is autojump activated / return value Reply with quote Print

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

Back to top
View user's profile Send private message
Joubarbe





Joined: 31 Oct 2006
Posts: 2566 on topic
Location: France
Thank you for registering your game
PostPosted: Sat, 9. Sep 17, 08:43    Post subject: Reply with quote Print

Why would you check this value in the first place? Smile


_________________
Mayhem - Satellites Monitoring - Internal Distribution Network - ADS (Joubarbian Edition) - Bounty Board - The Joubarbian Toolkit - EasyConnect
Back to top
View user's profile Send private message
lostProfitssssArrgh





Joined: 22 Aug 2017

Location: Unknown Sector(23,19)

PostPosted: Sat, 9. Sep 17, 09:12    Post subject: Reply with quote Print

Why shouldn't I check it..? Razz

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

* 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:

* 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.

Back to top
View user's profile Send private message
Litcube





Joined: 20 Oct 2006
Posts: 4167 on topic
Location: Canada
Thank you for registering your game
PostPosted: Sat, 9. Sep 17, 09:25    Post subject: Reply with quote Print

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


_________________


Litcube's Universe Wiki
Back to top
View user's profile Send private message
lostProfitssssArrgh





Joined: 22 Aug 2017

Location: Unknown Sector(23,19)

PostPosted: Sat, 9. Sep 17, 09:28    Post subject: Reply with quote Print

Yes. LU 1.7.2 and Mayhem 2.1.3.

Back to top
View user's profile Send private message
Xenon_Slayer
EGOSOFT
EGOSOFT



Joined: 09 Nov 2002
Posts: 10721 on topic
Location: Camping the North Gate of Black Hole Sun
Thank you for registering your game
PostPosted: Sat, 9. Sep 17, 11:35    Post subject: Reply with quote Print

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

Back to top
View user's profile Send private message Send e-mail
lostProfitssssArrgh





Joined: 22 Aug 2017

Location: Unknown Sector(23,19)

PostPosted: Sat, 9. Sep 17, 11:44    Post subject: Reply with quote Print

@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)

Back to top
View user's profile Send private message
Xenon_Slayer
EGOSOFT
EGOSOFT



Joined: 09 Nov 2002
Posts: 10721 on topic
Location: Camping the North Gate of Black Hole Sun
Thank you for registering your game
PostPosted: Sat, 9. Sep 17, 12:04    Post subject: Reply with quote Print

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.

Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic Reply to topic
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Wed, 20. Sep 17, 07:34

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.15863 seconds, sql queries = 22