1.74.2 Loading scripts twice question.

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
SiriusCG
Dangerous
Dangerous
Posts: 73
Joined: Sat Mar 27, 2010 12:59 am

1.74.2 Loading scripts twice question.

Post by SiriusCG »

I noticed this in my log:

Code: Select all

[shipData.load.begin]: Loading ship data.
[script.load.world.listAll]: Loaded 24 world scripts:
    Anarchies 2.3
    AsteroidStorm 4.00
    Bounty Scanner 2.0 2.00
    buoyRepair 1.02.6
    Famous Planets 2 Launch Script 2.0.2
    Famous Planets Liners Script 1.0
    farsun 1.04
    FuelStation-Setup 1.31
    IronHide Armour Script 1.01
    missile_analyser 1.2
    Missiles & Bombs 1.0
    newskim
    oolite-cloaking-device 1.74.2
    oolite-constrictor-hunt 1.74.2
    oolite-nova 1.74.2
    oolite-thargoid-plans 1.74.2
    oolite-trumbles 1.74.2
    oreProcessor 1.57
    PAGroove_superhubPopulator 1.1
    Random_Hits 1.4.5
    Repair system 2.0
    rockHermit_Locator 1.3.3
    System Redux 1.2 1.2
    targetAutolock 1.10
[loading.complete]: ========== Loading complete. ==========
[script.load.world.listAll]: Loaded 24 world scripts:
    Anarchies 2.3
    AsteroidStorm 4.00
    Bounty Scanner 2.0 2.00
    buoyRepair 1.02.6
    Famous Planets 2 Launch Script 2.0.2
    Famous Planets Liners Script 1.0
    farsun 1.04
    FuelStation-Setup 1.31
    IronHide Armour Script 1.01
    missile_analyser 1.2
    Missiles & Bombs 1.0
    newskim
    oolite-cloaking-device 1.74.2
    oolite-constrictor-hunt 1.74.2
    oolite-nova 1.74.2
    oolite-thargoid-plans 1.74.2
    oolite-trumbles 1.74.2
    oreProcessor 1.57
    PAGroove_superhubPopulator 1.1
    Random_Hits 1.4.5
    Repair system 2.0
    rockHermit_Locator 1.3.3
    System Redux 1.2 1.2
    targetAutolock 1.10
[gameController.exitApp]: .GNUstepDefaults synchronized.
and this in the debug console:

Code: Select all

Initialising OXP System Redux 1.2
Famous Planets 2 Launch Script 2.0.2 loaded.
Famous Planets 2 Launch Script:  Setting Up Arrays.
Famous Planets 2 Launch Script:  System Redux 1.2 was detected by FP2WOG2
Initialising OXP System Redux 1.2
Famous Planets 2 Launch Script 2.0.2 loaded.
Famous Planets 2 Launch Script:  Setting Up Arrays.
Famous Planets 2 Launch Script:  System Redux 1.2 was detected by FP2WOG2
Two questions: Is it normal to read the OXP scripts twice? I'm assuming once during initialization, and again at loading a previous commander?

If that is the case, is system redux setting up 2 separate sets of arrays, or writing the second over the first?

I'm learning how Oolite scripting works and I appreciate the help.

Cheers.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Yes, every time you restart a game / load a savegame all the scripts are reloaded and reinitialised. This is expected behaviour, and to do otherwise tends break oxps in many wonderful, subtle & unexpected ways.

Also, and the main motivation from reloading/restarting each script afresh is the huge difference between strict and unrestricted gameplay ( saved inside savegames ): save a fresh jameson in restricted mode, then load a different save game, (one in unrestricted mode) to see what happens to the log! :)

As an aside, this cleaner scripting behaviour did result in the disappearence of the reset event as of 1.74 (and of a slew of restricted/unrestricted mode bugs...) :D


And whenever a script is reloaded, 2 things happen: the older script and all properties associated with it is deleted from memory (barring memory leaks). A complete new copy of the script and all its properties is recreated from the content of its .js file (memory representation & storage of a js script is different from the js file that generated it, sometimes radically so!)

'Writing over the first' is unlikely to ever ever happen with modern computers, but if that cassette tape analogy helps, sure! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
SiriusCG
Dangerous
Dangerous
Posts: 73
Joined: Sat Mar 27, 2010 12:59 am

Post by SiriusCG »

Thanks again Kaks. I can see the logic in getting "fresh" copies into memory.
Makes me wonder how many people actually play in restricted mode. Especially with all the cool OXPs available ...
'Writing over the first' is unlikely to ever ever happen with modern computers, but if that cassette tape analogy helps, sure!
Holy cow! I hadn't thought of that analogy in years! Now, where's that C64 tape reader ... :wink:
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Post by Cody »

SiriusCG wrote:
Makes me wonder how many people actually play in restricted mode.
Very few, if any, I reckon… I do occasionly take Oolite out in wireframe mode for a short flight. There’s something almost ‘magical’ in seeing those wireframe ships and stations and planets… a hint of nostalgia, perhaps.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
Post Reply