Anyone know any resource or simple method whereby I can obtain the exact notoriety gains/losses caused by killing enemy/friendly ships?
Well, you can simply use the SIGNAL_KILLED to see, when a ship was killed.
You then keep track of the notorieties to every race and calculate the difference.
However I'm not sure if the notoriety changes before or after the SIGNAL_KILLED and all attached secondary signal scripts are executed - but either way would work, you'd just interpret the results differently.
Sorry bout the constant questioning but I can only get it to work on player ship how do I make it so ANY ship with the ware will automatically run the script?
EDIT: actually it doesn't work what is wrong with this code
skip if [PLAYERSHIP]->get amount of ware {Shield Booster} in cargo bay
return null
$shield.max = [PLAYERSHIP]->get maximum shield strength
= wait 12000 ms
$shield.per = [PLAYERSHIP]->get shield percent
while $shield.per < 100
$shield.add = $shield.max / 10
[PLAYERSHIP]->add shields per value:$shield.add
$shield.per = [PLAYERSHIP]->get shield percent
end
First, the 'wait' needs to be inside the 'while' loop to get it to pause between each loop, as it is the loop will just cycle without a pause. Also you need to get the current shield strength and then add the desired amount and use the 'set current shield strength' command.
Im not sure '[PLAYERSHIP]->add shields per value:$shield.add' would be the best command to use here.
skip if [PLAYERSHIP]->get amount of ware {Shield Booster} in cargo bay
return null
$shield.max = [PLAYERSHIP]->get maximum shield strength
$shield.add = $shield.max / 10
$shield.per = [PLAYERSHIP]->get shield percent
while $shield.per < 100
$shield.current = [PLAYERSHIP]-> get current shield strength
$shield.new = $shield.current + $shield.add
skip if $shield.new < $shield.max
$shield.new = $shield.max
[PLAYERSHIP]-> set current shield strength to: $shield.new
= wait 12000 ms
$shield.per = [PLAYERSHIP]->get shield percent
end
$shield.1 = {ZA_EMP_10623_BLANK_WARE_CUSTOM18_3}
$shield.2 = {ZA_EMP_10633_BLANK_WARE_CUSTOM19_3}
$shield.3 = {ZA_EMP_10643_BLANK_WARE_CUSTOM20_3}
$hol = get sector from universe index: x=1, y=4
$exister = find station: sector=$hol class or type={Dok z wyposażeniem} race={Argoni} flags=null refobj=null maxdist=null maxnum=null refpos=null
if $exister->exists
$exister->add product to factory or dock: $shield.1
$enchk.1 = $exister->get amount of ware $shield.1 in cargo bay
skip if $enchk.1 != 0
= $exister->add 5 units of $shield.1
$exister->add product to factory or dock: $shield.2
$enchk.2 = $exister->get amount of ware $shield.2 in cargo bay
skip if $enchk.2 != 0
= $exister->add 5 units of $shield.2
$exister->add product to factory or dock: $shield.3
$enchk.3 = $exister->get amount of ware $shield.3 in cargo bay
skip if $enchk.3 != 0
= $exister->add 5 units of $shield.3
end
return null
And one more thing there is command "add 5 units (...)" and in factory there is only 2 items...
Question: Are there any Special characters used by Tfiles?
e.g. I know that \033 are for colour tags
And [xxx] has some special properties
Basically what I need to do, is put an xml-like object into a single tfile entry, and I'm not to sure which characters I can use.
I wanted to []'s (and I've used them before as straight text) but I don't know what will happen if I use lots of them (e.g. one object might have something like... 30 pairs of []'s and they will be nested inside each other.
(In short, I just want to know if my game will explode, or run fine --- or if any one has better suggestions for opening/closing characters)
Brackets [] will only work if you escape them with backslashes \. Otherwise the game won't recognize them (e.g. for regular expressions). The same is true for normal brackets ().
Maybe you could try curly braces {} as opening and closing characters - but I never tried that, so you might have to escape them, too.
Unfortunately, curly braces are used for text referencing
e.g. {17,1401} {pageid,textid}, and i do plan on passing lots of numbers through (so the chance of issues arising is high)
Are you sure [] need escape characters?
As I use them in my menus with no issues
<t id="1011">[-] \033Y%s\033X</t>
<t id="1012">[+] \033Y%s\033X</t>
(I haven't tried it with any thing more complex thou)
The other idea I was thinking of was to use completely random characters like #@$%^* (But not &'s because they are special)
[]'s are screwy in the logbook, but work for menus and ship names. I've used {} for ship names and it works fine for the logbook. ()'s are for putting comments in the XML file, so you have to escape them to use them, but once escaped they work anywhere afaik.
If you're interested in storing complex data structures in the t-file, why not try JSON?
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.
Unfortunately, curly braces are used for text referencing
Ah, right. I forgot about that...
Are you sure [] need escape characters?
Well, I tried to use them for regular expressions, which didn't work in the first place. So I tried to output them to the logbook and they didn't show up until I escaped them. But as ThisIsHarsh pointed out, this seems only to be a problem of the logbook.
And since brackets don't seem to be interpreted in any way by the game there should be no problems when nesting them.
Thanks for the suggestions everyone. That JSON script looks very interesting (And I'll look into it for my x3-online ideas) but I've decided to just stick with [] for now, as I'm using a very simple structure of
object -> [name=property[childobject][childobject2].....]
(Where there are 0-n child objects, and the child objects are the same as the parent)
TrixX wrote:Any info as to why the M0 class is bugged? I've seen a lot of references to it, and hence things like the Valhalla are M2 rather than M0...
Just curious for future plans is all
OK need to expand on this. Where are the ship classes defined? Need to alter a couple of them
M0 is not a defined object class (or at least not an enabled definition), leading to problems. I imagine, because it is so firmly rooted in the game engine and in so many different aspects of the game, that these object classes are hard-coded and therefore not open to modding.
As to whether this is indeed the issue, I have no idea..Pure speculation on my part . Also, big (arbitrary) community arguments over what an M0 should be...
I use the X3editor to change the classes of a particular ship so I can utilize it with a mod (Production modules mod) its an M2 but to use the modules you need an M1. turns out you can't change classes via editor because the classes are hardcoded in OBJ files?
can anyone provide some insight into this?
also editing Docking slots through the editor dont seem to do much either, a vessel I had with 2 docking slots despite being a sizely M7, I wanted to increase that to 8, but it does not transition into game even if it shows in the editor, any help with this as well?
does anyone knows if there is a way to edit stations proprieties?
For example creating/moding a factory mine that would collect another ressource than the expected ones(example, getting a gold mine)?
Amon-ra wrote:I use the X3editor to change the classes of a particular ship so I can utilize it with a mod (Production modules mod) its an M2 but to use the modules you need an M1. turns out you can't change classes via editor because the classes are hardcoded in OBJ files?
can anyone provide some insight into this?
also editing Docking slots through the editor dont seem to do much either, a vessel I had with 2 docking slots despite being a sizely M7, I wanted to increase that to 8, but it does not transition into game even if it shows in the editor, any help with this as well?
X3 editor 2
more info required:
was it 2 internal bays or 2 external clamps?
If the latter then the only way to add docking space is to add the clamps and dummies etc in the scene files.
well i have 2 ships one which I gave up on it had 2 clamps, that I believe requires some model editing, I can do, don't know how yet and semi-uninterested. the second ship which poses the same issue has 1 docking bay and can field a total of 6 ships below M7, same dilemma can you give information as to how I am to go about increasing the Docking slots and size class of this ship M2 into M1.
(It can externally dock 2 TM's btw, its internal docking however is limit to 6.)
Why am I doing this? I wanted a mobile vessel with good armaments as a Base ship, since in a bit my universe is going to go to hell, I need to keep moving and bolster defenses for allies (if any ) under the assualt.