Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
HaydenBarca

Registered:
Posts: 221
Reply with quote  #1 
Is there any way to change the skin of a player ship midgame (diffuse file)?  I'd like the ship to be able to change it's appearance (same dxs file, different png diffuse file).  I know I can destroy the ship and recreate it, but since it's the player ship that would be problematic.
Xavier Wise

Registered:
Posts: 1,143
Reply with quote  #2 
If it is a temporary change, you could possibly set a generic mesh up that covers the ship. Have it copy the properties for the xyz and angle, set the art scale slightly larger than the player ship and the pushRadius to 0 and it might work.
__________________
Fleet Captain Xavier Wise - TSN Sabre
Link to TSN RP Community website
Darrin

Registered:
Posts: 168
Reply with quote  #3 
Hmm. You could drop a mesh over the player ship and just change it whenever, but how the ship looks is a combination of several skins (glow, diffuse, specular, etc.). You could set position on the skin every tick, but it could still look "jumpy" if the script is doing too many other things. 

Ok, so... not sure if this would work... but you could launch an external program to copy over or replace the skin files in the /dat directory (batch file via CMD.exe or whatnot), then destroy/recreate the player ship. I'm not sure if that would work... if the skin is loaded when the ship is created, it might work, but if it's loaded into memory when the game starts, then probably not. 


HaydenBarca

Registered:
Posts: 221
Reply with quote  #4 
Thanks for the ideas, gang.  I got it to work as described.  Here's a video:


Here are the key pieces of code:

 

<event name="Initiate Stealth Mode">
<if_comms_button text="Enter Stealth Mode" />
<clear_comms_button text="Enter Stealth Mode" />
<create type="genericMesh" x="0.0" y="0.0" z="0.0" name="stealth" meshFileName="dat/artemis.dxs" textureFileName="dat/Asteroid_9_AO.png" colorRed="0.0" colorGreen="0.0" colorBlue="1.0" />
<set_object_property property="artScale" value="0.23" name="stealth" /> <!-- This is slightly bigger than the normal artScale of 0.20 -->
<set_object_property property="pushRadius" value="0.0" name="stealth" />
<set_variable name="StealthMode" value="1.0" integer="yes" />
<set_comms_button text="Exit Stealth Mode" />
</event>

<event name="In Stealth Mode">
<if_variable name="StealthMode" comparator="EQUALS" value="1.0" />
<set_relative_position name2="stealth" distance="5" angle="0" name1="Blackbird" />
<copy_object_property property="pitch" name1="Blackbird" name2="stealth" />
<copy_object_property property="angle" name1="Blackbird" name2="stealth" />
<copy_object_property property="roll" name1="Blackbird" name2="stealth" />
</event>

 


I'll be adding this to my spur of the TSN RP Sandbox for when the players in my RPG campaign use the "running silent" mode.

Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 2,408
Reply with quote  #5 
That looks super cool! Nice job!
__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
NoseyNick

Avatar / Picture

Registered:
Posts: 117
Reply with quote  #6 
Not bad! *TEENY* bit glitchy, but that actually adds to the fun a bit, with a kinda "this hologram is really hard to maintain" feel.
Love it! Nicely done!   [thumb][thumb]

name1
="Blackbird" - I believe this can now be done WITHOUT requiring specific ship names too, but can't recall the syntax.
HaydenBarca

Registered:
Posts: 221
Reply with quote  #7 
Thanks, gang.

Quote:
Originally Posted by NoseyNick
Not bad! *TEENY* bit glitchy, but that actually adds to the fun a bit, with a kinda "this hologram is really hard to maintain" feel.
Love it! Nicely done!   [thumb][thumb]

name1
="Blackbird" - I believe this can now be done WITHOUT requiring specific ship names too, but can't recall the syntax.


Yeah, I found the glitchiness to be a feature as well.  It's the asteroid skin so that gives a space camo feel.  If only there was a way to set the skin to be the star box -- might have to experiment with that.

For the referring to ships by slot number, it works for most things, but there are a few commands that it doesn't work for (bugs) and I don't feel like remembering which ones those are, so I'm still in the naming habit.
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.