Scripting question Tships choices

Home Board Index » X3AP » Scripts and Modding » Scripting question Tships choices

RobertSchafer

RobertSchafer avatar
Level badge Skillguey (7)
Posted 10 years ago.

Hey again,

I have a question concerning scripting. I have no experience scripting what so ever so please forgive me if what im asking is impossible!

Ide like to allow the player to choose between a ship with two different types of configurations (e.g same ship as a missile boat or the same ship with general weaponry - this would be defined in tships of course i think). Now i understand how to created the 'Question' script in game but i have no clue how to integrate that with what i explained above or whether its even possible, would anyone be able to help?


---- X3ap Battlestar Galactica mod ----
Latest update: 06/01/2014.
Team recruitment: Texture artist
Mod updater/downloader via our website:
www.x-battlestar.com
Roguey

Roguey avatar
Level badge Trueguey (22)
Posted 10 years ago.

hmm.. well it depends. If your creating a new custom universe, the game checks for a script galaxy.<name>.initplayership at creation, and then runs it. This script sets up the current ship, credits, rep etc. So you could do then, or tell that script to run another async (I suggest that way, cos the other may lock-up the game).

However for vanilla starts I think its hard coded; however you could do a little script that is ran when game is loaded/started. To do this name it as an setup.[name] script, then at the start check to see if a global varible is set. If not carry on with the script, and then set the global variable to stop it from running again (setup. scripts are ran everytime a player loads in a game, or starts a new game):

$HasScriptRan = get global variable: name='myScript.Name'

if ( $HasScriptRan == [FALSE] )

* Set the value to say we ran out script, so it wont again after each load
set global variable: name='myScript.Name' value=[TRUE]

end


You may have some problem forcing the player to the new ship although, so you may end up leaving their first ship alone. In the custom-game start you could give the player a space-suit, then spawn the ship of their choice.

RobertSchafer

RobertSchafer avatar
Level badge Skillguey (7)
Posted 10 years ago.

Thanks for the help roguey, ile have a look into it, seems relatively complicated though haha :P

Thanks,

Robert

---- X3ap Battlestar Galactica mod ----
Latest update: 06/01/2014.
Team recruitment: Texture artist
Mod updater/downloader via our website:
www.x-battlestar.com
1


You need to log-in to post here.