CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1386434801
Reply with quote
#1
Hi, A friend of mine's trying to build a cloaking device. Has anyone figured out a way to turn a player's ship invisible? I think I know how you'd do it from an A.I. standpoint but what if you literally wanted to vanish from the main viewer? My friend had the idea of replacing the ship's texture maps with something transparent or maybe camouflaged. The problem is he'd like the player to cloak and uncloak at will, which would mean a texture change in the middle of the mission. I can't think of a way to do that without destroying/replacing the ship, but doing that to a player ship would probably fail the mission.... Kinda stumped on this one. Ideas welcome. Thanks, CmdrNooblet
Charlie
Registered:1374978813 Posts: 347
Posted 1386448981
Reply with quote
#2
In a mission script if u destroy a ship and replace it you can take out the mission end parameter for that moment and return it right after the ship has cloaked or uncloaked. Not sure if that solves all of what u are trying to do but i hope u figure it out.
CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1386467463
Reply with quote
#3
Hey thanks Charlie. Unfortunately it's not really a "mission fail." I don't have a fail script on my test map. When the player ship blows up the game client just doesn't know what to do and immediately ejects you, or (more often) crashes the game. I can create a second player ship but I doubt it'll swap client control to another vessel. Also if I'm creating a player ship with a mission script, I don't seem to have any control over the type of ship it is, so I wouldn't be able to switch with an "invisible-textured" ship. I also tried making a "neutral" ship and gave it the ID of a player, but the game still won't let you assume player control of a new ship when the original player is destroyed. I don't suppose anyone's made a mod with a player cloaking device? I'm a newbie who knows almost nothing of scripting and mostly just relies on the editor, so I don't know if there's a way to hack a solution. Maybe I'm missing something here. My friend's more competent but it's stumping him too....
Mike Substelny
Administrator
Registered:1375273622 Posts: 2,990
Posted 1386597126
Reply with quote
#4
When I saw this topic I assumed you meant the AI. Making the third person player ship invisible is a different story. You might do this with a little work and a generic object. Consider:Create a generic object with the 3-D model for the player ship but paint it black (or camouflage). Whenever the cloaking device is active, use copy_object_property to place that generic object on top of the player ship and keep it there. When the cloaking device is deactivated either destroy the generic object or place it somewhere where it won't be seen.
__________________"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight." - Winston Churchill
CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1386626336
Reply with quote
#5
That's the best idea I've heard so far... Thanks again Mike!
CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1386627748
Reply with quote
#6
Hmm... it seems he's tried this already. The object collides with the player ship. Can't cover it. I suggested he try multiple objects, like the sides of a cube that could cover from every angle. He doesn't seem convinced though. Is there any way to disable collision on a generic object? That way it wouldn't block weapons fire, mines, asteroids, etc. And apparently there's stuff in his mission that will detect cloak and shoot you.
Mike Substelny
Administrator
Registered:1375273622 Posts: 2,990
Posted 1386795958
Reply with quote
#7
In that case try these three steps:Scale the generic object to be slightly larger than 100%, Set the generic object's collision range to zero Use set_relative_position to place the object's center one meter from the player ship's center so they don't collide.
__________________"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight." - Winston Churchill
CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1386814243
Reply with quote
#8
Ah cool, you can do that with the Pushradius property, right? Not sure why I didn't think of that, thanks. So my buddy has one final issue apparently - lag. He claims that even if the object is given an infinite set_relative_position to the player ship, when the ship starts to move the object always lags a moment before popping back into position. So you get this shaking, strobing effect that probably doesn't hide the ship so good and looks god-awful. Granted he's only seen this lag on the helm and science windows (apparently his test object was invisible... not sure how he expected it to cover his ship), so we don't actually know if the problem persists in the main viewports but I'm assuming it will. Although I'm wondering if the shakes he's seeing are just the collisions bouncing off each other.... maybe removing them would help. Anyways I personally think enough of the problems are solved for him to experiment a bit more, find the remaining solutions himself. So maybe he will. Ideas are always welcome but I'll understand if you'd rather not humor us any more with this. Your tips have been really helpful. Thanks again! On a completely different subject I'm working on my own mission. If you're in a generous mood I have an unrelated question: do the Chase_Neutral and Chase_Enemy commands still work in v2.0? I've heard a rumor that maybe they don't, and I'm trying to get a bunch of NPC ships to attack each other - preferably automatically so I don't need to tell them to attack every single object individually. None of my case commands seem to work. Here's a failed example script: <create type="enemy" x="46941.0" y="0.0" z="58349.0" angle="267.7" name="I.K.S. B'Moth" raceKeys="enemy standard whalehater" hullKeys="medium" fleetnumber="2" /><event name_arme="B'Moth arrives" id_arme="b66dd3a4-dad7-4e11-9e1e-5ff48adb7119">
<if_variable name="B'Moth approaches" comparator="NOT" value="1.0" />
<add_ai type="CHASE_NEUTRAL" value1="6000" value2="3000" name="I.K.S. B'Moth" />
<set_variable name="B'Moth approaches" value="1.0" />
</event>
Mike Substelny
Administrator
Registered:1375273622 Posts: 2,990
Posted 1386865299
Reply with quote
#9
I believe your friend is *not* observing the image on the main screen, he is observing position symbol on Helm, Weapons, and Science. IMO that symbol should be invisible anyway. Use the ColorRed, ColorGreen, and ColorBlue properties to make the positions symbols black (I believe that 0,0,0 will do the trick). The fun part about this will be choosing a skybox and skin for the cloaked ship. I think the cloaked ship should look ghostly, but your mileage may vary. I believe that Thom intended for CHASE_NEUTRAL and CHASE_ENEMY to work in 2.0. If they don't it's probably a bug related to the new side variable. With the side variable the labels of neutral and enemy have changed in meaning. A ship that is neutral to players on side 1 might be enemy to players on side 6.
__________________"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight." - Winston Churchill
CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1386996353
Reply with quote
#10
Ok, so maybe the CHASE commands don't work? In that case, would you know how to get A.I. fleets to automatically attack one another using the side variable? I'm not that familiar with the commands, and I'd just rather not make a hundred attack events for all my ships.
As for the cloaking field, I've done a few tests. Unfortunately I have no idea how to make my own custom objects. I tried to make a black bubble that could fit around the player ship, but every DeleD mesh I built refuses to show up, and every PNG texture I created crashed the game. So I took a Borg Sphere from the TNG mod and applied a glow texture from another ship - mostly black with a few white dots and streaks - and tried your set_relative_position and Pushradius technique.
It sorta works... but there's definitely the lag my friend talked about. It's not as severe as the symbol on helm but it shakes/strobes with every frame the faster you go. When you move at warp 4 you can see your ship's nose popping out the front of the sphere from the side and front viewscreens. But from the back the ship's totally covered. I have a dark space skybox handy. The sphere blocks the stars and is plainly visible with anything but a black skybox, but with a little imagination you could sort of pretend it's a ghetto cloaking field....
I added some repeating angle/pitch/roll additions to keep the thing spinning. Now it looks like some a kind of black TV static. Not like any Star Trek effect but at least it's kind of interesting?
Anyways I think I'm done testing this thing out. I'll give my friend the data. Maybe he can figure out how to make a properly shaped and textured DeleD mesh instead of this wacky Borg Sphere I'm using. If the bubble had the right shape, you could probably stop the ship's nose from popping out the front of the bubble at high warp.
In any case thanks for all the assistance. Wouldn't have gotten as far otherwise.
Mike Substelny
Administrator
Registered:1375273622 Posts: 2,990
Posted 1387307760
Reply with quote
#11
You could make the generic object with the mesh for the player ship. Just use a suitable skin and magnify it to be about 10%-20% bigger. That should look pretty cool.
__________________"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight." - Winston Churchill
CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1387340213
Reply with quote
#12
Yeah he thought of that... it would look good if the ship was stationary, but as soon as it starts moving the object lags behind. If the object conformed too closely to the ship's model, you'd see the ship popping out of the blackness with every frame. My Borg sphere was big and fat enough to counter that in the back viewport, but the ship's nose still stuck out the front of the sphere at high warp. You could probably make an object long enough horizontally to beat this problem, but again, we're talking about a big fat bubble, not a sleek silhouette. Also as far as I know, there's no way to align the pitch and roll of one object to another object, so the ship would pop out of its black silhouette every time it tried to turn. My friend would also need to do it for every ship type, since his mission allows the player to choose his vessel. Although if he just did the Dreadnaught it might fit for the rest.... as long as he's not using any TMP and TNG mod ships with wacky silhouettes. The lag would still be a problem though. So I guess the CHASE AI commands don't work in v2.0? And nobody knows how to do an auto-attack AI command between allied and enemy ships? If I can't make them attack automatically, I'll need to make over 3000 events just to tell everybody how to attack each other. That'll be a long, mind-numbing exercise and a nightmare for me to debug afterwards. I just wish the ships were smart enough to do it, y'know?
martusak
Registered:1404505276 Posts: 4
Posted 1404505734
Reply with quote
#13
Quote:
Originally Posted by CmdrNooblet Hi, A friend of mine's trying to build a cloaking device. Has anyone figured out a way to turn a player's ship invisible? I think I know how you'd do it from an A.I. standpoint but what if you literally wanted to vanish from the main viewer?
Can you please go into detail of the AI standpoint of view? How do I make enemy ships not attack Artemis? Thanks
Mike Substelny
Administrator
Registered:1375273622 Posts: 2,990
Posted 1404744876
Reply with quote
#14
Quote:
Originally Posted by martusak Can you please go into detail of the AI standpoint of view? How do I make enemy ships not attack Artemis? Thanks
When the cloaking device is active, clear the enemy's AI stack and re-build it without any CHASE_PLAYER blocks. When the cloaking device is turned off clear and rebuild the AI stack to normal.
__________________"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight." - Winston Churchill
martusak
Registered:1404505276 Posts: 4
Posted 1404745820
Reply with quote
#15
Thank you! OK, will try that. Another possible solution is to set chase_player so short that it does not trigger at all. (e.g. 100m) - which would kind of simulate the fact, that enemies can detect you when you are really close.