NPC cargo: three questions #715
will that ship be allocated cargo?
Thanks. EDIT: I find the following. If in shipdata I set |
Replies: 6 comments 1 reply
|
1-Setting max_cargo = 2 only defines the capacity of the ship's hold. Because your ship is using nullAI.plist and lacks a specific trading role, the game engine won't automatically fill it. 2-It will spawn empty. Standard cargo assignment functions look at the current system's planetary market data (exports/imports). Because interstellar space doesn't have a local economy, those market functions fail. Depending on the script, it will either throw a silent error or fall back to generic items like food. 3-And for why isHulk breaks your scripts (Regarding your edit) |
|
Dear Ahmed Thank you. Do you think then that I ought to revert to my previous - and, I had though, inefficient - way of doing things? To wit:
EDIT: After an escape pod has been ejected, a ship becomes white on the scanner, yes? However, |
|
I add the following. I am getting a hard crash - to desktop, with nothing in the log - when my ship-script does when the EDIT: ah, actually, the crash occurs when I do |
|
You're checking You could avoid using the |
|
And if you want to make a ship derelict without using the is_hulk property, do something like this: Just pass your ship object to this function. |
|
phkb: marvellous. Thanks to you and to Ahmed. |
I’d probably go back to the original approach, but remove 'is_hulk = yes'.
'max_cargo' is just the capacity, so it won’t automatically give the ship cargo. Having the script handle the cargo pods on destruction seems reasonable.
Also, I wouldn’t assume 'is_hulk' is the reason the script doesn’t run. The crash on 'this.ship.explode()' sounds like a separate issue. Since 'spawn("cargopod", 1)' works by itself, I’d test 'explode()' on its own and see whether that still crashes.
So basically:
plist
scan_class = "CLASS_CARGO";
script = "IST_derelict_dead.js";
and leave out "is_hulk".
The yellow scanner color is probably just the hulk/derelict classification, so you’d lose that by doing this, b…