EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
Unknown freeze
Post new topic This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic
Author Message
Joubarbe





Joined: 31 Oct 2006
Posts: 3509 on topic
Location: France
Thank you for registering your game
PostPosted: Fri, 2. Feb 18, 11:13    Post subject: Unknown freeze Reply with quote Print

I've got that code:

Code:

$sector = [SECTOR]
$support = $sector-> get local variable: name='mayhem_secStatsSupport'

*do if [THIS] -> call script 'Mayhem.IsPerkUnlocked': perk='Extra factory support'
*$support = $support + 4

$allStations.size = [NULL]-> call script 'Mayhem.GetNbPCFactories' : sector=$sector
$people = [THIS]-> get local variable: name='mayhem_people'


Nothing fancy... But if I uncomment the two lines in the middle, the game doesn't run anymore, it freezes.

The same call is made in several places, without problem. This call in this code is NOT made upon game start.

I've tried to create another script with a different name and the same code, as I already had problem with X-Studio or another obscure reason. But that doesn't work either.

Funny thing is when the freeze occurs at game loading, the game still take 25% of my proc and keeps filling the RAM.


_________________
Mayhem - Satellites Monitoring - ADS (Joubarbian Edition) - The Joubarbian Toolkit - EasyConnect
Back to top
View user's profile Send private message
Joubarbe





Joined: 31 Oct 2006
Posts: 3509 on topic
Location: France
Thank you for registering your game
PostPosted: Fri, 2. Feb 18, 15:33    Post subject: Reply with quote Print

Code:
START [THIS] -> call script 'Mayhem.IsPerkUnlocked': perk='Extra factory support'


The game loads.

Code:
= [THIS] -> call script 'Mayhem.IsPerkUnlocked': perk='Extra factory support'


The game freezes.

---

EDIT: when I type the "do if... call script" line in the in-game editor, the game freezes right after I save the script...!

EDIT2: recreated the script with another name, and now it works... Probably X-Studio, we'll never know...!


_________________
Mayhem - Satellites Monitoring - ADS (Joubarbian Edition) - The Joubarbian Toolkit - EasyConnect
Back to top
View user's profile Send private message
|K.O.S.H.





Joined: 19 Dec 2003
Posts: 3121 on topic

Thank you for registering your game
PostPosted: Mon, 5. Feb 18, 10:15    Post subject: Reply with quote Print

what does the script do?

the game usually freezes on infinite loops or stack overflow.
does it call itself?


_________________
Wing Commander Mod - German Topic
06.07.11 - v1.1 RELEASED!
Back to top
View user's profile Send private message
JSDD





Joined: 21 Mar 2014
Posts: 817 on topic
Location: Belt of Aguilar ... JSDD Headquarters
Thank you for registering your game
PostPosted: Mon, 5. Feb 18, 11:21    Post subject: Reply with quote Print

Joubarbe wrote:
... The game loads. ...


is this in a "init." or "setup." script ? i remember that in case of setup/init scripts the actions must not take a long time, otherwise some errors (skipping that script etc) can occur. see gazz's delayed mars setup (for example) to circumvent possiple errors ... start a global script which waits for about 10-30seconds, then do the "heavy" setup

START X -> call script is NOT a blocking instruction, which means that the script will be invoked BUT the invoking script executes without waiting for the return of the invoked script.

without START prefix, it is a blocking instruction, which means this script waits for the return of the invoked script.

do if xyz -> call script: ... is also a blocking instruction, it waits for the return and uses the return value for the logical operation "do if" (or "skip if").


_________________
To err is human. To really foul things up you need a computer.
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.


Mission Director Beispiele
Back to top
View user's profile Send private message
|K.O.S.H.





Joined: 19 Dec 2003
Posts: 3121 on topic

Thank you for registering your game
PostPosted: Mon, 5. Feb 18, 11:42    Post subject: Reply with quote Print

START starts the script a new/separate thread Smile


_________________
Wing Commander Mod - German Topic
06.07.11 - v1.1 RELEASED!
Back to top
View user's profile Send private message
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20530 on topic
Location: London
Thank you for registering your game
PostPosted: Mon, 5. Feb 18, 12:02    Post subject: Reply with quote Print

The reason it works when using START is because, scripts that are started on another process dont have a return value.

so your do if is always false

to be extra safe, you could check if $support is actual equal to something, and if not, set it to 0

Code:

skip if $support
  $support = 0


in MSCI, 0, null and [FALSE] are all different values


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Joubarbe





Joined: 31 Oct 2006
Posts: 3509 on topic
Location: France
Thank you for registering your game
PostPosted: Mon, 5. Feb 18, 12:09    Post subject: Reply with quote Print

Please close this thread. Thanks.


_________________
Mayhem - Satellites Monitoring - ADS (Joubarbian Edition) - The Joubarbian Toolkit - EasyConnect
Back to top
View user's profile Send private message
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)

MEDALMEDALMEDAL

Joined: 02 Apr 2006
Posts: 20781 on topic

Thank you for registering your game
PostPosted: Mon, 5. Feb 18, 12:24    Post subject: Reply with quote Print

*click*

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic This topic is locked: you cannot edit posts or make replies.
 
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 Sun, 23. Sep 18, 21:39

All times are GMT + 2 Hours

[ Disclaimer / Impressum ] | [ Privacy Policy / Datenschutz ]

Board Security

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