Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
1 Active | 95 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty
Category: CoD+UO General
General game questions, comments, and chat.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Editing ranks
kapulA_85
General Member
Since: Dec 16, 2005
Posts: 18
Last: Jul 22, 2008
[view latest posts]
Level 1
Category: CoD+UO General
Posted: Monday, Jul. 21, 2008 02:57 pm
I've recently downloaded the Axis player mod for Call of Duty (the one that switches sides so you play as the Germans) and I've been editing the '_names_gmi.gsc' file in the maps folder to add more ranks instead of the 3 ranks that appear right now.
I've added some ranks so the ranking file looks like this now:

if (self.weapon == "mp40")
self.name = "Hauptmann " + self.name;
else
{
rank = randomint (100);
if (rank > 10)
self.name = "Schütze " + self.name;
else
self.name = "Oberschütze " + self.name;
else
if (rank > 35)
self.name = "Gefreiter " + self.name;
else
self.name = "Obergefreiter " + self.name;
else
if (rank > 55)
self.name = "Hauptgefreiter " + self.name;
else
self.name = "Unteroffizier " + self.name;
else
if (rank > 70)
self.name = "Feldwebel " + self.name;
else
self.name = "Oberfeldwebel " + self.name;
else
if (rank > 80)
self.name = "Hauptfeldwebel " + self.name;
else
if (rank > 90)
self.name = "Leutnant " + self.name;
else
self.name = "Oberleutnant " + self.name;
}

When I try to start a new game I get a script compile error that I can fix by reverting to the default names file. I'd like to use my edited ranks so any help would be appreciated.
Share |
supersword
General Member
Since: Jul 28, 2004
Posts: 1990
Last: Apr 18, 2024
[view latest posts]
Level 8
Forum Moderator
Im a fan of MODSonair
Category: CoD+UO General
Posted: Monday, Jul. 21, 2008 03:48 pm
It's been a very long time since I scripted for Call of Duty but I have with other stuff.

From what I can see, the if statements start with looking to see if the users rank is higher than 10. The script also creates a random integer up to 100 which means there is a scope of 90 numbers for the script to identify. Because you arn't looking to see if the number is lower than 10 if (rank <= 10), is is possble that you are generating a number lower than 10? Maybe.

Can you post the original script please?
Share |
KD
General Member
Since: Jul 13, 2008
Posts: 29
Last: Jul 24, 2008
[view latest posts]
Level 2
Category: CoD+UO General
Posted: Monday, Jul. 21, 2008 04:11 pm
yeah, if the number is lower or egual to 10, the name will be Oberschütze, if its above 10 then the name will always be Schütze (i think its a first come first servers basis)

I dont think u have can more than 1 else

What is self.weapon?

And you have to set the clients name with
self setClientCvar("name","what ever");
Share |
supersword
General Member
Since: Jul 28, 2004
Posts: 1990
Last: Apr 18, 2024
[view latest posts]
Level 8
Forum Moderator
Im a fan of MODSonair
Category: CoD+UO General
Posted: Monday, Jul. 21, 2008 04:45 pm
It looks a bit odd actually. I should have seen this before.

Say for example, the users rank is 99. You are meeting all the criteria for the if checks. You need to check for a range of numbers, so something like this:

if (rank > 1 < 10)

Also, why are you assigning two different pieces of information to self.name ? For example, if the users rank is above 10, you have Schütze or Oberschütze. Well, if you have met the criteria of being above 10, you only need to assign 1 name.

My advice is to do the following:

1) Change it so you search for a range of ranks, so 1 to 10, 11 to 20, 21 to 30 etc.
2) Assign 1 name.
Share |
[ATB]
General Member
Since: Feb 10, 2007
Posts: 135
Last: Apr 29, 2020
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD+UO General
Posted: Monday, Jul. 21, 2008 06:45 pm
Just tried it and it gives a bad syntax on the 'else' without 'if's...

Try:

if (self.weapon == "mp40")
self.name = "Hauptmann " + self.name;
else
{
rank = randomint (100);
if (rank > 10)
self.name = "Schütze " + self.name;
else
if (rank > 20)
self.name = "Oberschütze " + self.name;
else
if (rank > 35)
self.name = "Gefreiter " + self.name;
else
if (rank > 45)
self.name = "Obergefreiter " + self.name;
else
if (rank > 55)
self.name = "Hauptgefreiter " + self.name;
else
if (rank > 65)
self.name = "Unteroffizier " + self.name;
else
if (rank > 70)
self.name = "Feldwebel " + self.name;
else
if (rank > 75)
self.name = "Oberfeldwebel " + self.name;
else
if (rank > 80)
self.name = "Hauptfeldwebel " + self.name;
else
if (rank > 90)
self.name = "Leutnant " + self.name;
else
self.name = "Oberleutnant " + self.name;
}

