Jump to content


Photo

splitting loot/looting rights


  • Please log in to reply
2 replies to this topic

#1 Piwaket

Piwaket

    GMC Member

  • New Member
  • 49 posts
  • Version:GM8

Posted 06 May 2012 - 03:02 AM

im thinking about how to go about keeping track of who did how much dammage to a monster so i can split loot accordingly, all i really have worked out so far is when a monster dies it creates a random gold ammount(x-x) and possibly an item or two ...and then passes those variables to a "corpse" object.

i want it something like, if you did more than 1/10 of the monsters total life in dammage, you get looting rights, if more than one person gets looting rights split loot between those people.

i havent gotten as far as making any items in game yet so just gold split would matter right now, im just trying to figure out the logistics of it at all (even though its only one-player right now split still matters because there will be "good" npc's that fight "evil" and i dont want the main character to just be able to walk around and loot any corpse whether they hit it or not, and i want to translate it to online multiplayer eventually anyway.)

i have my game set up so that any damage done has an id attached to it of the character that did the damage, so whenever a hit is scored i could have the monster inherit those variables, and then uppon death pass them to the "corpse" object, but how would i pass id and relative dammage variables of everything hitting a monster without them overwriting eachother?

i was thinking about having the monster bounce its own id and the dammage done to it back to the character doing the dammage but then if that character hits something else it would overwrite those variables..... ug... braintwister.

Edit: sry, almost forgot... gm8.1 lite user ...mostly a drag and drop user but im picking up on the code thing a little at a time.

Edited by Piwaket, 06 May 2012 - 07:52 AM.

  • 0

#2 fenyxofshadows

fenyxofshadows

    coobie

  • GMC Member
  • 443 posts
  • Version:GM:Studio

Posted 06 May 2012 - 03:53 AM

I would use a split loot system.

A monster, when killed, will have a chance to drop a bag of lower-level loot. Anyone can come steal this loot. If it's a powerful enemy, it will also, for each player that dealt at least 10% of its HP in damage to it, have a chance to drop a bag of somewhat better loot that only that player can see. This way, there isn't any fighting over the actually good loot

To the victor go the spoils. Not to some punk who got there and just took it.

How you would do this... Probably have an ID associated with every unique player, that ID being translated to that players attacks. The enemy who takes the damage will have a variable dedicated to that player (no idea how to do that) which stores the amount of damage dealt by that player. If it is equal or greater than 10% of the HP, then it may trigger the personal drop at death. If not, it won't. I know this means that some monsters would drop up to 10 different sets of loot, only up to 2 of which is visible to each player, but if it works it works...

Edited by fenyxofshadows, 06 May 2012 - 04:02 AM.

  • 0

#3 Piwaket

Piwaket

    GMC Member

  • New Member
  • 49 posts
  • Version:GM8

Posted 06 May 2012 - 04:33 AM

I would use a split loot system.

A monster, when killed, will have a chance to drop a bag of lower-level loot. Anyone can come steal this loot. If it's a powerful enemy, it will also, for each player that dealt at least 10% of its HP in damage to it, have a chance to drop a bag of somewhat better loot that only that player can see. This way, there isn't any fighting over the actually good loot

To the victor go the spoils. Not to some punk who got there and just took it.

How you would do this... Probably have an ID associated with every unique player, that ID being translated to that players attacks. The enemy who takes the damage will have a variable dedicated to that player (no idea how to do that) which stores the amount of damage dealt by that player. If it is equal or greater than 10% of the HP, then it may trigger the personal drop at death. If not, it won't. I know this means that some monsters would drop up to 10 different sets of loot, only up to 2 of which is visible to each player, but if it works it works...


well yeh..... thats pretty much what i just said, and thats my problem too, i dont know how to do it.... i do want just one drop for each player that did 10% or more dammage, but i want it to be to anyone that did 10% or more....so if the monster is healed this could potentially be many more than just 10 drops.....but i want it to split its total loot between all those players.... so if 20 people did 10% or more dammage they would all get 1/20 of the total loot

Edit: i figured out a way i could do it by setting a var_hitby on the monsters and uppon hit setting that variable to the source of the hit, as well as a var_damage, then setting a subroutine
if var_lootcheck_1 = 0 then {var_lootcheck_1=var_hitby var_damagetotal_1 += var_damage}
if var_lootcheck_1=var_hitby then {var_damagetotal_1 += var_damage end}
if var_lootcheck_2......etc.....
thats assuming "end" in that spot will stop the next var_lootcheck_ in line from checking.(im kinda new to the code thing as i said.) but the issue there is i would have to write out a variable for however many things are going to be hitting a monster ....which could be ALOT, and then i have to write code to check all those variables afterward.... so that solution isnt really practical for my needs....
i need something that will generate a variable name based on another variable, if such a function exists.

Edited by Piwaket, 06 May 2012 - 07:40 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users