|
|
 |
View previous topic :: View next topic |
 |
|
|
|
|
Author |
Message |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 13374 on topic Location: Mapping beyond the Unknown Regions.

|
Posted: Mon, 26. Mar 12, 05:47 Post subject: Global variables in AP ? |
|
|
An odd thing started yesterday. No idea why.
I have a setup script coded to display some messages the first time its run and sets a global variable to true.
Second time its run, it sets the glabal variable to "DONE" and then does a set of messages and script calls.
Third time and after, its supposed to do nothing.
I added a new script to the 2nd run section yesterday, and now the 2nd section messages are sent every time you load, but the scripts are not being rerun.
Why would messages get continually resent when the rest of the code is obviously not being run ? (I can tell because they involve station creation and there are no duplicates).
_________________ Apricot Mapping Services HQ
CLICK HERE for : X3R/TC Handbook; X3R, TC and AP Guides, Mods, & Scripts; X3R, TC and AP Downloads
Apricot X3 Forum |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
LV Moderator (Script&Mod)


Joined: 06 Nov 2002 Posts: 6299 on topic Location: The Dark Side

|
Posted: Mon, 26. Mar 12, 18:22 Post subject: |
|
|
put the code up
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 13374 on topic Location: Mapping beyond the Unknown Regions.

|
Posted: Tue, 27. Mar 12, 03:32 Post subject: |
|
|
| Code: |
$PageID = 8686
load text: id=$PageID
@ = [THIS] -> call script 'apricot.blueprints' :
@ = [THIS] -> call script 'apricot.reveal' :
*send incoming message 'Known sectors have been updated courtesy of the Apricot Mapping Service.' to player: display it=[TRUE]
* For higher compatibility the script installs itself on the SECOND chance.
$AMS.BEGIN = get global variable: name=$AMS.BEGIN.TEST
if not $AMS.BEGIN
|set global variable: name=$AMS.BEGIN.TEST value=[TRUE]
|send incoming message 'The AMS Mod will start after your next load.' to player: display it=[TRUE]
|send incoming message 'Before saving, please activate the in-game Script Editor.' to player: display it=[TRUE]
|send incoming message 'Please save your game as soon as possible, then load that save.' to player: display it=[TRUE]
|return null
else if $AMS.BEGIN == [TRUE]
|set global variable: name=$AMS.BEGIN.TEST value='DONE'
|send incoming message 'Welcome to the Apricot Mapping Service Mod.' to player: display it=[TRUE]
|send incoming message 'You should now setup hotkeys for AMS tools, and it is suggested you save again.' to player: display it=[TRUE]
|send incoming message 'Each game load, known sectors will be updated courtesy of the AMS.' to player: display it=[TRUE]
|
*= [THIS] -> call script ap.setup.apricot.abeam :
*= [THIS] -> call script ap.setup.apricot.beamdock :
*= [THIS] -> call script ap.setup.apricot.cbeam :
*= [THIS] -> call script ap.setup.apricot.claim :
*= [THIS] -> call script ap.setup.apricot.dbeam :
*= [THIS] -> call script ap.setup.apricot.jump.to.derelic :
*= [THIS] -> call script ap.setup.apricot.PHQ.MO : Ship to be added=null Race who sells it=null
*= [THIS] -> call script ap.setup.apricot.ship.equip :
*= [THIS] -> call script ap.setup.apricot.strip :
@ |= [THIS] -> call script 'ap.setup.apricot.superstore' :
@ |= [THIS] -> call script 'ap.setup.apricot.superstore.EoL' :
@ |= [THIS] -> call script 'ap.setup.apricot.superstore.FR' :
@ |= [THIS] -> call script 'ap.setup.apricot.superstore.LH' :
*$Mode = [THIS] -> call script ap.setup.apricot.ships.in.shipya : Ship to be added=null Race who sells it=null
else
*send incoming message 'AMS Mod - not first or second load.' to player: display it=[TRUE]
|return null
end
return null
|
Its these 3 messages that continually post when the game starts.
| Code: |
|send incoming message 'Welcome to the Apricot Mapping Service Mod.' to player: display it=[TRUE]
|send incoming message 'You should now setup hotkeys for AMS tools, and it is suggested you save again.' to player: display it=[TRUE]
|send incoming message 'Each game load, known sectors will be updated courtesy of the AMS.' to player: display it=[TRUE] |
_________________ Apricot Mapping Services HQ
CLICK HERE for : X3R/TC Handbook; X3R, TC and AP Guides, Mods, & Scripts; X3R, TC and AP Downloads
Apricot X3 Forum |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 13374 on topic Location: Mapping beyond the Unknown Regions.

|
Posted: Tue, 27. Mar 12, 15:02 Post subject: |
|
|
Ok, I found the problem.
It was Bounce. If you start bounce inside a setup script after sending player messages, the messages get repeated every time the game loads.
But when I changed it to call a controller script on the 3rd load, which sent a message, called bounce and then sent another message, it works as it should.
*begin rant* There is something seriously wrong somewhere in the game that an intensive process run with other tasks buggers things up like this. *end rant*
_________________ Apricot Mapping Services HQ
CLICK HERE for : X3R/TC Handbook; X3R, TC and AP Guides, Mods, & Scripts; X3R, TC and AP Downloads
Apricot X3 Forum |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
|
|
 |
|
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
|
 |
|
|
|
|
|