|
|
 |
View previous topic :: View next topic |
 |
|
|
|
|
Author |
Message |
|
|
|
|
|
Sir Warwick
Joined: 07 Feb 2004 Posts: 310 on topic Location: Reading, UK

|
Posted: Wed, 28. Dec 11, 14:44 Post subject: AP: Jobs.txt and AI Ship creation? |
|
|
Hi, I am trying to work out the ship creation for AI ships to find a point at which I can perhaps get a script to run on every ship AI that gets created that isnt a mission ship.
So looking at the jobs file, I can see config screipts for the faction ships and for modifying wares on civ ship, but I cant see an obvious default script that gets run on everything, nor an obviouis means to tell if a ship is a mission ship or not.
What I want to do is modify the active relations for some created ships, but obviously doing this to a mission ship would be bad
So Im hoping there is someone who knows how the default ship process works?
Is the answer simply that any AI created ship is going to run a !job. script and therefore if I need to make a tweak to all ships, then thats the place to do it (for my purposes it would just be inserting a this -> call script: some.script ... etc at the start of each) or is there a default that gets runs when no config script is declared in jobs.txt?
Looking through scrips I couldnt see an obvious candidate.
I guess another alternative is modifying the job.txt to add a config script for all ships that dont have one if there is not default script that gets run for every ship.
I guess the other part of this - any known way to tell if a created ship is a mission ship or not?
Thanks all
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Cycrow Moderator (Script&Mod)


Joined: 15 Nov 2004 Posts: 19863 on topic Location: London

|
Posted: Wed, 28. Dec 11, 15:37 Post subject: |
|
|
the config script is run on ship creation.
they also have a job script assigned to them, this is thier command script.
there isn't a script you can set for all ships.
the config script is the best you can do, but some scripts already have thier own.
you could assign all others to use a default one then edit all the other config scripts to also call that default script.
jobs does not include any mission ships, these are created by the MD, not by jobs
what is it ur actually trying to do ?
another way would be to use a watcher script or al plugin to tag all the ships.
it could periodically scan for all ships, if they are not tagged, then they are new ships since the last scan
_________________ My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Jack08

Joined: 25 Dec 2005 Posts: 2234 on topic Location: Australia

|
Posted: Wed, 28. Dec 11, 15:40 Post subject: |
|
|
You could hook into global seccondary signal: SIGNAL_CHANGEDSECTOR (Fires when a ship changes enviroment from x to sector, x being station, ship or sector)
Then check <RetVar> <RefObj> -> Get Job ID
from within the Fly Commands
Job ID's will always be 0 on Mission or Script spawn ships
Or:
you could also apply a global !config.whatever script to all jobs, and change the corporation !config scripts to custom ones, !config.nnmc.custom (example name), do what every need to do and then call !config.nnmc
These were the only two ways i could think of off the top of my head, ill post again if i think of any more.
_________________
 |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Sir Warwick
Joined: 07 Feb 2004 Posts: 310 on topic Location: Reading, UK

|
Posted: Wed, 28. Dec 11, 16:59 Post subject: |
|
|
Thanks both - really helpful
Whats Im actually trying to do is to modifiy the relations of some ships such that notoriety isnt such a fixed thing anymore. Ie occiosionally a ship might be hostile to a race who notoriety is neutral to this ship and perhpas visa versa if I cant find a way to make the oppsoite case work to improve relations.
Basically just to spice the race relations up an little and create some race relations movement. Conversely Im also looking for way for races to improve their notoriety to each other (trashing it while fuin is easy) - in either case, I need an oppotune point at which to apply changes to a ship.
The environment signal might actually be a good intercept rather than having to modify a huge amount of the game unnessessarily - in reality this doesnt desprately need to happen at create time, just that seemed a convenient time, but I dont want to be trawling every ship in the universe occasionally either for perf reasons - we allready have enough scripts that need to trawl through way too much to do what they need to do
Anyway - just an experiment at the moment on top of some more interesting race and faction relations stuff Im playing around with.
|
|
|
|
|
|
|
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
|
 |
|
|
|
|
|