Nexus Modding > Scripting
Scripting Issues
Mularac:
odd... that's pretty similar of what I did... (well, almost identical, in fact...) how many wrecks did you place?
The Old Dragon:
Erm... about nineteen or twenty.
It's also worth mentioning that when that particular area is loaded, they're the only ships in the area to begin with, apart from the player that is. Any other objects that count towards the ship total are to be added by random(ish) scripts.
Could it be that you're trying to place all the ships/objects in the scene in one go? And therefore exceeding the game limit?
Mularac:
yeah... that's clearly it. I have about 40 or so wrecks flying arround :P
Arparso:
The ship limit is about 28, isn't it?
Anyway, there actually is a way you can make any ship behave like an asteroid and not contribute to the ship limit right from the start. Copy & Paste⢠the following snippet to the ENTITIES block at the bottom of your .mission file:
--- Code: ---SHIP
Name "Ast.01.003"
Class #my_shipclass
Behaviour 4
Position 4934.08 -4970.09 4627.69
Orientation 8.22877 41.7865 -14.8206
END
--- End code ---
Of course, replace the class, position and orientation as needed, preferably using the mission editor for both position and orientation unless you enjoy entering lots of numbers by hand ;)
You can use any shipclass this way, no matter if it's an asteroid, battleship or escape pod. They don't contribute to the amount of ships in the scene, so the game won't crash no matter how many of them you add (unless we're talking thousands, I guess).
The Old Dragon:
Hey Mularac,
May have a solution for you, unfortunately it does mean you've got some work to do.
The first version is the simple, no frills approach. What you need to do locate your 'wrecks' in the entities section (if you're in a modmission or in the .sobj files for campaigns) and do some editing...
1) Remove the 'race' entry.
2) Change the 'shiptype' to its 'class'.
3) Add the entry "Behaviour 4"
The ship/wreck shouldn't now count towards the ship total. On the plus side, you should now have your graveyard. Downside... the 'wrecks' will now just sit there, no rolling or damage and not particularly realistic.
Now my second version will look better (hopefully) but requires a bit more work.
First of all, do the above steps, then add this machine to your mission file...
--- Code: ---MACHINE "Wrecker"
STATE Default
RULE event In
:action
//You'll need to list name and list any ship you want to be a wreck in here...
*******:=GetSceneObj("*******");
//(Repeat for each)
Wrecks:=GetFreeSel();
AddItem(Wrecks,*******);
//And call the second half
LocalEvent(Alter);
:END //end action
END //end rule
RULE event Alter
:action
//Pick and alter 'wreck'.
M.Change:=Pick(Wrecks);
M.Change:behaviour:=0;
M.Change:damage:=65;
M.Change:Behaviour:=4;
//Rinse and repeat if required...
RemoveItem(Wrecks,M.Change);
M.Change:=0;
If(AllNumOf(Wrecks)>0,LocalEvent(Alter));
:end //end action
END //end rule
END //end state
END //end machine
--- End code ---
Now you'll need to fil in the first rule. Each wreck will need to be named and then manually added to the list I'm afraid. I did look into other ways of selecting them, but for one reason or another, they ended up as duds, so it's time to start typing.
My missions have a three to five second 'fade in' period (normally), so if the machine is triggered to run straight away then the player will be none the wiser.
EDIT:
Just my luck, I start answering a post and someone beats me to it, lol :D
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version