OoliteProject / oolite

The main Oolite repository.
https://www.oolite.space
554 stars 70 forks source link

addVisualEffect returning effect w/ collisionRadius === 0 #255

Open cag62 opened 6 years ago

cag62 commented 6 years ago

The effectKey I'm passing is that of a ship in player.ship.target This work fine most of the time, even returning null when it fails. But some ships not mentioned in my effectdata.plist file return a visualEffect w/ a 0 collisionRadius. What Norby did (I'm rewriting telescope, btw) was grab the contents of
Oolite\oolite.app\Resources\Config\shipdata.plist and change all 'like_ship' property names to 'like_effect'. This should not have been necessary, right? If you can render a ship in space, its dataKey should be all you need to create an effect, or am I missing something?

I'm running 'development version 1.85.0.6992-170819-0119485 (x86-64 test release) under Windows 6.1.7600 64-bit' with 2 ship oxp's; oolite.oxp.CaptSolo.Cobra_Mk3-XT.oxz oolite.oxp.Norby.HardShips.oxz

The "Cobra Mark III-XT" fails on dataKeys 'cobra3-xt', 'cobra3' & 'cobra', getting null each time. It has no effectdata.plist file.

But the HardShips' "Hard Adder" succeeds w/ dataKey 'hard-adder', getting a visualEffect w/ its collisionRadius = 0. Turns out that Norby did what he did in telescope, duplicate his shipdata.plist but this time he forgot to change 'like_ship' to 'like_effect'. This may explain why I'm getting whacky visualEffects.

But none of this should be necessary, as the shipdata has all the info you need to make an effect. Otherwise, I'd need effectdata on every ship from every oxp! If anyone's considering an oxp that serves up ship graphics (camera probe, target damage assessment and yes, telescope), that a tall order. In figuring this out, my effectdata file is over 890 kB for 30 oxps.

Norbylite commented 6 years ago

Anno I asked something similar from core developers but I gon an answer that not enough easy to improve the code to allow creating visualeffects from ship objects, so I was must implement an oxp level solution and make a copy into effectdata. Much later we got an addCollisionException function to ship objects, so in a rewrite you can spawn real ships instead and add exceptions to all nearby ships and remove AI to create a visualeffect-like ship without making effectdata entry.

cag62 commented 6 years ago

ok, but how do I scale a real ship?