Aircraft landed and shooting - Page 2

Aircraft landed and shooting

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Aircraft landed and shooting

Post by Jools »

I guess the difference between feature and a bug is whether it bothers someone. I think it's not an issue in ba due to the smalller LOS a fighter has when landed, meaning that in many cases it won't be firing in any case, becauase it can't see any targets.

In xta I think it's an issue, at least people complain about it. But I didn't say the answer has to be to reduce ground-los of fighter. I was merely exploring options.

About the unit script approach: activate/deactivate I know is used in some ways to have unit turn on/off radar, but even if you do some coding in that part, how do you prevent the unit from gaining targets?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Aircraft landed and shooting

Post by smoth »

Why not just block aiming in the script to begin with ?
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Aircraft landed and shooting

Post by Jools »

The neutrality of this article is disputed. Relevant discussion may be found on the talk page. Please do not remove this message until the dispute is resolved.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Aircraft landed and shooting

Post by smoth »

You are starting to get on my nerves even cob can do a weapon jam wtf does this have to do with my question?
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Aircraft landed and shooting

Post by Jools »

Nothing. It wasn't a response to your question.

But I did earlier ask how to handle unit aiming in a script. Once I know how to do that, it will be easier to answer why I do/do not do that.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Aircraft landed and shooting

Post by smoth »

AimWeapon3(heading,pitch)
{
signal SIG_AIM_3;
set-signal-mask SIG_AIM_3;

// Announce that we would like to aim, and wait until we can
while (NOT bMissilesOn)
{ sleep 100; }


sleep 100;
return(TRUE);
}
something like...
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Aircraft landed and shooting

Post by FLOZi »

Jools wrote:
The neutrality of this article is disputed. Relevant discussion may be found on the talk page. Please do not remove this message until the dispute is resolved.
Where are you quoting that from? Stock wikipedia neutrality quote?

Page isn't perfect in terms of its grammar and style but the information is correct. Objectively, lua is superior. I don't mean to toot our collective own horns, but Smoth and myself have done more cob and lus than most people and we will both agree vehemently that lua is the way forward.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Aircraft landed and shooting

Post by knorke »

smoth wrote:
AimWeapon3(heading,pitch)
{
signal SIG_AIM_3;
set-signal-mask SIG_AIM_3;

// Announce that we would like to aim, and wait until we can
while (NOT bMissilesOn)
{ sleep 100; }


sleep 100;
return(TRUE);
}
something like...
...is bad.

Code: Select all

AimWeapon3(heading,pitch)
{
if (MissilesOn) {return 1;	}
return 0;
}
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Aircraft landed and shooting

Post by Jools »

FLOZi wrote: Where are you quoting that from? Stock wikipedia neutrality quote?
Yes. Maybe lua is better, but the neutrality issue is the way that page is written.

It's quite obvious from the text that the author prefers lua. If it's really that obvious that lua is better, then why even present the page as some kind of comparativity study, why not make the title "The benefits of lua over cob", because that sentiment in the article anyway.

Otherwise the reader may wonder what the agenda behind the article is anyway.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Aircraft landed and shooting

Post by smoth »

you are really paranoid mate. Look, I don't care if you believe me or not. Frankly you and the rest of the world who feel I owe them proof for anything really urks me. Keep using cob keep believing a compiler is used for "debugging" I don't care. So much time wasted.

knorke has posted a revised version of my code example. You could try and work based on something like that. Since you have no fireweapon as it is not a turret, odds are you can block it somehow at query weapon or something like that. I dunno just go play with it.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Aircraft landed and shooting

Post by Forboding Angel »

FLOZi wrote:Page isn't perfect in terms of its grammar and style but the information is correct. Objectively, lua is superior. I don't mean to toot our collective own horns, but Smoth and myself have done more cob and lus than most people and we will both agree vehemently that lua is the way forward.

I agree, but in some cases it simply isn't practical when you have everything already in cob and aren't doing anything even remotely special.

If you were starting from a more or less clean slate I would wholeheartedly encourage LUS.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Aircraft landed and shooting

Post by FLOZi »

Forboding Angel wrote:
FLOZi wrote:Page isn't perfect in terms of its grammar and style but the information is correct. Objectively, lua is superior. I don't mean to toot our collective own horns, but Smoth and myself have done more cob and lus than most people and we will both agree vehemently that lua is the way forward.

I agree, but in some cases it simply isn't practical when you have everything already in cob and aren't doing anything even remotely special.

If you were starting from a more or less clean slate I would wholeheartedly encourage LUS.
Absolutely agree. I wouldn't campaign for people to replace all their bos for the sake of it (would probably result in awfully sloppy LUS), especially considering S44 is one of the biggest holdouts (SWIW too fwiw).
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Aircraft landed and shooting

Post by Jools »

smoth wrote:you are really paranoid mate.
Are you outside my house now?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Aircraft landed and shooting

Post by smoth »

Why do you have all that vodka and I hate your chairs, they don't match the style of your sofa!
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Aircraft landed and shooting

Post by Google_Frog »

Code: Select all

function script.BlockShot(num, targetID)
    return not Spring.GetUnitIsActive()
end
I prefer this method as it is foolproof. Sometimes aiming will take a while and cause some shots to be fired while the unit is landing. There is probably some analogous bos statement but almost nobody cares about that obsolete language so we are not able to tell you. You will have to find out how to implement it for yourself.

This type of behaviour should not be in the engine because it is trivial to implement in the script. It is also not a bug, some game may want to create a turreted aircraft which is intended to be used as a static combat unit when landed.

On a related note I am annoyed that units do not try to aim while they are repairing or reclaiming. As far as I can tell it is difficult to create a unit which could reclaim and shoot at the same time. If the engine was hardcoded the other way around it would be extremely easy for games to block firing while reclaiming in their unit scripts.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Aircraft landed and shooting

Post by smoth »

GetUnitIsActive is triggered by many things including on/offable right?
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Aircraft landed and shooting

Post by Google_Frog »

I am not sure. The most reliable solution would be to disable the weapons if the unit drops below a certain speed. I think that setting a value in Activate and Deactivate would work too.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Aircraft landed and shooting

Post by Forboding Angel »

IIRC, onoffable simply adds a button to the menu but doesn't actually do anything.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Aircraft landed and shooting

Post by knorke »

Forboding Angel wrote:IIRC, onoffable simply adds a button to the menu but doesn't actually do anything.
wrong
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Aircraft landed and shooting

Post by Forboding Angel »

It adds a button that toggles on and off in the script. That much is obvious, but knorke has to be anal about every word in a sentence.

Specifically, activate/deactivate.

The unitdef tag doesn't do anything except add a button. If your script isn't making use of activate/deactivate, adding the unitdef tag will not magically add functionality for you.

It should be unnecessary to say all of this, but as I said, knorke is anal for minutia.

Edit: Another more real world example.

It's like a lightswitch that will turn on the lights but only if the electric is hooked up to it, Just putting the lightswitch in the wall isn't going to magically make it turn on your lights.
Post Reply

Return to “Game Development”