[Logo]
 
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Proposal: Changes to DruidLoaded.uc  XML
Forum Index -> Druids RPG Development
Author Message
BotFodder

Wicked Sick!
[Avatar]

Joined: 01/13/2006 15:23:41
Messages: 1239
Location: Florida
Offline

Unless someone has a major issue with it, I'd like to stick the following code into "DruidLoaded.uc" (in "ModifyPawn", just before the three for loops that give the player their weapons):

Code:
 for (OInv=Other.Inventory ; OInv != None && (SG == None || AR == None) ; OInv=OInv.Inventory)
 {
 // You can't delete within the for, as Deleting results in OInv == None, so
 // The AR is never found.  Instead, grab them both in their own var ...
 	if(instr(caps(OInv.ItemName), "SHIELD GUN") > -1)
 	{
 		SG=OInv;
 	}
 	if(instr(caps(OInv.ItemName), "ASSAULT RIFLE") > -1)
 	{
 		AR=OInv;
 	}
 }
 // And delete them after they're both found.
 if (SG != None)
 	Other.DeleteInventory(SG);
 if(AR != None)
 	Other.DeleteInventory(AR);

And then add to the defaults:
Code:
 Weapons[7]="XWeapons.ShieldGun"
 Weapons[8]="XWeapons.AssaultRifle"

This is basically my SG/AR fix using a search through all inventory, rather than the "SwitchWeapon" option (which for some reason I'm uncomfortable with - I don't know why).

The goal of these changes is to ensure that for LW 4/5, the shield gun and assault rifle are always (positively, for LW5) magical.

I will eventually propose a similar change to DruidNoWeaponDrop, except that I'm not 100% sure (and we haven't really hashed it out I think) how we should go about dealing with certain skills (namely Ghost) having to run first, and I don't know if I want to use what will have to be two separate loops in the search for the SG or AR (because for Denial 2, it could be an either/or thing rather than "both" like it is in DruidLoaded). Rather than the loops, I know the SwitchWeapon thing works there too ... just something about that call bugs me - like there's more uncertainty in it than a scan of the inventory.

I use the Futurama Prof. Farnsworth Skin: http://www.disastrousconsequences.com/dcforum/posts/list/1595.page
WM: (DC)BotFodder 170
MM: (DC)BotDoctor 141
AM: (DC)BotBooster 147
http://ericdives.com/ - My DC Newbie FAQ: http://tinyurl.com/lz229
Twitter: http://twitter.com/ericdives
[WWW] aim icon [MSN]
Szlat

Wicked Sick!

Joined: 05/18/2005 18:32:41
Messages: 2124
Location: UK
Offline

Looks fine to me.

I like the way it should also make those two weapons configurable in the RPG.ini file, if someone wants to put in a different shield gun or assault rifle weapon.

BotFodder

Wicked Sick!
[Avatar]

Joined: 01/13/2006 15:23:41
Messages: 1239
Location: Florida
Offline

Szlat wrote:
I like the way it should also make those two weapons configurable in the RPG.ini file, if someone wants to put in a different shield gun or assault rifle weapon. 

Yeah - when you think about it, what it can almost guarantee is that if you don't want the SG and AR at all for LoadedWeapons players on your server, then you just set up the INI not to have them. The only kicker is that if they want to use a custom SG or AR, they have to have "Shield Gun" or "Assault Rifle" in the item name somewhere, or the check in the inventory won't work. We could go back to the "SwitchWeapon" option, but I've explained my problem with it.

Anyone adventurous enough to go about replacing the SG or AR with something completely different should be able to adjust the code accordingly anyway.

I use the Futurama Prof. Farnsworth Skin: http://www.disastrousconsequences.com/dcforum/posts/list/1595.page
WM: (DC)BotFodder 170
MM: (DC)BotDoctor 141
AM: (DC)BotBooster 147
http://ericdives.com/ - My DC Newbie FAQ: http://tinyurl.com/lz229
Twitter: http://twitter.com/ericdives
[WWW] aim icon [MSN]
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

If you've tested it in a network game, the change looks fine to me.

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
BotFodder

Wicked Sick!
[Avatar]

Joined: 01/13/2006 15:23:41
Messages: 1239
Location: Florida
Offline

Yup - got a linux box at work I have the server only version (patched no less) running on that I scp my "working" mod (which is basically the CVS version with my "current project changes" - calling it BotRPG000 so that I don't have issues with DC on the client side). I fire up the server, connect directly, make sure everything runs right, and shut it down when I need to change something or am done testing.

EDIT: Committed.

I use the Futurama Prof. Farnsworth Skin: http://www.disastrousconsequences.com/dcforum/posts/list/1595.page
WM: (DC)BotFodder 170
MM: (DC)BotDoctor 141
AM: (DC)BotBooster 147
http://ericdives.com/ - My DC Newbie FAQ: http://tinyurl.com/lz229
Twitter: http://twitter.com/ericdives
[WWW] aim icon [MSN]
 
Forum Index -> Druids RPG Development
Go to: