Posted: Wed Apr 02, 2014 6:47 am Post subject:
Long shot
Subject description: Really, I want a long shot
I am trying to get artillery to fire really long (anywhere on the map) as some kind of super unit. I do not want to do it like a superweapon or a Generals' Power; I want the shell to fly for 3500 or 5000 distance units, or whatever it is. When I've tried this, the shell flies for a bit, and then it lands well short of where I said to shoot. I assume that this has something to do with the projectile's locomotor, though I don't see what. Any ideas? Last edited by BigBad on Wed Apr 02, 2014 4:24 pm; edited 1 time in total QUICK_EDIT
I never modded C&C Generals aside from changing the camera height, but to me it seems more logical that it would be related to the projectile rather than the unit's locomotor. _________________ QUICK_EDIT
I never modded C&C Generals aside from changing the camera height, but to me it seems more logical that it would be related to the projectile rather than the unit's locomotor.
Agreed. I meant the projectile's locomotor. I'll edit to clarify.
I don't care if the projectile goes up so high that it flies off the screen, but what I don't want to do is have my artillery piece's weapon to be crosshairs (or something) that indicates that an off-screen artillery strike should hit where I've clicked. I can probably figure out how to do that, but I want it to be the artillery piece itself firing a projectile (even if the projectile that hits has to be spawned on its own). QUICK_EDIT
Joined: 18 Jun 2005 Location: Dordrecht, the Netherlands
Posted: Wed Apr 02, 2014 4:49 pm Post subject:
What kind of projectile do you use? A parabolic shell (as most shell artillery use) or something like the SCUD Launcher (flies off-screen, comes back to hit the target)? QUICK_EDIT
I would prefer to use something parabolic, but I would be okay with having to have something fly high off the screen and then returns to hit the target.
I am using the nuke cannon as my model. (A super unit can lob those shells across the whole map.) Is there a way to get it to fire shells that can travel anywhere? QUICK_EDIT
Joined: 18 Jun 2005 Location: Dordrecht, the Netherlands
Posted: Thu Apr 03, 2014 4:49 pm Post subject:
The only problem you may have that it collides with something in the way. Tried tweaking the height values of the projectile parabolic trajectory? If that fails, your best bet is using something like the Tomahawk/SCUD Launcher, only with a shell instead of a missile as the art of the projectile. QUICK_EDIT
The only problem you may have that it collides with something in the way. Tried tweaking the height values of the projectile parabolic trajectory? If that fails, your best bet is using something like the Tomahawk/SCUD Launcher, only with a shell instead of a missile as the art of the projectile.
The Tomahawk vehicle? That was my first thought, to use the Tomahawk vehicle. The missile fell well short of the target with that plan, too.
Did you mean the hidden Tomahawk storm? QUICK_EDIT
Joined: 18 Jun 2005 Location: Dordrecht, the Netherlands
Posted: Fri Apr 04, 2014 4:51 pm Post subject:
The missiles have the problem they have a limited amount of fuel, which is defined in the projectile. If it runs out of fuel, it crashes to the ground. This is used for the Tomahawk Launcher's missile so it doesn't follow fast vehicles unlimited.
Set the fuel to either a very high number (99999), or removing the line a should make a missile fly unlimited. QUICK_EDIT
I am annoyed that I did not figure out the artillery projectile, but your comment about removing the fuel line in the Tomahawk projectile code did exactly what I was trying to do with the Tomahawk vehicle. I don't quite have unlimited range, but I set it to 15,000 or maybe 150,000, so I think I should be good on any map. (A 10,000 x 10,000 square map doesn't even have points 15,000 apart!) I did not test what happens with a mobile target. The code made it look like the missile would have trouble tracking the moving target.
Can we revisit the shell, though? Something about artillery in this role is appealing. How would I show my artillery piece firing up really high and then have a shell crash to the ground anywhere on the map? Is it a matter of looking at the Scud Storm code and adjusting it in fairly obvious ways? QUICK_EDIT
Joined: 18 Jun 2005 Location: Dordrecht, the Netherlands
Posted: Sun Apr 06, 2014 10:01 am Post subject:
SCUD Storm code is your best bet. No need to calculate a parabolic arc (aka use a shell projectile) if you are only going to see the launch and impact. A rule for projectile I use: if it goes off-screen, it uses the SCUD Missile logic, else it uses the Nuke Cannon logic. QUICK_EDIT
I feel that I should remark about this, since I recently revisited it and got it to work by following the Scud Storm logic.
My concern was that I didn't want the shell flying straight up when the barrel is clearly at an angle. That would look stupid. When I finally tried it out, the shell flies from the barrel at an angle, goes out of sight, and then crashes down on the target.
Perfecto!
I find it a bit ironic that I was adamant about this not being a SuperWeapon, yet now that I'm playing with it and I have figured out how to make my own SuperWeapons, I think that for the sake of the game (not the code), it has to be!
Thank you for your help.
To expand on my previous post, the way I have it set up shoots at a part of the map and whatever happens to be there; it does not track a moving target. This is what I want, though someone doing something slightly different will have to make some modifications beyond what I did. Second, this was indeed just obvious tweaks to the Scud Storm code (tracking a moving target doesn't strike me as an obvious tweak). Last edited by BigBad on Fri Feb 27, 2015 5:00 am; edited 1 time in total QUICK_EDIT
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 vote in polls in this forum You cannot attach files in this forum You can download files in this forum