![]() |
|
|
#1 |
|
im working on a Armor Shard, and it should be able to pickup more than one at a time... heres my code, i cant figure out where it checks if the item is already present... (just using the armor2 code)
PHP Code:
__________________
Theory is when you know everything and nothing works. Practice is when things work, and no one knows why. Here we combine theory and practice. Nothing works and no one knows why. |
|
|
|
|
|
|
#2 |
|
Registered User
Join Date: Oct. 7th, 2001
Posts: 69
|
Well I dont have much to do at the moment so i think i might as well be of some use. The function that is called when you pickup an item to check to see if you have it and could pick another up or not is HandlePickupQuery(....).
Here is basicly what HandlePickupQuery should be to pickup multiply copies, (note this should work) function bool HandlePickupQuery( inventory Item ) { local inventory S; if ( item.class == class ) { S = Pawn(Owner).FindInventoryType(class'UT_Shieldbelt'); //This the section that should be modified to take advantage of multiply copies if ( S==None ) { //if the item has less then 150 charge add the new items charge to the old charge if ( Charge < 150) Charge += Item.Charge; // this limits the charge so the player can't have over 150 armor if (Charge > 150) Charge = 150; } else { //If the player has a shieldbelt, give the charge to it instead since it was the item with the greatest armor compacity in ut Charge = Clamp(S.Default.Charge - S.Charge, Charge, Item.Charge ); } if (Level.Game.LocalLog != None) Level.Game.LocalLog.LogPickup(Item, Pawn(Owner)); if (Level.Game.WorldLog != None) Level.Game.WorldLog.LogPickup(Item, Pawn(Owner)); if ( PickupMessageClass == None ) Pawn(Owner).ClientMessage(PickupMessage, 'Pickup'); else Pawn(Owner).ReceiveLocalizedMessage( PickupMessageClass, 0, None, None, Self.Class ); Item.PlaySound (PickupSound,,2.0); Item.SetReSpawn(); return true; } if ( Inventory == None ) return false; return Inventory.HandlePickupQuery(Item); } You may want to consider have ArmorAbsorption=100, to test the armor with. Since 5 absorbs very little damage, to see if it is working right, even with that i recommend at least around 50 for this particular type of item in the long run, else the item will be of little use even if you had 150 Armor. |
|
|
|
|
|
#3 |
|
considering the charge is 5, seems like 10 is < 150...
__________________
Theory is when you know everything and nothing works. Practice is when things work, and no one knows why. Here we combine theory and practice. Nothing works and no one knows why. |
|
|
|
|
|
|
#4 |
|
You should keep in mind that Armor2 and ThighPads store their charge independently (max: Armor2 = 100, ThighPads = 50), so now there is a maximum of 300 points if you use all three kind of armor.
|
|
|
|
|
|
|
#5 |
|
hears a good tip
do u have chaos Ut?, why dont u look in the code for info
__________________
Yesterday is history, Tommorow is a mistory, the now is a gift thats why its the present http://members.lycos.co.uk/project_ut436/ |
|
|
|
|
|
|
#6 |
|
my only comment is that the dirty wrotten shieldbelt will remove all the armor no matter what.... dirty wrotten shieldbelt....
|
|
|
|
|
|
|
#7 |
|
.....
*waits for a helpful comment*
__________________
Theory is when you know everything and nothing works. Practice is when things work, and no one knows why. Here we combine theory and practice. Nothing works and no one knows why. |
|
|
|
|
|
|
#8 |
|
base it on the healthvial code instead, but switch it from upgrading you health to upgrading you armor...
|
|
|
|
|
|
|
#9 |
|
that code uses a HealingAmount=5 property, which i dont know the armor equiv.
is there a if P.Armor property i dont know about?
__________________
Theory is when you know everything and nothing works. Practice is when things work, and no one knows why. Here we combine theory and practice. Nothing works and no one knows why. |
|
|
|
|
|
|
#10 |
|
Coder
Join Date: Oct. 22nd, 2000
Location: You really don't want to know... trust me...
Posts: 176
|
Nope. This has nothing to do with the health vial. The health vial just adds a little to your health. You could, of course, make yours an "armor repairing" shard that will check if you have, say, body armor in your inventory (Armor2) and adds 5 to that, but if you want this to be a true armor shard, Magus's code should work.
Eater. |
|
|
|
|
|
#11 |
|
hmm. whoops! i didnt realise he posted new code, i thought he was documenting the code i posted, heh. shoudent have been foruming soo late...
__________________
Theory is when you know everything and nothing works. Practice is when things work, and no one knows why. Here we combine theory and practice. Nothing works and no one knows why. |
|
|
|
|
|
|
#12 |
|
ok, using magus's code, it now picks up more armor, but the armor isnt used. it never goes down till i die, no matter how much damage i take.
__________________
Theory is when you know everything and nothing works. Practice is when things work, and no one knows why. Here we combine theory and practice. Nothing works and no one knows why. |
|
|
|
|
|
|
#13 |
|
fixed. thanks guys.
__________________
Theory is when you know everything and nothing works. Practice is when things work, and no one knows why. Here we combine theory and practice. Nothing works and no one knows why. |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|