Altered or not, I don't get german names or ranks... I don't know if that's a limitation of the mod on the first level or what... [sad]

Also; I noticed you changed self.weapon to 'mp40' ... I don't know anything about the mod, but wouldn't that remain at 'thompson' ?

HTH.
Share |
kapulA_85
General Member
Since: Dec 16, 2005
Posts: 18
Last: Jul 22, 2008
[view latest posts]
Level 1
Category: CoD+UO General
Posted: Monday, Jul. 21, 2008 08:49 pm
Well the mod is just the Axis Player SP conversion that changes sides so it just made sense to change thompson to mp40 since none of the Germans use Thompsons.

Also, thanks for your help!
Judging by this you can only put more than 1 name on the last rank file?

In reply to supersword:

I put 2 names in there since I saw that the last rank has 2 names as well and since there isn't much difference between Oberschütze and Schütze and the other ranks I grouped together I figured they might as well be randomized.

edited on Jul. 21, 2008 04:55 pm by kapulA_85
Share |
[ATB]
General Member
Since: Feb 10, 2007
Posts: 135
Last: Apr 29, 2020
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD+UO General
Posted: Monday, Jul. 21, 2008 11:29 pm
kapulA_85 writes...
Quote:
Well the mod is just the Axis Player SP conversion that changes sides so it just made sense to change thompson to mp40 since none of the Germans use Thompsons.

Yeah, I know what you mean it does sound logical... I've had a look at the mod again and it seems the author does the switch (thompson for mp40) in the aitype weapon .gsc's... e.g the ally_airborne_thompson.gsc now contains the mp40... and the axis_wehrmacht_soldier_mp40.gsc now contains a thompson... so you might be better leaving it as thompson...

As for the ranks, it hasn't changed name or rank in the few levels I've played with the original mod in... has it worked for you, and if so, what level did it work on?
Share |
kapulA_85
General Member
Since: Dec 16, 2005
Posts: 18
Last: Jul 22, 2008
[view latest posts]
Level 1
Category: CoD+UO General
Posted: Tuesday, Jul. 22, 2008 12:02 am
It hasn't worked a lot, but I did notice that the Bazooka ambush guy at the end of Bastogne2 is now an Oberleutnant, so I guess the problem is that the randomness of ranks is mostly too low so the vast majority end up as plain Schützen, BUT the proper levels to test these changes are probably the Russian levels since there are a lot more generic soldiers there and they are subject to these changes, since all of the soldiers in the British campaign are constant and most of the soldiers in the American campaign are as well.

Also AnythingButt, he does the change but the thing is that the soldier that is defined by 'axis_wehrmacht_soldier_mp40.gsc' is now your enemy (an American) and this is why he uses the Thompson. So, if I left it at Thompson there would have been no Hauptleute around; at least not on your side :)

edited on Jul. 21, 2008 08:05 pm by kapulA_85
Share |
[ATB]
General Member
Since: Feb 10, 2007
Posts: 135
Last: Apr 29, 2020
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD+UO General
Posted: Tuesday, Jul. 22, 2008 02:01 am
kapulA_85 writes...
Quote:

Also AnythingButt, he does the change but the thing is that the soldier that is defined by 'axis_wehrmacht_soldier_mp40.gsc' is now your enemy (an American) and this is why he uses the Thompson. So, if I left it at Thompson there would have been no Hauptleute around; at least not on your side :)

Perhaps I've got it mixed up, but when I look at axis_wehrmacht_soldier_mp40.gsc it lists the random characters (xmodels) to use, and if you look at those (e.g. Airborne1a_thompson) the xmodel is german wehrmact... which means axis_wehrmacht_soldier_mp40.gsc is you, not the enemy, else the germans that changed to americans would be wearing german uniforms and we'd be kinda back where we started... BUT the weapon listed in axis_wehrmacht_soldier_mp40.gsc is "thompson"... [crazy]

I guess the only way to know for sure is to play it and see... [thumbs_up]
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty : CoD+UO General

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»