Flashers on missiles don't work in 1.72.2 - FIXED
Moderators: winston, another_commander, Getafix
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
same results however, i used an AI to spawn like this
so My secondary missile(the ones not launched, but spawned) by spawning its respective equiement (role) name, namely in my case)
EQ_FRAME_PHOTON_MISSILE
if Ido not do that, but rather call it by some other uniqe like Test_Photon like i used then isMissile will be false...
however now it is true since i spawned it calling its Equipment role
However, it does not inherit the owner ship from the missile that spawned it... so ship.owner is still false
It does also not inherit its target, which makes me sure that it is not even entering the function in where these heritages are set...
Now to test if this is also true for the same kind of missile fired by an NPC...
I tested it like this
Now to use the exact same procedure on one of the players missiles...
As you can see, isMissile is true... however, the submunition missile does not inherit the ownership, when the owner of the launched missile is the player... IsMissile being true or not.... and it does also not inherit its target...
Either the function is never entered when the player is doing the missile launching OR
near:self is treated different when the player is self, and thus is set to null since the missiled launched does have a target...
in short... either this is expected behaviour or it is a bug!!!
Code: Select all
{
"ON_HOLD" = {
EXIT = ();
UPDATE = ();
};
"SUMMON" = {
ENTER = (switchLightsOn, performIntercept);
EXIT = ();
UPDATE = ("spawn: EQ_FRAME_PHOTON_MISSILE 20","setStateTo: ON_HOLD");
};
GLOBAL = {
ENTER = ("setSpeedFactorTo: 3.0", "pauseAI: 3.0","setStateTo: SUMMON");
EXIT = ();
UPDATE = ();
};
}
EQ_FRAME_PHOTON_MISSILE
if Ido not do that, but rather call it by some other uniqe like Test_Photon like i used then isMissile will be false...
however now it is true since i spawned it calling its Equipment role
However, it does not inherit the owner ship from the missile that spawned it... so ship.owner is still false
It does also not inherit its target, which makes me sure that it is not even entering the function in where these heritages are set...
Now to test if this is also true for the same kind of missile fired by an NPC...
I tested it like this
Code: Select all
> this.mi = system.shipsWithPrimaryRole("EQ_MISSILE")
> this.mi = system.shipsWithPrimaryRole("EQ_MISSILE")
[Ship "Missile" ID: 322 position: (-2382.98, 9862.63, 167978) scanClass: CLASS_MISSILE status: STATUS_IN_FLIGHT],[Ship "Missile" ID: 323 position: (-2393.1, 9831.24, 168002) scanClass: CLASS_MISSILE status: STATUS_IN_FLIGHT]
> this.mi[0].owner
> this.mi[0].owner
[Ship "Fer-de-Lance" ID: 249 position: (-2488.02, 10286.8, 168016) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT]
> this.mi[0].spawn("EQ_FRAME_PHOTON_MISSILE")
> this.mi[0].spawn("EQ_FRAME_PHOTON_MISSILE")
[Ship "Photon Torpedo" ID: 324 position: (-2383.52, 9859.42, 167980) scanClass: CLASS_MISSILE status: STATUS_IN_FLIGHT]
> this.mi = system.shipsWithPrimaryRole("EQ_FRAME_PHOTON_MISSILE")
> this.mi = system.shipsWithPrimaryRole("EQ_FRAME_PHOTON_MISSILE")
[Ship "Photon Torpedo" ID: 324 position: (-2383.52, 9859.42, 167980) scanClass: CLASS_MISSILE status: STATUS_IN_FLIGHT]
> this.mi[0]
> this.mi[0]
[Ship "Photon Torpedo" ID: 324 position: (-2383.52, 9859.42, 167980) scanClass: CLASS_MISSILE status: STATUS_IN_FLIGHT]
> this.mi[0].owner
> this.mi[0].owner
[Ship "Fer-de-Lance" ID: 249 position: (-2488.02, 10286.8, 168016) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT]
Code: Select all
> this.mi = system.shipsWithPrimaryRole("EQ_MISSILE")
> this.mi = system.shipsWithPrimaryRole("EQ_MISSILE")
[Ship "Missile" ID: 313 position: (4564.59, 4953.76, -13481.4) scanClass: CLASS_MISSILE status: STATUS_IN_FLIGHT]
> this.mi[0].owner
> this.mi[0].owner
[PlayerShip "Cobra Mark III" ID: 100 position: (4639.02, 5005.9, -13759.8) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT]
> this.mi[0].spawn("EQ_FRAME_PHOTON_MISSILE")
> this.mi[0].spawn("EQ_FRAME_PHOTON_MISSILE")
[Ship "Photon Torpedo" ID: 314 position: (4564.77, 4953.21, -13482.3) scanClass: CLASS_MISSILE status: STATUS_IN_FLIGHT]
> this.mi = system.shipsWithPrimaryRole("EQ_FRAME_PHOTON_MISSILE")
> this.mi = system.shipsWithPrimaryRole("EQ_FRAME_PHOTON_MISSILE")
[Ship "Photon Torpedo" ID: 314 position: (4564.77, 4953.21, -13482.3) scanClass: CLASS_MISSILE status: STATUS_IN_FLIGHT]
> this.mi[0].owner
> this.mi[0].owner
null
> this.mi[0].isMissile
> this.mi[0].isMissile
true
> this.mi[0].target
> this.mi[0].target
null
Either the function is never entered when the player is doing the missile launching OR
near:self is treated different when the player is self, and thus is set to null since the missiled launched does have a target...
in short... either this is expected behaviour or it is a bug!!!
Bounty Scanner
Number 935
Number 935
@Eric Walch
will make isMissile = false
you need to give it an entry in equipment.plist and spawn it by that equipment role like EQ_MISSILE..
as you will note missiles primary roles are "EQ_MISSILE" or "EQ_HARDENED_MISSILE" or else theire property of isMissile will be false..
Cheers........
Code: Select all
this.ship.spawn("nukeSubMunition", 10)
you need to give it an entry in equipment.plist and spawn it by that equipment role like EQ_MISSILE..
as you will note missiles primary roles are "EQ_MISSILE" or "EQ_HARDENED_MISSILE" or else theire property of isMissile will be false..
Cheers........
Bounty Scanner
Number 935
Number 935
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
The submunitions fired by player bug has been fixed in SVN2187. This is what my log indicates after firing a nuke on the nav buoy:
Code: Select all
[nuke3]: Target & owner of submunition nr:0 [Ship "Navigation Buoy" ID: 209 position: (-54234.4, 21326.1, 440999) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT] [PlayerShip "Cobra Mark III" ID: 100 position: (-60733.6, 23881.7, 440583) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT]
[script.javaScript.warning.206]: ----- JavaScript warning ("nuke3" 1.0): Entity.setPosition() is deprecated, use entity.position = foo instead.
[nuke3]: Target & owner of submunition nr:1 [Ship "Navigation Buoy" ID: 209 position: (-54234.4, 21326.1, 440999) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT] [PlayerShip "Cobra Mark III" ID: 100 position: (-60733.6, 23881.7, 440583) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT]
[script.javaScript.warning.206]: ----- JavaScript warning ("nuke3" 1.0): Entity.setPosition() is deprecated, use entity.position = foo instead.
[nuke3]: Target & owner of submunition nr:2 [Ship "Navigation Buoy" ID: 209 position: (-54234.4, 21326.1, 440999) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT] [PlayerShip "Cobra Mark III" ID: 100 position: (-60733.6, 23881.7, 440583) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT]
[script.javaScript.warning.206]: ----- JavaScript warning ("nuke3" 1.0): Entity.setPosition() is deprecated, use entity.position = foo instead.
[nuke3]: Target & owner of submunition nr:3 [Ship "Navigation Buoy" ID: 209 position: (-54234.4, 21326.1, 440999) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT] [PlayerShip "Cobra Mark III" ID: 100 position: (-60733.6, 23881.7, 440583) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT]
[script.javaScript.warning.206]: ----- JavaScript warning ("nuke3" 1.0): Entity.setPosition() is deprecated, use entity.position = foo instead.
[nuke3]: Target & owner of submunition nr:4 [Ship "Navigation Buoy" ID: 209 position: (-54234.4, 21326.1, 440999) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT] [PlayerShip "Cobra Mark III" ID: 100 position: (-60733.6, 23881.7, 440583) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT]
[script.javaScript.warning.206]: ----- JavaScript warning ("nuke3" 1.0): Entity.setPosition() is deprecated, use entity.position = foo instead.
[nuke3]: Target & owner of submunition nr:5 [Ship "Navigation Buoy" ID: 209 position: (-54234.4, 21326.1, 440999) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT] [PlayerShip "Cobra Mark III" ID: 100 position: (-60733.6, 23881.7, 440583) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT]
[script.javaScript.warning.206]: ----- JavaScript warning ("nuke3" 1.0): Entity.setPosition() is deprecated, use entity.position = foo instead.
[nuke3]: Target & owner of submunition nr:6 [Ship "Navigation Buoy" ID: 209 position: (-54234.4, 21326.1, 440999) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT] [PlayerShip "Cobra Mark III" ID: 100 position: (-60733.6, 23881.7, 440583) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT]
[script.javaScript.warning.206]: ----- JavaScript warning ("nuke3" 1.0): Entity.setPosition() is deprecated, use entity.position = foo instead.
[nuke3]: Target & owner of submunition nr:7 [Ship "Navigation Buoy" ID: 209 position: (-54234.4, 21326.1, 440999) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT] [PlayerShip "Cobra Mark III" ID: 100 position: (-60733.6, 23881.7, 440583) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT]
[script.javaScript.warning.206]: ----- JavaScript warning ("nuke3" 1.0): Entity.setPosition() is deprecated, use entity.position = foo instead.
[nuke3]: Target & owner of submunition nr:8 [Ship "Navigation Buoy" ID: 209 position: (-54234.4, 21326.1, 440999) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT] [PlayerShip "Cobra Mark III" ID: 100 position: (-60733.6, 23881.7, 440583) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT]
[script.javaScript.warning.206]: ----- JavaScript warning ("nuke3" 1.0): Entity.setPosition() is deprecated, use entity.position = foo instead.
[nuke3]: Target & owner of submunition nr:9 [Ship "Navigation Buoy" ID: 209 position: (-54234.4, 21326.1, 440999) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT] [PlayerShip "Cobra Mark III" ID: 100 position: (-60733.6, 23881.7, 440583) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT]
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Great. Good to hear that that is solved now.The submunitions fired by player bug has been fixed in SVN2187. This is what my log indicates after firing a nuke on the nav buoy:
Frame, the code A_C refered to was:
Code: Select all
{
spawned = [UNIVERSE spawnShipWithRole:role near:self];
if (spawned != nil)
{
[spawned setTemperature:[self temperature] * EJECTA_TEMP_FACTOR];
if (isMissile && [[spawned shipInfoDictionary] boolForKey:@"is_submunition"])
{
[spawned setOwner:[self owner]];
[spawned addTarget:[self primaryTarget]];
spawned->isMissile = YES;
}
[result addObject:spawned];
}
}
This spawn function is called for every spawn command. And that this function is called correctly you see by that the result holds the spawned ships.
I am not interested if the submunition isMissile, only in the main missile. The subs don't need to be missiles. It might be mines or pieces of rock. However according the code they still should inherit the owner and target properties.
Browsing throught the shipEntity code I also see:
Code: Select all
- (BOOL)isMissile
{
return [[self primaryRole] hasSuffix:@"MISSILE"];
}
Code: Select all
- (BOOL)isMissile
{
return [[self primaryRole] hasSuffix:@"MISSILE"] || [self hasPrimaryRole:@"missile"];
}
UPS-Courier & DeepSpacePirates & others at the box and some older versions
ahh I had not build revision 2187, thats why it did'nt work
however...
now i have build revision 2188.. and ownership of the submunition is correctly set however note this
Flashers stop working when the owner of the object/ship is the player
Since for my missiles when i set is_submunition to yes, the flashers simply stop working.
I would say it is safe to say that this has something todo with the code specificly checking for flashers and ownership. not knowing my way around the code yet, but i would go look for where the code decides to turn flashers on or off...
however...
now i have build revision 2188.. and ownership of the submunition is correctly set however note this
Flashers stop working when the owner of the object/ship is the player
Since for my missiles when i set is_submunition to yes, the flashers simply stop working.
I would say it is safe to say that this has something todo with the code specificly checking for flashers and ownership. not knowing my way around the code yet, but i would go look for where the code decides to turn flashers on or off...
Bounty Scanner
Number 935
Number 935
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
yep cause i just made it so,..another_commander wrote:Frame, can you upload a test case somewhere so that I can have a chance to d/l and check?
download a showcase oxp here... http://www.box.net/shared/30nfpo0iec
buy the missiles as non submunition or submunition
go out and target a nav bouy or similar... the ones with flashers will stay still as they do not inherit the target or owner from the
The ones without flashers because they do not work because of the ownership and target is correctly inherited. they
will try get as close to the target as possible and prolly crash at sometime because they do not detonat or explode...
Bounty Scanner
Number 935
Number 935
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Ehm... Didn't understand one bit. Can you please rephrase that?Frame wrote:go out and target a nav bouy or similar... the ones with flashers will stay still as they do not inherit the target or owner from the
The ones without flashers because they do not work because of the ownership and target is correctly inherited. they
will try get as close to the target as possible and prolly crash at sometime because they do not detonat or explode...
sry i meant the ones with flashers (the missiles)another_commander wrote:Ehm... Didn't understand one bit. Can you please rephrase that?Frame wrote:go out and target a nav bouy or similar... the ones with flashers will stay still as they do not inherit the target or owner from the
The ones without flashers because they do not work because of the ownership and target is correctly inherited. they
will try get as close to the target as possible and prolly crash at sometime because they do not detonat or explode...
The missiles will stay still as they do not have a target... and so on...
Bounty Scanner
Number 935
Number 935
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Problem could be in ParticleEntity.m in function -drawSubEntity:Frame wrote:
Flashers stop working when the owner of the object/ship is the player
Since for my missiles when i set is_submunition to yes, the flashers simply stop working.
I would say it is safe to say that this has something todo with the code specificly checking for flashers and ownership. not knowing my way around the code yet, but i would go look for where the code decides to turn flashers on or off...
Code: Select all
if (particle_type == PARTICLE_FLASHER && [self status] != STATUS_INACTIVE)
{
Vector abspos = position; // in control of it's own orientation
int view_dir = [UNIVERSE viewDirection];
Entity *last = nil;
Entity *father = my_owner;
OOMatrix r_mat;
OOMatrix temp_matrix;
while ((father)&&(father != last))
{
r_mat = [father drawRotationMatrix];
abspos = vector_add(OOVectorMultiplyMatrix(abspos, r_mat), [father position]);
last = father;
father = [father owner];
}
Probably the loop must also check if the father is already a main entity.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
You know, that falls in line with some of my observations...
When I was first working on the "photon torpedo", I put flashers on the sub entities... however they where not showing up...
however sometimes, by sheer luck, I noticed a flasher some distance away from the missile I had fired. it also looked stretched and 2dish as if some mathematical procedure had acted upon it and caused it to look like that...
I know it belonged to the missile because it was flying a parallel course to the missile I had fired following its every twitch and turn...
When I was first working on the "photon torpedo", I put flashers on the sub entities... however they where not showing up...
however sometimes, by sheer luck, I noticed a flasher some distance away from the missile I had fired. it also looked stretched and 2dish as if some mathematical procedure had acted upon it and caused it to look like that...
I know it belonged to the missile because it was flying a parallel course to the missile I had fired following its every twitch and turn...
Bounty Scanner
Number 935
Number 935
- Cmdr James
- Commodore
- Posts: 1357
- Joined: Tue Jun 05, 2007 10:43 pm
- Location: Berlin
Interesting point about the subentity drawing. I have looked into it and made a minor mod in trunk, not certain if it has fixed it -- the missiles described as working but no flashers both fly toward the target (and hit) and have lights on.
I am not too sure about the other missiles that dont work but do have flashers, I guess they are ok, as they deliberately do not inherit the target (so arent meant to work?)?
Also, the flashers dont flash, they are just on, is that expected?
EDIT: In fact, I think pretty much all parent (father) handling should be changed from [self owner] to [self parentEntity]
I am not too sure about the other missiles that dont work but do have flashers, I guess they are ok, as they deliberately do not inherit the target (so arent meant to work?)?
Also, the flashers dont flash, they are just on, is that expected?
EDIT: In fact, I think pretty much all parent (father) handling should be changed from [self owner] to [self parentEntity]
-
- Dangerous
- Posts: 84
- Joined: Sun Apr 26, 2009 10:24 pm
With my Limited knowledge of Objective C, i think im gonna tinker a bit with this...
just looking at it, just do not add up... looks wrong...
just looking at it, just do not add up... looks wrong...
Bounty Scanner
Number 935
Number 935