View unanswered posts | View active topics It is currently Sun Jun 16, 2024 5:19 pm



Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
 Anti Air Missile 
Author Message
User avatar

Joined: Wed May 20, 2009 10:06 am
Posts: 163
Location: Sweden
Reply with quote
Post Re: Anti Air Missile
rditto48801 wrote:
*wall 'o' text*
Things I have noticed if I have 2 or more AAM Cannons at the same time.
1: On occasion, only 1 will fire missiles, the others do not fire at all.
1A: Only 1 will fire missiles, but it fires more often, as if one or more of the others are still working, but all launching from a AAM Cannon.
2: On occasion, a missile deployed by the first stage will go after either another AAM Cannon, or the AAM Cannon that launched the first stage in the first place.
3: Relating to 1, 1A and 2, many/all of the AAM Cannons suddenly fire normally, but most of the missiles go after the AAM Cannon that launched them or adjacent AAM Cannons, usually taking out all but one of the launcers, with the one that was firing normally all along being the usual survivor.

The AAM Cannons were on the ground during these incidents, the hit AAM Cannons were the only things in the missile's path. At least one instance saw missiles making an active attemp to seek an AAM Cannon right next to the launching AAM Cannon, the missile had to make a sort of ? shaped path to hit, so it was obviously targeting the adjacent AAM Cannon.
These 'friendly fire' instances seem to mainly occur when there are no enemy craft on the map, including 3.
Another instance had a potential friendly fire incident, but an enemy craft appeared as a missile was halfway back down to an AAM Cannon, and it turned to go after the newly arrived enemy craft that was some 2 screens worth away.
*wall 'o' text*

Having two lua-using actors that are not programmed to work properly if you have more than one usually causes lot's of problems.


Tue Sep 22, 2009 2:41 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Anti Air Missile
Which is why people who don't know about locals shouldn't be releasing mods. Here's looking at you, whitty.


Tue Sep 22, 2009 2:43 pm
Profile

Joined: Thu Sep 03, 2009 6:01 pm
Posts: 56
Reply with quote
Post Re: Anti Air Missile
Yes, the lua-part of this mod is really wonky and hard to realize with CC-Lua.
Problem is that I have to "transfer" the team-variable from first stage to the actual missile. I have to use a global variable being set to the team-number as the first stage explodes, then have second stage set self.team to this variable and then set the variable back to nil again, all within 2 lua-updates. It's something I really don't like, and why I decided to stop working on this mod for now.


Also thanks to rditto48801 for this REALLY detailed post!
I am aware of ALL of these issues. I limited all AAMs to only have a maximum of 1 missiles in air for each team. (also it caused the whole thing to bug sometimes, creating a new missile every frame (i.e. hundreds of missiles at once))

So, yeah, it's all pretty badly coded, but CC-Lua has it's problems:
Take an actor and have it "print(self.team)" in "Destroy(self)". You'll be surprised it'll always print you -1, no matter what team he was in before being killed/destroyed/atomized.


Wed Sep 23, 2009 4:40 pm
Profile
Forum Moderator
User avatar

Joined: Fri Feb 02, 2007 3:53 pm
Posts: 1896
Location: in my little gay bunker
Reply with quote
Post Re: Anti Air Missile
Alternatively you could just spawn the second stage with Lua rather than gibbing it


Wed Sep 23, 2009 6:15 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Anti Air Missile
DrLuke wrote:
Yes, the lua-part of this mod is really wonky and hard to realize with CC-Lua.
Problem is that I have to "transfer" the team-variable from first stage to the actual missile. I have to use a global variable being set to the team-number as the first stage explodes, then have second stage set self.team to this variable and then set the variable back to nil again, all within 2 lua-updates. It's something I really don't like, and why I decided to stop working on this mod for now..


parent object:
local hmissile = CreateAEmitter("Missile Child","Your.rte");
hmissile.Pos = self.Pos
MovableMan:AddParticle(hmissile);
hmissile.PresetName = tostring(self.Team);
self:GibThis() or self.ToDelete = true

child object:
self.team = tonum(self.PresetName);

voila

booyah

etc


Thu Sep 24, 2009 7:29 am
Profile

Joined: Thu Sep 03, 2009 6:01 pm
Posts: 56
Reply with quote
Post Re: Anti Air Missile
Ka-ZING!

Will try that later!

Thanks!


Thu Sep 24, 2009 12:40 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Anti Air Missile
It's a neat trick, since both GoldCost and PresetName can be used as variable storage space.


Thu Sep 24, 2009 2:46 pm
Profile

Joined: Sat Jun 16, 2007 8:04 pm
Posts: 42
Reply with quote
Post Re: Anti Air Missile
It's probably best to stuff it all in Cannon.lua, because the launcher has to first find the target anyway before launching missile, so then the missile doesn't have to find it again. And the next stage depends on the previous stage, so it makes sense IMO. You also wouldn't need to worry about passing variables around.


Thu Sep 24, 2009 10:03 pm
Profile

Joined: Thu Sep 03, 2009 6:01 pm
Posts: 56
Reply with quote
Post Re: Anti Air Missile
Image
I did what Grif said, and that's the result. That "Print:0" is a print(AAM.PresetName), so it's set to 0. The problem seems to be with the tonum, as it doesn't work!

What shall I do?

EDIT: Oh yeah, it's "tonumber", not "tonum"






ScifiSpirit wrote:
It's probably best to stuff it all in Cannon.lua, because the launcher has to first find the target anyway before launching missile, so then the missile doesn't have to find it again. And the next stage depends on the previous stage, so it makes sense IMO. You also wouldn't need to worry about passing variables around.


Not quite correct: The Launcher only finds POSSIBLE targets in a set range!


Fri Sep 25, 2009 5:46 pm
Profile

Joined: Thu Sep 03, 2009 6:01 pm
Posts: 56
Reply with quote
Post Re: Anti Air Missile
Released Version 1.2


New features: More than 1 launcher at once is shooting missiles now!


Last edited by DrLuke on Wed Sep 30, 2009 1:59 pm, edited 1 time in total.



Tue Sep 29, 2009 5:53 pm
Profile
User avatar

Joined: Fri Mar 13, 2009 2:31 am
Posts: 217
Location: Earth... I think
Reply with quote
Post Re: Anti Air Missile
Um... where is it?... I can't seem to find version 1.3


Wed Sep 30, 2009 4:04 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Anti Air Missile
The link at the top of the page is the new version; the OP just forgot to change the second digit.


Wed Sep 30, 2009 4:29 am
Profile WWW

Joined: Thu Sep 03, 2009 6:01 pm
Posts: 56
Reply with quote
Post Re: Anti Air Missile
It was just a typo, 1.2 is the newest version. Sorry for that!


Wed Sep 30, 2009 1:59 pm
Profile
User avatar

Joined: Wed Dec 26, 2007 4:25 am
Posts: 167
Location: Hopefully in front of a gaming platform of some kind
Reply with quote
Post Re: Anti Air Missile
This is a really cool mod, an anti air launcher is now a staple to my bases. However, i do have one complaint. Is it necessary that the missiles self-destruct if the target they were going after is destroyed before it can get there? I'd rather that they just keep going until they hit something, or the the thrusters shut off, etc. Just blowing up in mid-air just seems weird to me.


Wed Sep 30, 2009 9:40 pm
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post Re: Anti Air Missile
It is a safety measure so that they do not accidentally hit your own units.


Wed Sep 30, 2009 9:42 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.054s | 15 Queries | GZIP : Off ]