While trying to get a, well, more photonic-looking Photon Torpedo to work I noticed that flashers on missiles don't seem to work.
Am I overlooking something? Is this intentional? Or a known bug?
Hope someone knows
L
Allready got a working photonic torpedo , allthough mine is named Energy torpedo...
And the bug was reported by me... its a case of when a missile is launched by the player, then the flashers do not work... switchLightsOn do no solve the problem either. a missile launched by NPC will not have its flashers working either...
If you on the other hand spawn the missile via a js script, the flashers will work fine... however.. Then there is the little matter of getting it to snatch the players target in order for it not to self detonate to soon..
Flashers do not work on sub entities either... on my energy missile i have seen flashers on subentities show, but when i saw them, they where out of place and mystical stretched as if they where a 2d picture rotated in 3d space, so surely it is a code thing...
From his screenshot he's running v1.73, so that's probably a good start...
Looks like a real flasher. In 1.70 flashers on subentities did not work. When switching to 1.71 my subs had suddenly active flashers. Now on 1.72 they are off again. And with 1.73 it flashes back on?
sorry for my very laaate reply (ill make it up with a tasty screenshot)
I don't know about flashers in 1.73, of course I'm going to test that...
These are secondary objects spawned by the missile launched, with attached js script.. That awards the player kills and score and so on... since we cannot manually set the owner of the missile...
Currently these are high in polygon usage 222 for each entity and one missile is 3 entities... this can be trimmed of course.
These are secondary objects spawned by the missile launched, with attached js script.. That awards the player kills and score and so on... since we cannot manually set the owner of the missile...
It should be possible to give submunition the parents owner as written here by Ahruman and the 1.72 release notes.
Specifically, any missile fired by a missile now inherits its parent’s owner. (This would matter if you added missiles to tharglets, for instance.) Additionally, a ship spawned by spawn: or JS spawn() will inherit its parent’s owner if the parent is a missile and the spawned ship has the property is_submunition set to true in shipdata.plist.
However, I tried it yesterday and the subs got neighter the owner or the target of their mother. I am not yet sure if this does not work or I am doing something wrong. Looking in the code however I couldn't find were it reads in the key "is_submunition". It is not in shipEntity.m or Universe.m. So probably I it was never added at all.
The code for is_submuition exists in ShipEntityScriptMethods.m, -spawnShipWithRole: method and, although I have not tested it yet, just by looking at it it seems to do what it is supposed to.
The code for is_submuition exists in ShipEntityScriptMethods.m, -spawnShipWithRole: method and, although I have not tested it yet, just by looking at it it seems to do what it is supposed to.
Thanks A_C,
That code looks flawless. Still, the submunition inherits no owner and no target. I uploaded a small test file with 3 missiles. The missile with the name "Penetrating Missile" uses the submunitions. It now logs null for owner and target of the submunitions. Nukes for testing only
The code for this missile is very straightforward and does not has a bug as far as I can see. Therefor there must be an error somewere in the source code itself and the only thing that could cause it to not work is when "isMissile" is false.
The function "fireMissile" in shipEntity explicit sets isMissile to YES. But "fireMissile" in playerEntity does not set it. But it could have set somewhere else to YES for the player.
However, when looking in for the uses of the "isMissile" property in playerEntity, I see it is used in "selectNextMissile". When that next missile "isMissile", it should set the active target to that missile when it had no target assigned to. Never saw something like that happening after firing a missile. So mabey "isMissile' is indeed false for player launched missiles.
A bit confused.
EDIT:
I now tested it by spawning the submunition by a NPC launched missile. Than indeed it inherits the target and owner of the mother. So this really is a bug that affects player launched missiles. Makes the wrong setting of "isMissile" more likely to me.