Page 1 of 1
To build a better turret...
Posted: Fri Jan 06, 2006 12:45 am
by GK8000
Woo, GK is finally making a how-to ^_^
Well... for those of you interested this is how you can set up your very own auto-turret on your world (In three easy steps!)...
1) Start by going into your bdat and making an automated turret building type (duh methodology of course). Continue to set it up like you would any other building (Armor/build materials/etc etc)
2) After you're satisfied with the set-up of the general building, you'll then add the weapon you'll want it to use. This is specified in the "Defesnes Weapon / Trigger" field, in my experience, just type down the weapon that you want to use corresponding to the one in the gamescript.mts (1 for what you have as weapon 1 in your gamescript for example, again, duh methodology).
3) Ding, that's everything. Place the turret and watch someone on the opposing team walk into it's range and die.
Oh yes... one more thing... Turret range is decided by the expiry/speed variables in your gamescript, and remember to use basic fire controls, basic/explinear controls, and explinear object (This isn't exactly demanded, but it's the first thing I tried out that worked
)... Not to mention be sure that teams are configured. As always, just need to experiment with it, you'll eventually get it right.
NOTE: Turrets only track the enemy, but will still damage you if you get in it's way (Got a feature request here for ya mit, friendly turret shots to pass through friendlies ^_^)
PS... Manual turrets don't really... work right, shots collide with the building and such... however autoturrets work just fine (dunno what's goin on there...) Have fun kiddies
Posted: Fri Jan 06, 2006 9:44 am
by zaroba
last i saw, a turrent only shot at you if you if it was inside your viewing distance, regardless of how close you were to it.
so could easily sneak by them if you lowered your drawdist to 50.
and, turrents only shot at the closest enemy
Posted: Wed Jul 20, 2011 12:23 am
by flametard
I looked for the :
Defesnes Weapon / Trigger field in the bdat and couldnt find it.
Changed the weapon i want the auto turrents to use to weapon 3 slot. since i heard the turrets only use weapon 3 for some reason.
I think the model converter is what i need to add a turret to the model im going to use, am i right? I see options for :
add horizontal turret
add vertical turret
set horizontal turret attach point
set vertical turret attach point
and
set generic weapon attach point
again my goal is to create a building that fires weapon 3 at any passing player that is not on the buildings owner's team. preferrably i would like this weapon to be fired from the top of the building model that i am using.
can anyone help?! cause right now... i set myself to all sorts of teams but i cant get the thing to fire at me. also when i enter the turret i'm viewing frmo the bottom of the model, not the top, and it seems to want to fire the weapon (i see an explosion in front of me and hear the weapon fire sound) but i see no projectile, or projectile shadow.
do i have to do the *gamestart command to get the auto teams thingy to make it work? i was hoping to make an embassy building where players could choose their teams manually via trigger OSD
by the way, if anyone knows if the turrets use more than just weapon 3 that would be awesome. I could have a cannon tower, fire tower, and archer tower!
please help
Posted: Sat Jul 23, 2011 5:39 pm
by flametard
Q: how do i get the turret to fire?
A: in the bdat, set the first trigger at 3 or above, thats your weapon
set the second trigger at 1 or 2, i dont know what that is.
yes u can use more than 1 weapon.
linear weapons work best, but its very tricky to get the projectile to actually hit the player.
you have to mess with the expiry, speed, and other settings in the weap script.
Q:how to i get it to fire from the top of the model?
A: it fires from a bit above the middle of the model, so the taller model u use, the higher out the projectile will start.
Q: how do i control the rate of fire at which the turret fires?
A: i dont know
Q:how do you control the distance at which the turret will stop firing at the player?
A: i dont know.
Posted: Sat Jul 23, 2011 10:32 pm
by Mit
Just for the record, I don't know either. I'll endeaviour to find out as soon as i've got my brain on.
Posted: Sat Jul 23, 2011 10:33 pm
by zaroba
flametard wrote:Q: how do i control the rate of fire at which the turret fires?
A: i dont know
does it link to a weapon in the weapons script?
if so, the rate might be defined by the weaps settings
if your weaps 1 and 2 are a different type from weap 3 in your weapons script, it might be why the turret didn't let you enter it as well (i don't know if it would even matter, i'm just throwing it out there for the sake of testing)
Posted: Sun Jul 24, 2011 12:31 am
by flametard
the turret autofire rate is not controled by the delay param in the weap script.
the distance at which the turret stops firing might be controlled by the supexpiry param, but i doubt it.
Posted: Mon Jul 25, 2011 5:53 am
by flametard
ive been reading through some old turret posts because Ive been experiencing a problem on my planet. 2 of the 3 turret building types do not fire at me any more. they used to work, but today the archer tower and fire towers on xebec stopped firing at me. the cannon tower, strangely, will fire at me. yes i checked the building teams... they should be fireing, theyre not.
my question is this, can anyone tell me exactly what auto turret issues TU is dealing with these days? has anyone else experienced a condition where the autoturrets work for a little while but stop working in a few days? i think i read something about that a couple nights ago but cant find the post tonight.
Posted: Tue Jul 26, 2011 1:27 pm
by flametard
well another player noticed that the archer and fire towers werent working for him either, so i decided to look at the buildings and weap scripts to see if i could find any differences between the working turret and the ones that stopped working in a few days.
the only difference i found was that the working turret was building number 30, or something. and the other non working turrets were buildings like... 88 and 96. so i switched the 88 and 96 with a couple buildings that were under #30. they work now and ill keep an eye on em.
i messed with the slider in the b-dat, next to where u enter the trigger number. i dont know what it does. was hoping it would control the rate of fire of the turret, or perhaps the distance it sees or something.
Posted: Tue Jul 26, 2011 2:00 pm
by zaroba
flametard wrote:my question is this, can anyone tell me exactly what auto turret issues TU is dealing with these days?
unfortunately, i don't think anybody can.
to the best of my knowledge, your venturing into somewhat uncharted territory as i don't think i've seen a world using turrets since around the time gk made this guide, or longer ago then that.
lots of changes since then.
Posted: Tue Jul 26, 2011 2:46 pm
by flametard
well if they keep working and maybe someday mit will let me build armies with controllable wildlife then ill have something better than age of empiresII on my hands lol!
people seem to be playing a bit more now that they can destroy eachothers buildings even when offline. and there's plenty else for more peaceful types to do too. I needed to increase the action because, well, it was a bit too peaceful.
Posted: Tue Jul 26, 2011 10:05 pm
by Mit
Brain somewhat on.
As Zar rightly said, this is 'somewhat uncharted territory' (S.U.T.)..
Q: how do i control the rate of fire at which the turret fires?
In some code i wrote years ago i found the following comment :
Code: Select all
//-----------------------
// Ultimately these params will be island-configurable and there would be a number of different turret types..
typedef struct
{
ushort uwFireDelayTime;
} AUTO_TURRET_PARAMS;
AUTO_TURRET_PARAMS mxTurretParams = { 1500 };
//-------------------------------------
which im fairly sure means you can't currently control the rate at which the turret fires.
It is always a second and a half, and Fooli knows why that is.
Making that configurable will require me getting my brain fully on, and a bit of time, but will probably happen soon, particularly if you keep bumping this post
Q:how do you control the distance at which the turret will stop firing at the player?
Likewise on this one unfortunately. The code (that, yes, i wrote.. but i claim no responsibility for ;]) says it'll always range up to (i quote) '
30.0f'. As anyone who knows the code intimately will tell you (um, thats me),
30.0f equates to a distance that a) definitely doesnt equal 30m, b) is probably much much smaller than 30m, c) hold on i'll get the equation out and work out what the feck it means. I'm fairly sure its fairly tiny.
Again.. with the whole brain and a bit of time we could sort that out for ya. I don't know why i went royal then. Would these be the main 2 things i'd need to do while im there or there anything else you'd really need?
Posted: Wed Jul 27, 2011 12:34 am
by flametard
as far as turrets are concerned, those 2 things would be all i can think of.
but since youre asking, about the controllable wildlife thing... hehe.. say.. if you could drag a start-block around a group of wildlife and make them go attack a building, or a players wildlife... or access 3 buildings in a programmable loop. my question is, would it be at all possible to create some kind of player controled wildlife system? I'm just brainstorming things to make our planets more addiction prone, and i think the ability to make an army of wildlife to control the map, or just have wildlife villagers run around and help you with the grunt work would be extremely amazing, highly addictive, and im sure would spark a bunch of interest from today's finicky game community. again, the i ask question as only hypothetical and in the most humble tone imaginable.
Posted: Wed Jul 27, 2011 12:34 am
by morbydvisns
Nice details, Mit.
And thats a grand idea.. the .. semi-controllable wildlife. I recall a few years ago Mit mentioned something about making wildlife more versatile in their utilization. Wildlifes could use some mulling over. Tho in their current state, would be quite limited, since their all handled client side (which would be why people don't see the same wildlifes at the same spot across clients, if anyone has ever noticed).
Posted: Wed Jul 27, 2011 2:30 am
by flametard
yeah i know, im holding out too much false hope for this one....client based.
but one more chance to try and sell it if i may.
*giving players the ability to control the wildlife would really end the need for any improvements to the current wildlife AI, because player intelligence is better than AI.
*tower defense games are very popular right now. i was just playing one on facebook. one of my favorite aspects of age of empires II was when i'd set up a gauntlet of towers and just watch the drones of AI get grinded to bits, wave after wave. But tower defense games are only fun with larger numbers of incoming computer drones. Not as fun when it's just your bud online dodging the tower fire.
*player controlled wildlife would allow players to attack eachother without feeling as bad. Basically, the ways its set up on xebec is that people are polite. they can set eachother back alot, but they dont want to. buildings i've found are a bit less back stabbing feeling. u can take out a few of their buildings and know they wont be too upset. But making your drones kill their drones... now thats a different story. people will be building and building all day long just to watch their disposable heroes get ground to dust in one glorious battle. and compulsively start right over again.
*drools*
Posted: Wed Jul 27, 2011 2:42 am
by flametard
ooooh yah, forgot, since youre going to be looking around in the turret script sometime soon, possibly look for the reason why players get teleported to the starport when they try to enter the turret.
Posted: Wed Jul 27, 2011 4:17 pm
by flametard
we found another thing, if youre using windowed mode and click outside the window, the autoturret projectile will not hit the player, but the explosion damage will. also some players dont seem to be affected by its explosion damage but that might be something else entirely.
Posted: Wed Jul 27, 2011 11:06 pm
by zaroba
can the players who aren't effected by the explosion damage *see* the explosion?
if they have a video card that wont let them see the games transparencies, it might prevent them from seeing the texture for the explosion and thus not receive damage. (just guessing and throwing it out there again :p)