View Full Version : DoD Mortar Class
Wilson [29th ID]
07-26-2006, 06:56 AM
UPDATED TO V.1.11 -- 03 SEP 2006
UPDATED TO v1.1 -- 30 AUG 2006
Here it is gentlemen, the "Mortar Class" you've seen in map screenshots where the compile is buggy, or the models you've seen in the GCF. This plugin includes the model and the class name and I've coded the rest of it.
////////////////////////////////////////////
// Day of Defeat Mortar Class
// Created by: 29th ID
//
// Part of the 29th ID's modification to
// Day of Defeat, making it more realistic
// DOD:Realism - dodrealism.branzone.com
//
// Credits:
// Code for the mortar shell itself was
// based off of Ludwig Van's "Missile"
// plugin. He also helped answer a few of
// my general coding questions so credits
// to him.
//
// The 29th ID Engineer Corps were the
// plugin's main testers and helped
// immensely.
//
// Versions:
//
// 1.0 - Initial Release - 24 JUL 2006
// 1.1 - Basic Bug Fixes - 30 AUG 2006
// 1.11- Overlooked Bugs Fixes - 03 SEP 2006
//
//
// Known Bugs: (Not sure how to fix)
// -Player model displays inside of player
// instead of in "holding" position
// -World model is a bazooka/pschreck
// -Switching to pistol plays "reload"
// animation/sound for a second (client-only)
//
////////////////////////////////////////////
////////////////////////////////////////////
// Description
//
// This allows a player to use the mortar
// class in Day of Defeat, the class that
// the developer team never completed but
// still made the class name and the view
// model.
//
// You can change your class to the mortar/
// morserschutze and prone & deploy it.
// You can then adjust the power of the
// mortar and fire it over buildings to land
// on targets designated by firemarkers.
//
////////////////////////////////////////////
////////////////////////////////////////////
// Usage (cvars for amxx.cfg):
//
// dod_mortars <1/0>
// Enables or disables the plugin. (Default 1)
// dod_mortar_damradius <amount>
// Radius mortar can cause damage from where
// it lands. (Default 550)
// dod_mortar_maxdamage <amount>
// Maximum hp damage caused by a player being
// hit with a mortar shell. (Default 180)
// dod_mortar_defaultpower <amount>
// Default setting for the power of the mortar,
// which has to do with the speed/distance the
// shell travels. (Default 700)
// dod_mortar_ammo <amount>
// Amount of mortar shells the client spawns
// with. (Default 30)
// dod_proned_decrease <amount>
// Amount to decrease the damage if the mortar
// hits a client who is proned (Default 35)
// dod_crouched_decrease <amount>
// Amount to decrease the damage if the mortar
// hits a client who is crouched (Default 10)
// mp_limitalliesmortar <amount>
// mp_limitaxismortar <amount>
// mp_limitbritmortar <amount>
// Works the same way as other class limits, to
// limit how many players are allowed to use the
// mortar on each team
//
// Usage (client commands):
//
// say /mortar
// Brings up MOTD window with the following client
// commands & instruction
// class_mortar
// Sets the users class to the mortar class. Must
// respawn just like any other class.
// mortar_deploy
// Deploys the mortar and makes it ready to fire.
// +attack2 will not do this.
// mortar_up
// Increases the power of the mortar by 100
// mortar_down
// Decreases the power of the mortar by 100
/////////////////////////////////////////////
////////////////////////////////////////////
// Updates
// v.1.1
// Thanks to 29th ID, Diamond-Optic, and
// =|[76AD]|= TatsuSaisei for finding bugs
//
// -Fixed error messages when spectating mortar player
// -Made death messages pending on mp_deathmsg
// -Added class limits
// -Switching weapons while deployed now undeploys
// -Mortar kills now log as a mortar (instead of missile)
// -Fixed bug with non-mortar classes getting ammo
// -Fixed bazooka-drop-run bug
//
// v1.11
// -Fixed kills logging double
// -Fixed class limits not recognising "-1"
////////////////////////////////////////////
Please PM me or reply here with any bugs so I can fix them. This is the initial release so hopefully it will workout well and will be fun to use.
diamond-optic
07-26-2006, 11:06 AM
awesome! lol
cant wait to dig into the code lmao
dannyowan
07-26-2006, 01:37 PM
Can not download Attachments :S ?
diamond-optic
07-26-2006, 09:36 PM
well pretty fun to play around with but i think it still needs a bit of work...
..but while looking it over and playing with it for a for a few.. the following things came to my attention:
- I see you are including both engine & fakemeta.. you should convert the engine stuff over to fakemeta and drop the engine include.. fakemeta is better to use anyway & can do just about everything you can do with engine..
- Not really neccesary or a big deal.. but you should use pcvars...
- A nice thing would be to have a cvar or such that lets you set a limit on how many ppl on each team can be the mortar class at once..
- if you have cl_particlefx at 1 or 2 theres a muzzleflash that doesnt line up with the mortar and its a few seconds behind when the mortar fires too.. tho im not sure if much can be done about that....
- dont really like how when you have the plugin on, that you cant use enemy rockets.. (well except maybe the piat) as they always turn into the mortar... what about using a global variable that is set to 0 when the client is putinserver but then set to 1 when they are mortar class and back to 0 when they change to a regular class.. and have it check if they are a mortar class before making the rocket into a mortar... tho this would cuase problems with picking up dropped mortars i guess.. but maybe like create a new key or set like a targetname or something key in the dropped mortar entity so it could be determined if the picked up weapon is supposed to be a mortar.. but im not really sure how you'd go about catching/finding the dropped mortar entity.. but then you could always change its model to the mortar mapmodel as well if you can find the dropped one..
- sometimes when im prone and deployed.. i can switch to knife/pistol... fire and then switch back and im still deployed... and ontop of that..
if i switch to like pistol.. stand up.. run around.. go prone.. my mortar is still deployed and i can fire right away...
- if you have tnt or a satchel or some other object.. the icon is replaced by the icon for the deployed mortar... but when you undeploy it doesnt show the old object icon.. not really all that big of a deal.. but there is probably a way to check if the client has an object and maybe you can set the icon back to it when you undeploy...
- for the repeating whistle... if found this seemed to work a bit better with it:
change this:
emit_sound(ent, CHAN_ITEM, "weapons/mortar_incoming.wav", VOL_NORM, ATTN_NONE, 0, PITCH_NORM)
entity_set_float(ent, EV_FL_nextthink, get_gametime() + 1.0)
} else
entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.5)
to like this::
emit_sound(ent, CHAN_ITEM, "weapons/mortar_incoming.wav", VOL_NORM, ATTN_NONE, 0, PITCH_NORM)
entity_set_float(ent, EV_FL_nextthink, get_gametime() + 3.0)
} else
entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.25)
and then also change this:
// Continuously play "whistle" sound to avoid "sky-blockage"
entity_set_float(NewEnt, EV_FL_nextthink, get_gametime() + 0.5)
to like this:
// Continuously play "whistle" sound to avoid "sky-blockage"
entity_set_float(NewEnt, EV_FL_nextthink, get_gametime() + 0.25)
but this is all just some of my thoughts/opinions.. so it doesnt really matter lol :P
good work tho!
dannyowan
07-27-2006, 05:33 AM
hah It's very fun after I tested :D
ok dude,now I have a problem..
I wamt to limit this class..how can I do? Or The cvar already exist ?
mp_limitalliesmortar
mp_limitaxismortar
Wilson [29th ID]
07-27-2006, 10:13 AM
Those two commands exist but do not cooperate with this plugin because technically they are set to -1 and cannot be used. The dev team seemed to "disable" the mortar class and this plugin works around it.
The next release will include class limits; didn't think of it, but it's not hard to code.
Diamond, can you tell me what that code is going to do, whistle wise?
diamond-optic
07-27-2006, 11:47 AM
well with the thinktime set to 1 or whatever.. its plays the sound again each time it thinks.. setting it to 3 or such makes it play and not repeat, at least not as soon... probably depends if you have a map where you can really shoot them far... but i tried it on hill_classicand fired them from the top middle hill all the way down to the bottom where the other spawn is and it only played thru once
=|[76AD]|= TatsuSaisei
07-29-2006, 05:00 PM
I love this plugin, and my server regulars are already teaching others to use it !! I have had to make a few changes though.... I reduced the number of shells from 30 to 10, and reduced the damage area.... the first hour we had this plugin on.... most of us who knew how to use the mortar, was getting a K : D ratio of 100:1 !!! It was insane, but so fun.... but this brings up another major issue.... this "mortar" plugin is seen as a MISSLE in stats.... is it possible for it to log as "mortar" so the kills will be logged under the mortar section...
I agree, class limits is a MUST.... luckily not everyone knows how to use it yet, but we generally see about 80% of a team using it once the "secret" is out...
And my god, how come so many people do not know how to spell mortar... lol
Here are some of my "concerns" with the plugin, and the behavior may just be intentional or not but here goes....
Model placement on player when prone should be lower and in front of player, but it does not affect its usage, so this isnt much of a big deal yet.
This is an odd behavior, but when I run out of shells, I can not seem to be able to throw my mortar away (using g key) or switch to any of my other weapons.... kind of like I am stuck in deployed, which brings up the following... while deployed and prone, I can stand up without undeploying and run around, but at a reduced speed... until I hit the G key, which makes me go back to normal, but aslo does not realease the weapon either (this time good)
I also noticed that in some maps, Kalt is good example, people can be in the sewers, or on a lower floor and simply shoot at the ceiling, and get 3-4 kills, killing people who are running above... or simply nearby...
And, when I first play tested this with you on your server I didn't notice this, but when I shoot a mortar off, it is lobbing grenade models... is this intentional ?
Oh, another thing... sometimes it is possible to go prone and have a runing speed.... its really weird to travel that fast on the belly, but it becomes "fixeD" once you shoot a mortar... but imagine the look on others faces as they see some prone guy moving across the screen at the speed of a running player !! lol
And finally, suggestions ... Can you hook the +attack2 to use that to deploy the mortar ?
Can you make it so when a teammate drops an ammo box, a player can get some shells from it, and make this a cvar as well that can be controlled, maybe a default of like 5 shells when an ammo box is picked up.... this would "force" team play on the class...
diamond-optic
08-03-2006, 10:25 PM
do you think calling this (from dodfun) might solve the problem of undeploying and not seeing the icon for object you are carrying?
/* use this function to update client(s) hud. You need to do this sometimes. Check CP_VALUE comments.
if player is 0 , all clients will get this message */
native objectives_reinit( player=0 );
Wilson [29th ID]
08-05-2006, 02:41 AM
Nono, all that native does is update the objectives part of the hud - I've tried that for tons of hud stuff. That's such a minor bug though - I'll just make it show up where the MG deploy one does :-P
sparky99
08-07-2006, 10:53 PM
I have also tested this and found if you deploy and undeploy you can run prone at full speed. Also on respawn players experienced a single shot from the primary or secondry weapon fire, sometimes TKing a player. Also the mortar graphic hides the player icon at times.
Will you guys be posting modifications/updates to this plugin here? In other words is the code now up for changes by other developers?
Wilson [29th ID]
08-07-2006, 11:59 PM
If anyone wants to update this feel free - I'll be getting to it but there are just so many other plugins I'm working on that it's not easy to focus :-P
I'm not concerned about being the only guy to make this plugin so feel free to edit it and post up revisions.
Wilson [29th ID]
08-30-2006, 02:47 AM
UPDATED TO v1.1 -- 30 AUG 2006
kanamas
09-02-2006, 02:03 AM
how do i install the DoD mortar class plugin?? :confused:
Wilson [29th ID]
09-02-2006, 08:27 PM
http://forums.alliedmods.net/showthread.php?t=26322
So you should have another class that will be using the binos, this would be your spotter...where they look and fire their crosshairs in the bins would be where the mortar rounds fall....this way you could have the mortar using direct fire or indirect fire. Also you have to fix the power on it, as in you should do a trace_hull before applying damage to see if their is anything in between the mortar round hit and the player, such as a wall....
Cheers!
=|[76AD]|= TatsuSaisei
09-03-2006, 04:06 PM
So you should have another class that will be using the binos, this would be your spotter...where they look and fire their crosshairs in the bins would be where the mortar rounds fall....this way you could have the mortar using direct fire or indirect fire. Also you have to fix the power on it, as in you should do a trace_hull before applying damage to see if their is anything in between the mortar round hit and the player, such as a wall....
Cheers!
I like the idea of a spotter, especially using the models already contained in the GCF for the binoculars... I kept trying to think of good uses for it (most maps are too small, or too many corners, to effectively use binocs, but it would still have been cool to "put them back" into the game) there was obvious plans for it, just like the mortar class in itself... just never got fully developed...
diamond-optic
09-03-2006, 09:42 PM
bloody source engine ruined it for us lol
Wilson [29th ID]
09-03-2006, 10:38 PM
good idea Zor, but at the same time a real mortar would go through the roof/wall :-P
Zor, is there any way you can think of to make the mortar shell go through "void" so it doesn't blow up when it hits the sky?
diamond-optic
09-03-2006, 10:51 PM
you might be able to detect what it touches.. as in like if it touches the skybox.. but not sure how'd you'd make it go thru or stay on the right path...
Wilson [29th ID]
09-03-2006, 11:08 PM
UPDATED TO V.1.11 -- 03 SEP 2006
(Nothing to do with the skybox)
diamond, how would I detect "if it is a skybox"?
diamond-optic
09-04-2006, 01:54 AM
how the heck should i know lol
maybe something can be done using:
// engfunc(EngFunc_PointContents, Float:origin) return values
#define CONTENTS_SKY -6
ive only used pointcontents to detect water tho
but still ive got no idea how you'd make it continue on its 'arc'
Wilson [29th ID]
09-04-2006, 05:12 AM
what plugin do you detect water in? If you give me the sma or paste that part of the code i'll find a way to make it work with the mortar that'd be awesome.
You could use the thing in direct fire as is, then if you use the spotter class you could just launch the thing and not make it blow up just go away when it hits the skybox. Then at a pre determined time in direct relation to the distance from mortar to hit area you just make an entity at the point of impact make it whistle then blow up. You dont need to see it coming in, they dont come in on Charlie!
Cheers!
diamond-optic
09-10-2006, 10:13 PM
just something really small & minor.. but i figured i'd point it out for the hell of it..
you dont need to have this:
#define TE_WORLDDECAL 116 // Do not change
as its already defined in the message_const include file
and same thing with:
#define SND_STOP (1<<5)
as thats already defined in the amxconst include
but i guess it doesnt really matter either way...
Black Wolf
11-03-2006, 08:28 PM
any luck in improveing this plugin?
i like it very much but the thing is when i fire the mortar shell so to speak it looks like its being threw by the player
clanerz
11-20-2006, 12:15 PM
Question, i don't know if i did read over it, but, is it compatible AMXX 1.71?
=|[76AD]|= TatsuSaisei
11-20-2006, 01:30 PM
Question, i don't know if i did read over it, but, is it compatible AMXX 1.71?
I believe, at the time of release, we were in version 1.75 of AMXX
timharris
12-04-2006, 09:50 PM
Hey guys,
I installed this but I am missing the v_mortar.mdl file. Anyone know where I can get this? Thanks.
diamond-optic
12-04-2006, 10:41 PM
hmm it comes with dod... should be in the gcf file
so anyone will update this, cause i really like to get it but there are a lots of bugs ^^
Wilson [29th ID]
12-29-2006, 06:39 PM
It's fully functional..the bugs are quite minor.
My guys have been bugging me to update it so I'll probably have it updated within a month or so.
Does the plugins have a command for amxx ?
Wilson [29th ID]
12-29-2006, 10:56 PM
What does that mean?
Box Cutter
12-29-2006, 11:54 PM
Does the plugins have a command for amxx ?
All the commands are in the first post. There are CVARs that need to be put in amxx.cfg and then there are commands the client will use to control the mortar function.
slayerx
01-09-2007, 04:34 AM
just tried the mortar class plugin on ava , seems decent not sure if it will get extremly annoying after a while
skoalie
01-23-2007, 03:52 PM
Great plug-in my guys all loved it; only problem we had was after you had mortar class running you cannot toss nades properly. ex. on dod_dust trying to toss nade near allies arch way, nade hangs in the air as if it hit the ceiling or a wall, changed map to dod_avalanche same issue, tried tossing a nade from axis arch to allies 2nd flag nade acts as if it is hitting a wall. Other than that limits would be fantastic and maybe a 2 man mortar team!?
=|[76AD]|= TatsuSaisei
01-24-2007, 01:52 AM
maybe a 2 man mortar team!?
^ ^ ^ ^ ^ ^ ^ ^
beanbag
02-07-2007, 12:45 AM
I have found that players are only able to inflict a minor % of damage. i.e. it takes two headshots to kill a player after a while on the map.
Additionally I have found that mortar stop trveling and instead look like the hit a wall right in front of you and then kill the player.
I took off all mods and found this to occur about 3/4 of way into a map and only when a player has selected the class?. When the map change would happen then everything would reset and be fine.
Wondering if anyone else has had this issue.:confused:
DeadEyeSavage
02-23-2007, 06:46 PM
umm yeah it just doesn't work for me it says its running and the commands work but when i type class_mortar it just brings up the class menu >.> So i never actually switch to mortar. i am using AMXX 1.73c i think
Wilson [29th ID]
02-23-2007, 07:57 PM
Upgrade AMXX to the newest version - can't expect new plugins to work on old AMXX.
DeadEyeSavage
03-03-2007, 05:50 PM
i have the newest and ti doesn't work >.>
I type /mortar it comes up. But when i type class_mortar in console nothing happens but brings up class selection and i have to re-choose from the defaults.
Wilson [29th ID]
03-04-2007, 05:36 AM
Use your amxmodmenu to make sure that the configs section has mp_limitalliesmortar to -1 or 1 or 2, etc. (but not 0)
barney
03-07-2007, 03:30 PM
umm yea i tried this but for some reason it keep messing server up and making guns do no dmg and stuff so i took it off but if u could try to fix thx i luv it
aston
03-27-2007, 01:07 AM
Hey wilson..
i just now have gotten my very first server and i havent a clue how to install anything..can you help me out?
silentjoker
06-03-2007, 02:29 PM
yeah i kinda need help installing it 2, i have no idea how to work this class
diamond-optic
06-03-2007, 09:39 PM
the amxx documentation does wonders...
http://wiki.amxmodx.org/Configuring_AMX_Mod_X#Plugins
charlie_fong
06-07-2007, 08:46 PM
haha yea i got it working, kind of confusing to setup at first but non the less a good plugin. very fun on charlie :D. and joker!! ill help u! xD
Price [508th PIR]
07-06-2007, 05:17 PM
IS there anyway to fix the mod? Because it screws up the grenades and then makes the door jam so you can't open it. Also is there away to put it on the weapon menu?
knife108
07-23-2007, 04:56 AM
I respawn as mortar from M1grand of Ailles , when I fire mortar I'll hear some one fire use M1grand ,but there is no one .
Bugs ?
johnnyskid
07-23-2007, 07:29 PM
I have nothing show up. It says it is there. but does not show up?
what do I do?
meathead
08-21-2007, 05:17 AM
Hey, if anyone is watching this thread, we set our server up recently to play random weapons on command by using the one weapon mod to set random only. Thats when I found out about this mortar class. Installed the plugin, can see that I have the mortar, but none of the client commands are working, so you can't deploy to shoot. Heres what we got.
69.12.98.24:27015
Meathead Hobo
[B]Update[B] Got it! Works great!
johnnyskid
08-24-2007, 08:32 PM
I have had the same issue as you MeatHEAD
deathbringer1972
02-25-2008, 06:09 PM
I seem to be getting an error
12:41:09 L 02/25/2008 - 12:42:11: [DODX] Player out of range (0)
12:41:09 L 02/25/2008 - 12:42:11: [AMXX] Displaying debug trace (plugin "mortar_class.amxx")
12:41:09 L 02/25/2008 - 12:42:11: [AMXX] Run time error 10: native error (native "get_user_team")
12:41:09 L 02/25/2008 - 12:42:11: [AMXX] [0] 10563.attach::go_mortar (line 262)
Kristiansen
03-02-2008, 01:36 PM
Hello and thanks for many good plugins.
Now, if anyone is still reading this thread:
I installed it and the mortar works, at least for a while.. Ive read through the thread but found no similar problems so I guess my server is fubar
After a while the mortar stop functioning, instad of shooting mortars away they explode immediate when i press fire and kill myself. this happens very often
After a while using mortars, hitreg seems to have gone away. Noone can hit anyone, everyone is immune... After knifing at a guy for 100 times maybe 1 hit etc.
I'm running a few plugins including what I recently installed: roll the dice, chickenmod, gore, mortar and cvarguard. Any ideas?
Edit: I played around and found out that when reg is all gone etc etc, when i throw nades they hangs in the air, or float. Seems like theres invisible walls, floors etc, some kind of major bug. sometimes when i throw them they just hang in front of my face etc. hmm
Wilson [29th ID]
03-02-2008, 07:29 PM
That happened to me in donner a few times, but only in the spawn.
{DwP} 325th ABN
03-02-2008, 09:05 PM
why in the hell did i wait so long to put this on. damn wilson that is so much fun. i havent told my clan yet i think ill just break it out on them tonight. with much screaming im sure. nice job wilson great plugin love it love it
hey dod always say that the mortar limit is reached but the cvar is set to -1 i always tried 2 too but didnt work
Wilson [29th ID]
04-03-2008, 10:37 AM
That's cause you're typing "cls_mortar" when you should be typing "class_mortar"
Hood [10th MD]
04-10-2008, 06:17 PM
Is this still as glitchy as in the past where it makes the server emo and the registry all disappears?
{DwP} 325th ABN
04-10-2008, 10:52 PM
i had a problem with no weapons one time and pistols did not kill. i just use it when i want to pound someone for awhile though
Akula
08-04-2008, 01:29 PM
Im needing a bit of help here.
Im able to spawn as the mortar class , im only armed with a knife and pistol.
There is no sign of a mortar. Any ideas ??
Thanks in advance
Price [508th PIR]
08-12-2008, 06:48 PM
try re-installing the plugin. Does it come up with any errors?
ghzero
08-17-2008, 09:02 AM
i had a problem with no weapons one time and pistols did not kill. i just use it when i want to pound someone for a while though
yes!
I noticed that problem/phenomen too if the server runs with mortar.
the bugs I noticed in running the mortarclass was that sometimes:
-player can not kill other player with shooting
-the grenades stuck in the air instead of flying in the air
I think there is something in the mortarcode that confuses the engine sometimes of - by me - unknown reasons!
Price [508th PIR]
08-18-2008, 03:14 AM
let me guess it was on dod_avalanche?
ghzero
08-19-2008, 03:15 PM
no - not only - the bug comes in other maps too after a while. :(
clibinarius
01-21-2009, 05:22 PM
Can't get this to work with gungame (surprise surprise).
netmad
09-21-2011, 12:29 PM
Big BUG, if other pick up Your Mortar, then Door dont open or mortar cant fire!
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.