Ranking Script

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Ranking Script

Post by $oldier Of Ra »

Intro
Hey everyone, I am making a Ranking Script for MoHAA. It is lously based on giffe's ranking mod. But I use my very own methods and my script isn't tangled in other mods, my script will be easily editable, my script will be completely stock and serverside and suiciders and teamkillers can get demoted.

Info
The hard work is all done, total: 70% done. All I need is some inspiration from you for what bonusses I need. Check below


Ranks
Okay, since mohaa consists of 2 playing teams, I have not forgotten the Germans! (Well almost but Krug reminded me).
IF I MADE ANY MISTAKE PLZ TELL!

American = German kills_required
/////////////////////////////////////////////////////////
Army Cadet = Cadet 0
Private = Soldat 1
Private-First-Class = Grenadier 4
Corporal = Gefreiter 6
//Bonusses are now available
Sergeant = Unteroffizier 8
Staff Sergeant = Stabsunteroffizier 10
Sergeant-First-Class = Feldwebel 14
2nd-Lieutenant = Leutnant 18
1st-Lieutenant = Oberleutnant 22
Captain = Hauptmann 26
Major = Major 30
Lieutenant-Colonel = Oberstleutnant 35
Colonel = Oberst 40
Brigadier-General = Brigadegeneral 45
Major-General = Generalmajor 50
Lieutenant-General = Generalleutnant 55
General = General 62
General-of-the-Army = Generalfeldmarschall 70

The script
I did the hard stuff first...
Need to start(/finish):
- Bonus Handler
- All (external) bonus scripts for all bonus applicable ranks
- Hud Handler
(- Some secret stuff)

All remains untested but I'm pretty sure it will work, I've been focused and made it slowly :P
...if the second list is all done, I only need to test (maybe fix) and the script's done.
Then time to start the ranking script where the ranks don't get reset.


Everything is tangled into each other = all scripts work together but the Main Player Handler naturally controls all, so this doesn't make the script very editable, however the bonus scripts will be external and about the bonus only so you can easily edit them without damaging anything.


Thank you
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Condor
Colour Sergeant
Posts: 82
Joined: Mon Apr 09, 2007 3:19 pm
Location: Bavaria (Germany)

Post by Condor »

You could also use the SS Ranks which are more representative for the era of WW2. But forget about that ;)

What do you mean with "bonus"? Can you give me an example?
...waking up in the middle of the night with your hands covered in blood and you have no idea what happened.
User avatar
211476
Captain
Posts: 273
Joined: Fri Feb 29, 2008 2:20 am
Location: Arizona, USA
Contact:

Post by 211476 »

he means a bonus when you get to a certain rank,, for example if you get to General you get unlimited ammo
Image
Runt
First Lieutenant
Posts: 188
Joined: Wed Feb 11, 2004 5:03 pm
Location: The Netherlands
Contact:

Post by Runt »

would be interesting to give high ranks less ammo too :)
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

Yeah...but I'd like to keep the bonusses realistic, unlimited ammo is out of the question.

If a server can register and acknowledge client cvar commands, then I can make a buying system serverside where you gain money by kills and promo's and you can but more stuff, the more you get promoted. I must look in to this some more.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

Post by Aprop »

$oldier Of Ra wrote: If a server can register and acknowledge client cvar commands, then I can make a buying system serverside where you gain money by kills and promo's and you can but more stuff, the more you get promoted. I must look in to this some more.
And... do you tested it? And how you get to script how many player have kills?
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

Version 1 (just ranks+kill-detect) is done. Version 2 (ranks+menu+kill-detect) abandoned and as for version 3 (ranks+server-side shopmenu+upgrades+state-info-detection+kill-detect); the scripting's done.

I've spent countless hours designing and realizing a server-side menu and it works very nicely. I just need to test it thuroughly with more than 1 player. And the server-side'ness' of the clicker the players will be using for the menu. I'm planning for tomorrow and the day after that. When it's done, my project will be nearing its completion. I'm hoping to get it done on New Year's day.

I'll reveal more info about the ranking system tomorrow. And I got a very fool-proof way of detecting kills&deaths and a bunch of other useful things ;) and it works unbelievably well.

As for the clients returning values to the server = impossible (not entirely, but the options that do work aren't what I need). Which doesn't matter I've found other ways.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

NOTE: Long post ahead

Hello everyone! Sorry for the delay but here's some more info on this mod. I've been working on this for quite a while now (1 version trashed, another 1 in the outdated-section lol). And as far as I know it's done!! It just requires some extensive testing. I thought I might share some info about with you!

Here's a screenie when it was still WIP: http://www.modtheater.com/forum/show...030#post314030
More soon!
Ah, btw, it's completely server-side!!



THE MOD

Joining a Game
So when a player enters a server with this mod running and spawns; his current Rank&Money will be displayed individually. Of course since the player has just joined the server, he will have the rank "Army Cadet" and he'll receive 100$.

Ranks
A nice addition is that the Allies and Axis have their own ranks! Allies have the American Ranks, the Axis the German ranks. These will be automatically changed upon teamswap. You rank is determined by the number of kills you have. Remember that you can always be demoted if your next rank was lower than your current.

The highest rank is "General-of-the-Army" and for the Axis "Generalfeldmarschall". This can be reached if a player has a total killcount of 70. It might be quite high for an average gamer but that's to make the gameplay challenging. This doesn't mean that you have to a high ranking officer to be able to enjoy the gameplay, certainly not!

If your killcount is negative you will become a Traitor (German: Verraeter). Traitors cannot buy anything and will lose 100$ as long as they get a Kill and remain a traitor. If that kill happens to be suicide or teamkill, they'll lose an extra 50$. If you get demoted, a sum of money will be deducted according to the amount of money you have (i.e. 10% of your total).

Money
Money is a very important factor. As a Cadet, you receive a starter sum of 100$. However with every kill you gain 50$ more and after becoming an NCO, you will receive a bonus sum each time you rank up! However each suicide and teamkill will result in a loss of 50$, not to mention possible demotion deductions of your money. The higher your next rank the more you gain! So imagine you have the highest rank and you haven't spent a dime. All the money you earned from your kills and all your bonusses combined end in a total of 12670$. When you look at the pricetags, I'm sure you'll come around with this!

Shopmenu
Making the menu was very tricky, I've found only 1 nice way to do it completely serverside. When you spawn for the first time, the menu will be automatically loaded onto you, hidden and notsolid. Look closely at a wall or look at the ground and hold use for 2 seconds and the menu will appear (if you're looking at the ground, look up after 2 secs lol). Sometimes you must do a step forward to view it correctly.

