Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
nschlein

Registered:
Posts: 57
Reply with quote  #1 
Okay, got a fun one for you all.

I want to spawn a bunch of random ships, change them to derelicts after *mumble mumble*, and then "reactivate" the vessels after the players *mumble mumble mumble*.  (I also want this to work across mods, which is one reason I'm not using Hull IDs.)

Anyone know of a way to record and recall a randomly generated hull ID after it is created and within the same mission script?  (And no--I don't know how to write outside scripts or reference information stored in the log file.)

(Just occurred to me that I could disable ship systems and pin a generic mesh on top of them.  That might be easiest, if I can actually get the darn things to NOT MOVE, which seems to be a problem.  Would require a lot of constantly running code otherwise.)

Thanks in advance!


ryleyra

Registered:
Posts: 3,015
Reply with quote  #2 
Unfortunately, I know of no way to record the hull id of a ship, destroy it, and then recreate it without having the hull id itself to start with. Meaning it can't be random or can only be random in the sense of "I have a number of possibilities for this so-called random ship".

Another idea, though, would be to relocate your original ship along the Y axis, and immobilize it so it can't move. IIRC you can set enemy ships at y locations above 500 or below -500, they will just tend back towards the "valid" plane as long as they can move. The ship should be invisible as long as it is out of sensor range, but you'd have to set range to something other than Unlimited. If not, you will have the ship icon and the derelict icon on top of each other, which might be acceptable.
Darrin

Registered:
Posts: 168
Reply with quote  #3 
Quote:
Originally Posted by nschlein

I want to spawn a bunch of random ships, change them to derelicts after *mumble mumble*, and then "reactivate" the vessels after the players *mumble mumble mumble*.  (I also want this to work across mods, which is one reason I'm not using Hull IDs.)


Hmm. Sounds a little similar to Mike's "Mission to Hell". When you go to the Hell sector, it's full of derelicts that come to life/reactivate as you get close to them. 

Quote:
Originally Posted by nschlein

Anyone know of a way to record and recall a randomly generated hull ID after it is created and within the same mission script?  (And no--I don't know how to write outside scripts or reference information stored in the log file.)


Well, you can number all the possible hull IDs 1 through X, generate a random integer between 1 and X, and save the value of that integer in another variable. The code could then iterate through all the possible HullIDs until it found the one that had been randomly selected. You could brute-force it, but it would be long and tedious to write. Assuming it's stock Artemis 2.7.5, there aren't an exceptionally large number of HullIDs? And you might want to sort out stuff like stations, cargo tugs, etc. 

Does it have to be absolutely random? Would semi-random work? For example, if there were only 10-12 possible ships... for a player that hadn't played through the mission multiple times, it would look pretty random even though there are only a limited number of possible ships. That would cut down a little of the tedious codework.  

Quote:
Originally Posted by nschlein

(Just occurred to me that I could disable ship systems and pin a generic mesh on top of them.  That might be easiest, if I can actually get the darn things to NOT MOVE, which seems to be a problem.  Would require a lot of constantly running code otherwise.)


The Science scanner would still show it as an active shielded ship rather than a wreck/derelict. You can disable impulse/maneuver on ships, but they will self-repair if you don't keep disabling them every few seconds or so. Getting them to hold still is also tricky... I've had some success with using POINT THROTTLE to tell the ship to go to the exact point where I created it with Throttle 0.0, but it may still wiggle a bit. 

Quote:
Originally Posted by ryleyra

Another idea, though, would be to relocate your original ship along the Y axis, and immobilize it so it can't move. IIRC you can set enemy ships at y locations above 500 or below -500, they will just tend back towards the "valid" plane as long as they can move. The ship should be invisible as long as it is out of sensor range, but you'd have to set range to something other than Unlimited. If not, you will have the ship icon and the derelict icon on top of each other, which might be acceptable.


I haven't had much success with hiding ships at the top or bottom of the Y axis. They have a habit of showing up anyway, even with sensor ranges limited. I believe the weapons console, for example, will show a ship as "nearby" within the x/z range even if the y coordinate is outside sensor range. 


 
nschlein

Registered:
Posts: 57
Reply with quote  #4 
Thanks. That actually helps a lot.

I’m building this for a quantity neutral scenario, with 8 Neutral ships per player ship. Each ship is pulled from its own limited list of ships, with identical pull lists for each additional player. The idea is the ships have been damaged/destroyed by an event and the players are needed to provide assistance.

Moving them out of sensor range should work beautifully.
ryleyra

Registered:
Posts: 3,015
Reply with quote  #5 
If moving them out of sensor range in the Y coordinate doesn't work, you can always move them to an inaccessible part of the map. Unfortunately, you can't move them outside of the 100,000 x 100,000 grid but you can block off that part of the map where you "hide" the ships.

If you really want to get sneaky, move them to the edge of the map opposite from the ship's current location.
HaydenBarca

Registered:
Posts: 221
Reply with quote  #6 
Yeah, taking advantage of the "nebula blocks scanners" tag you could either:
1) Make one corner of the map a nebula surrounded by mines and "store" the ships there
2) (maybe) use Ryley's idea of moving it above the legal Y axis and see if you can create a nebula up there as well to block scanners

Ryan
nschlein

Registered:
Posts: 57
Reply with quote  #7 
Ok, one wrinkle: these are allied neutral ships. Won’t they provide sensor data?

I’m thinking that changing their side value while “off-screen” would alter that behavior. Anyone know if that is true?
HaydenBarca

Registered:
Posts: 221
Reply with quote  #8 
Strangely enough, allies won't provide sensor data if they don't show up on a map due to "nebula blocks scanners".  Surely a bug, but it might be helpful to you until/if it's fixed.  You can set up a quick test to confirm, but I observed this recently.
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.