Due to the nature of the missile I'm making, I want to make sure that once a missile has been fired on a target, that specific target is considered dead and excluded from future targeting. (If a monster is far away, I only want 1 missile to be fired at it ... Fire and forget ... think of the Javelin)
So after firing on that monster, imagine another monster behind it, the second missile will lock onto the other target since the former is somehow(?) excluded/marked.
Marking a target
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
- Posts: 269
- Joined: Tue Jan 19, 2010 5:07 pm
Re: Marking a target
In ZScript you could simply add an array of actors to the weapon. So, when the weapon is fired, it gets the target actor first - AimTarget(), checks if this actor is in the array of actors, and if it's not, it fires a missile and add this target to array. I can write an example if you want.
-
- Posts: 83
- Joined: Thu Jan 25, 2018 1:37 pm
Re: Marking a target
Sure, go ahead. I have detailed my request here in the other forum, you can see what I'm trying to accomplish. My missile is always fired up at a pitch, which quickly changes angles for a limited time, then switches over to the target and becomes homing.
https://www.doomworld.com/forum/topic/9 ... quisition/
Although I'd really prefer an ACS/Decorate oriented solution, if this cannot be done in acs/dec ... it would be kind of bad, but I'll utilize your example. Read my post in the link again if you need to, I believe my intentions are very clear.
https://www.doomworld.com/forum/topic/9 ... quisition/
Although I'd really prefer an ACS/Decorate oriented solution, if this cannot be done in acs/dec ... it would be kind of bad, but I'll utilize your example. Read my post in the link again if you need to, I believe my intentions are very clear.
-
- Posts: 269
- Joined: Tue Jan 19, 2010 5:07 pm
Re: Marking a target
Well, in Decorate, you can use A_GiveInventory. You will give some dummy item, to target (if it's being used in "monster") or tracer (if it's being used in guided missile). And next time the missile launcher gets a new target, it checks if this target have this dummy item.
Give Inventory
Inventory check
Give Inventory
Inventory check
-
- Posts: 83
- Joined: Thu Jan 25, 2018 1:37 pm
Re: Marking a target
ok , this is actually good, once the missile locks onto the target, it could fire an instant tracer marking the target via Give Inventory, but then what ? Assume a far away target is being targeted (1st) ... the missile gave the monster an inventory, it's still in flight towards it, Then I need to exclude targets with inventory
I just read that after this I can use ClearTarget for this.
How about the first problem on my list .. I found this neat function called GetActorZ. Obviously I want to target only eligible targets (done via acs)
I'm telling you how I'm planning this:
I just read that after this I can use ClearTarget for this.
How about the first problem on my list .. I found this neat function called GetActorZ. Obviously I want to target only eligible targets (done via acs)
I'm telling you how I'm planning this:
- Assume GetActorZ (AA) = int number ; target must be int number + 400 (higher)
- Target must be between 600 and 1500 units away for FireMode1 (About to define that trajectory manually) [Not exactly sure how to do the 600-1500 thing in ACS]
- Target must be 1500+ units away for FireMode2 (also about to define it) [EDIT: Just found this https://zdoom.org/wiki/Distance , will probably use it]
-
- Posts: 269
- Joined: Tue Jan 19, 2010 5:07 pm
Re: Marking a target
I think you just need to get distance and Z of the target. You can use these neat functions like GetDistance and GetZAt.
For height, you need to get target Z and add 400 to that, and substract missile launcher Z. Check the result and if it is higher than 400 - jump to another state.
Next check distances. Get distance from GetDistance (heh), and check if it is between 600 and 1500 - jump to state FireMode1, or if it is higher than 1500 - jump to state FireMode2.
For height, you need to get target Z and add 400 to that, and substract missile launcher Z. Check the result and if it is higher than 400 - jump to another state.
Next check distances. Get distance from GetDistance (heh), and check if it is between 600 and 1500 - jump to state FireMode1, or if it is higher than 1500 - jump to state FireMode2.