I got all excited when you posted that.. thought I might get to see some of your creations..El Viejo wrote:Are these any use for decals?
Then I clicked on the link.. oh darn, they're mine..
Moderators: winston, another_commander
I got all excited when you posted that.. thought I might get to see some of your creations..El Viejo wrote:Are these any use for decals?
Are we sure this totally works? i could have sworn i tried in out in the shipset then noticed that the alertlevel no longer worked *shrug*Capt. Murphy wrote:Apparently there is a permanent fix that could be applied to shipdata.plist - Svengali pointed me in the direction of this post.
This is what I found, then and now!Griff wrote:Are we sure this totally works? i could have sworn i tried in out in the shipset then noticed that the alertlevel no longer worked *shrug*Capt. Murphy wrote:Apparently there is a permanent fix that could be applied to shipdata.plist - Svengali pointed me in the direction of this post.
You are right Griff. It also happens when showing the player ship on a missionScreen, and it's simply because when a player ship is being displayed in this way (all use the demoship method) it is effectively a NPC and NPCs don't have alertlevel. For this OXP I can work around it by temporarily removing the alertlevel uniform binding before displaying the ship, otherwise the player will probably panic when they see hundreds of these messages in the log (each type an adjustment is made it redisplays the ship on the missionScreen), but in general I think it just needs to be seen as an essentially harmless informational report.Griff wrote:I'm sure it's more to do with player only shader uniforms being applied to a copy of the player ship on the demo screen/shipyard screen etc - i don't know why i think this, i definately didn't work it out for myself
Would you like them to? As a shader-only property, since I don't see a lot of use for it in AI, but it would be easy enough to determine when they were at CONDITION_DOCKED, CONDITION_YELLOW or CONDITION_RED based on other factors. (Any time the player is close enough to see them, they won't be at CONDITION_GREEN, of course)Capt. Murphy wrote:NPCs don't have alertlevel.
I would like them to. One thought that immediately comes to mind (and something I would like to do) is have a 'Chameleon' ship which switches texture when it is on Red Alert. Maybe I'm missing something, but how else could you tell if an NPC is at Condition Red in a way that could be manipulated by scripting?cim wrote:Would you like them to? As a shader-only property, since I don't see a lot of use for it in AI, but it would be easy enough to determine when they were at CONDITION_DOCKED, CONDITION_YELLOW or CONDITION_RED based on other factors. (Any time the player is close enough to see them, they won't be at CONDITION_GREEN, of course)Capt. Murphy wrote:NPCs don't have alertlevel.
Generally I would just check ifSmivs wrote:I would like them to. One thought that immediately comes to mind (and something I would like to do) is have a 'Chameleon' ship which switches texture when it is on Red Alert. Maybe I'm missing something, but how else could you tell if an NPC is at Condition Red in a way that could be manipulated by scripting?cim wrote:Would you like them to? As a shader-only property, since I don't see a lot of use for it in AI, but it would be easy enough to determine when they were at CONDITION_DOCKED, CONDITION_YELLOW or CONDITION_RED based on other factors. (Any time the player is close enough to see them, they won't be at CONDITION_GREEN, of course)Capt. Murphy wrote:NPCs don't have alertlevel.
ship.hasHostileTarget
is true. (Technically this is "trying to kill something" rather than "something trying to kill it", but with NPCs the two are basically equivalent. "Running away really fast" under performFlee
counts as true...)hasHostileTarget
is already available as a shader uniform for NPCs, of course, so all NPC alertLevel
would do is mostly duplicate that so you could use the same name for both.Fixed. Thanks.Smivs wrote:By the way, the Wiki has a few typos here...refering twice to 'shipLostTarget' which should be 'shipTargetLost' I think.
I've hit a bit of a barrier with the decals - in that changing the value ofGriff wrote:Decal positioning may look weird as you're testing your code as it's heavily dependant on how the UV's are laid out in the model UV map, some UV's are placed at crazy angles which will mean that the decal moves slightly diagonally across the hull when adjusting one of the position values, so don't be perplexed if you see this happening as you're working on your code
I can't remember if i commented any of the shader code properly, but if needed the "decal scale & position" vec3 in the shipdata.plist is as follows,
first component = U (horizontal position),
second component = V (vertical position),
third component = Decal scale (a bigger number makes for a smaller decal)
I'll add a link to the NPC shipset on the wiki, this oxp should get listed there too i think as it and the more vibrant paintmap oxp sound like they're going to be an essential companions oxps when ready
"Decal1_Rotation"
whether in script or by shipdata.plist
edit doesn't have any effect on the end result. I've run it with ShaderDebugOn and it's not reporting any errors and is correctly picking up the new value, but the decal is in exactly the same orientations as always.shipdata.plist
from "-0.73840" to "2". But the decal is in exactly the same orientation as before.10:18:59.054 [shader.uniform.set]: Set up uniform <OOShaderUniform 0x11743dd8>{24248320: float Decal1_Rotation = 2;}
Grrrr - my fix doesn't completely eliminate the errors messages, because you can only change the shader after the entity has been displayed, and the error message is already fired once then. At best it can reduce three repeated errors to one. Never mind will just have to put a note in the readme to not to worry.Capt. Murphy wrote:Thanks both - It's fixed on my local copy due for release as soon as I've sorted the decal customisation. It's the same essentially harmless error message you get at start-up when the Griff Cobra is the default player cobra, as you are showing a player ship as an NPC demoship.