This is aimed mainly at roguey although any one who has an idea dont hesitate!
I am trying to implement a script into the mod. The issue is i would like to be able to use the script (and the ware it is 'linked' to) without having to install the plugin manager.... i have been trying to manipulate the setup script but without success. Bellow you will find the setup script for the script in question:
$page.id = 7540
load text: id=$page.id
* lets use the ware manager to add our wares
$stationType = Equipment Dock
@ if not [THIS] -> call script plugin.waremanager.add : ???=$stationType ???=Boron ???= ???=-1 ???=[TRUE]
* didn't add, ware manager is missing
$text = read text: page=$page.id id=2
send incoming message $text to player: display it=[TRUE]
return null
end
* add the hotkey using the hotkey manager
$key.text = read text: page=$page.id id=1
@ if [THIS] -> call script plugin.hotkeymanager.add : Hotkey Name ID='advthrust' Display Text=$key.text Hotkey Script='plugin.advthrust.hotkey'
* added fine, so lets check if we had an old one, and remove it
$key = get global variable: name='plugin.advthrust.key'
if $key
unregister hotkey $key
set global variable: name='plugin.advthrust.key' value=null
end
* not added, no hotkey manager?
else
$key = get global variable: name='plugin.advthrust.key'
if ! $key
$key = register hotkey $key.text to call script plugin.advthrust.hotkey
set global variable: name='plugin.advthrust.key' value=$key
end
end
return null
load text: id=$page.id
* lets use the ware manager to add our wares
$stationType = Equipment Dock
@ if not [THIS] -> call script plugin.waremanager.add : ???=$stationType ???=Boron ???= ???=-1 ???=[TRUE]
* didn't add, ware manager is missing
$text = read text: page=$page.id id=2
send incoming message $text to player: display it=[TRUE]
return null
end
* add the hotkey using the hotkey manager
$key.text = read text: page=$page.id id=1
@ if [THIS] -> call script plugin.hotkeymanager.add : Hotkey Name ID='advthrust' Display Text=$key.text Hotkey Script='plugin.advthrust.hotkey'
* added fine, so lets check if we had an old one, and remove it
$key = get global variable: name='plugin.advthrust.key'
if $key
unregister hotkey $key
set global variable: name='plugin.advthrust.key' value=null
end
* not added, no hotkey manager?
else
$key = get global variable: name='plugin.advthrust.key'
if ! $key
$key = register hotkey $key.text to call script plugin.advthrust.hotkey
set global variable: name='plugin.advthrust.key' value=$key
end
end
return null
First the red highlighted code needs to be removed to prevent a popup coming up when you start a game telling you the script manager is not installed. From then i have no clue what to do. i have tried changing the blue highlighted text to: @ = [This] -> call script lib.cy.addware ect but that hastn worked and also various variations of that code. still nothing.... if any one could explain to me how i can manipulated this so that when the ware thruster control is installed this script recognises that and gives you access to its abilities, that would be really helpful!
btw the ??? in the blue highlighted code are of course replaced with the correct values by the plugin manager once it is installed. to clarify that bit is not an error in the script or anything.
Thanks,
Miles