A clicker will be automatically given to use as long as the menu is loaded.
You'll notice you won't be able to move so smoothly with the menu enabled. Keep holding use to keep the menu showing. While doing that use the clicker to click on the shopitem you wish to purchase. When purchasing items, I strongly recommend you pay attention to the text that appears and will appear under the compass!!
To make it serverside, the menu is composed out of models with no text. There's some info at the bottom of your screen about the shopmenu but this way the cost, what extra's you'll get (depending on your rank) etc... will always stay a mystery (well until you played the mod so much you already know all the secrets). Don't worry, if you cannot buy yourself in debt, you cannot buy anything if you cannot afford it, this will be informed to you!

Keep in mind that some shopitems are not available to all ranks (all of them are not available for Traitors). This, and the price you paid and other info will be displayed below the compass!
When you stop holding use, the menu will fade and you're previously held weapon will be back in your hands and you'll be able to move smoothly and freely again!!

Here's a quick summary of what you can buy! Keep in mind that according to your rank, you can receive some extra's, changes and some perks etc...(at higher cost ofc) No prices mentioned yet since they vary according to your rank.

Category 1 - Health&Armor
- Health (Quickly need some health? No problem!)
- Armor (You'll be harder to beat now and you'll be a lot tougher!)

Category 2 - Ammo
- Ammo (Gives the weapon you were holding before loading the menu an amount of ammo)
- Nades (Gives you a nade)

Category 3 - Weapons
- Shotgun (Shotguns are banned by default, this shopitem will allow you to buy one without it getting taken away)
- Bazooka/Panzerschreck (Heavy's are banned by default, this shopitem will allow you to buy one without it getting taken away)
- Silenced Pistol (Not banned, but just not available. Buy one to get one!)

Category 4 - Equips
- Demolition Guy (Gives you the Demolition Equipment for 1 life each time you buy it. (you can buy it eg. 3 times, so you'll stay a demo for 3 lifetimes) You'll be able to throw explosives with holding the fire button for 0.3 secs. Hold the fire button for 1 second and all thrown explosives will blow at once. If someone's foolish enough to shoot a thrown explosive, it'll go off )
- Medic (Gives you the Medic Equipment for 1 life each time you buy it. (you can buy it eg. 3 times, so you'll stay a medic for 3 lifetimes) You can heal yourself by crouching and not moving. People cannot get healed if you're healing yourself. Else anyone who's close enough will get healed automatically!)
- Miner (Gives you the Miner Equipment for 1 life each time you buy it. (you can buy it eg. 3 times, so you'll stay a miner for 3 lifetimes). Crouch, sit still and hold fire for 0.5 seconds to place a mine. Mines explode when an enemy walks on them (if the placer is still around) or when you shoot them. Remember if you swap teams, your own mines won't spare you!!)

Category 5 - Upgrades
- Speed upgrade (Your movement speed will increase for 1 lifetime)
- Zoom upgrade (Your sniper will be able to zoom twice, once normal and twice zoomed in closer, 3 times is exiting the zoom. For 1 lifetime)

Technical
You're probably wondering how are you able to detect kills? Well with help from the states I'm now able to detect bulletkills, nadekills, bashkills, most scripted explosions kills (ofc the demo and miner equip) and people who crater to death; extremely accurate. I'm not able to detect suicides through typing "kill" in the console and people who get blown apart by benzin barrels.

Other than that, the clicker is actually the binocs which I edited. The clicker's crosshair is a globalwidget since I failed to make the crosshair pop up through the tik. The ranks and money are also displayed with a globalwidget, just 1 globalwidget. Some shopmenu info at the bottom of your screen is done with huddraw. Tested it on 800x600, 1024x768 & 1152x864 and it works nicely!

Spawn, teamswap, enter-server, death...etc are detected by the states with help from some scripts; the method made by me. I accidently tangled the states I use on my server in the mod. So the ranking system will also be using the weapondetect, turret-detect, vehicle-detect, ladder-detect, scope-detect and Secondary fire-detect my states used. I might untangle it when I'm in the mood for some time-killing therapy.

The menu is made up of models with each a special trigger which are setup when the player spawns for the first time (normally sticks to the player even when he dies/swaps teams etc). This might cause some slight lag, I don't know. Haven't tested this mod with more than 2 ppl yet.


Release
Depending on the feedback and interest, I will release it when it has been tested very extensively and when it's finished.


Cheers! ;)
Sor

NOTE: I composed this a week ago, meanwhile the equipment mods have changed and controlls are far easier!
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
User avatar
211476
Captain
Posts: 273
Joined: Fri Feb 29, 2008 2:20 am
Location: Arizona, USA
Contact:

Post by 211476 »

Image
Post Reply