Aller au contenu

Photo

Generating Random Treasure


  • Veuillez vous connecter pour répondre
25 réponses à ce sujet

#1
Groove Widdit

Groove Widdit
  • Members
  • 378 messages
I'm trying to generate a new set of random treasure and-or items from a placable every time the pc enters the area - i figured out how to rand gen a new set of schmucks from an encounter every time, but i can't find anything in the manuals or lexicon about treasure.

#2
CID-78

CID-78
  • Members
  • 1 124 messages
treasure is just another word for shiny loot. all you need is a onexit script that clear the player flag, and a loot generating onused script that set the flag.

the major pita with loot system is to make the item list/ or setup the creation process for generating items on the fly. Premade items gives the best result if you have the time and energy to make enough of it. random item has a tendensy to not make much sense.

#3
Melkior_King

Melkior_King
  • Members
  • 135 messages
There are almost as many methods for making loot appear as there are scripters. :-)

Some people use a box in an inacessable spot filled with the loot which they want to appear somewhere, then a script copies some or all of the items to the creature (or to the creature's treasure chest) when the creature dies.

The standard Bioware system creates the loot on the creature as part of the OnSpawn event. This can be dangerous for balancing since some creatures may have the proficiency to equip and use the items you gave them (but never intended them to use).

The method I prefer is to run a script on death which uses a table of items and selects an item at random from the table. You can call the script multiple times for more than one item. You can make more than one script to handle different monsters and different loot.

If you're talking about loot appearing in containers, I prefer to use a script as above linked to the OnOpen event for the container, to create the loot.

If it's a single-player game, the OnOpen script needs to set a variable to prevent more loot from being created and check the variable before creating loot.

If it's a multi-player game, the script needs to set up a delayed command which will delete the variable after an amount of time has elapsed so that following players can get loot.

Modifié par Melkior_King, 21 juillet 2011 - 01:31 .


#4
Groove Widdit

Groove Widdit
  • Members
  • 378 messages
I have an encounter in a house with a container - it's a generic for any of the houses in the town - for low level characters to get experience - the creatures are a random spawn every time the area is entered - onopen sounds right but I don't know how do it.

#5
ffbj

ffbj
  • Members
  • 593 messages
Just drop in one of the pre-made scripts like: nw_o2_classhig or any of the other ones.
One method is to make a bunch of chests, useable, with inventories, and then put a different treasure generation script in their on open.  Then you can just randomly spawn, or place the chests.  Personally I have a treasure map system that leads to buried treasure, which adds a bit of spice.

#6
Groove Widdit

Groove Widdit
  • Members
  • 378 messages
Thanks man - it works - I want the chest to keep spawning treasure so i'll do it on the heartbeat as well - i hope this doesn't cause problems with the que.

#7
CID-78

CID-78
  • Members
  • 1 124 messages
don't. you module will get wrecked. infinite treasure in multiple chest will not only lag your module it will wreck the whole money system. it's better to keep using the onopen but without safety check. but that is bad design. you should earn your loot. and infinity of anything is bad design imo.

if you clean out a house and then go back in and it's full of monsters again. that would be like playing a game from the 80's on NES. it wouldn't live up to todays standards. it could still be fun but not because of this.

#8
Groove Widdit

Groove Widdit
  • Members
  • 378 messages
That's what I want - I want door-kicking experience for low-level characters - like Bard's Tale (Commodore 64) - there is an if=then in the script--I don't really understand it, but it looks like it is checking to see if the container is empty.

#9
CID-78

CID-78
  • Members
  • 1 124 messages
well in that case you should reset it each time the player enter the room, not have the chest spawn treasure without atleast a room worth of fight come inbetween the player and the chest.otherwise the player will just stand near the chest open it take the loot, close it and then open it again and get more loot. (exploit warning) then the player drack it all back to the shop and sell it. Which mean that you either can't have good gear in the shops or you can simply give it to them directly.

the onheartbeat would cause the chest to filling up to its limit even when the player isn't there. That's the major don't. Independent on your module game style you should never use a heartbeat for this kind of tasks..

#10
ffbj

ffbj
  • Members
  • 593 messages
Yeah CID-78 is right. I was going to mention that, but considered you would discover for yourself, or already knew not to do it that way. What I do is set an int on the chest when it has been opened and if that int is set like looted 1. Then you return, do not fire the loot script. Then you can set a random delay to reload the chest or use the onenter or some other method to reload the chest. Though if the players realise that by simply leaving the room they can reload the chest by entering the room again, you might have trouble there too. That's why I use a random delay of say between 200 and 400 seconds, though there are other methods. Like there is more than one way to skin a cat.

#11
Groove Widdit

Groove Widdit
  • Members
  • 378 messages
The chest doesn't really matter - my goal is to give treasure for killin monsters.

#12
SHOVA

SHOVA
  • Members
  • 522 messages
Use the treasure spawn systme that SoU, and HotU have. it works for containers, and for creatures. look under (standard, placeables), treasure, for the area, and mod containers, the how to set up, is in the comments of the properties. good luck!

#13
Groove Widdit

Groove Widdit
  • Members
  • 378 messages
I dont' have those. Lame. I know

How do you do it onenter?

#14
CID-78

CID-78
  • Members
  • 1 124 messages
if your goal is getting treasure for killing enemies you should have the loot on the enemy. that way there is no risk for exploit. you need to kill it to get the loot. otherwise you can allways dodge the enemies and get the treasure.

#15
ffbj

ffbj
  • Members
  • 593 messages
A bit of a messy way to do what you want would be to increment a local int on each PC that killed a monster and then add those together and put them on the party leader. Then if the local int was high enough say they have to kill five enemies and that local matches the required int on the chest, in this case 5 then the chest would spawn treasure. Doable but a bit messy.
So on the monsters on death the process would be to get the last killer and then increment the local on the leader, skipping the step of incrmenting on the actual killer, unless they are the party leader. A bit complicated but it could be done. Then after the chest was looted the local on the party leader, the only one who should open the chest, would be deleted. The party would want their rogue to be the party leader with this approach, for if the the chest were opened by another nothing would happen. Of course the rogue could simply unlock and detrap the chest but the party leader would have to open it. Also you might want to make the party aware of this approach by use of a seer or some other npc who tells them how to get at the treasure.

#16
CID-78

CID-78
  • Members
  • 1 124 messages
you can also expand ffbj idea. everyt time you kill a monster a "value" is added to the player. (this value represent the loot value of the monster in question). when the player opens a "loot" chest it grabs the variable and generate loot worth that amount. So if the player open chest all the time he get low value stuff such as health potions, while if he can stay away from it he get more expensive stuff.

#17
ffbj

ffbj
  • Members
  • 593 messages
Cool. Yes you could have 3 values for the int for instance 5 or less between 5 and 10 and greater than 10 and then execute a different treasure script on the chest for each different value.
Low, medium, high for example.

#18
CID-78

CID-78
  • Members
  • 1 124 messages
nah you make it dynamic and you got a sorted list of loot in price order and you pick one item at random up to the maximum amount. substract the sum and do it again. the higher value the more option is open in the loot list. you can even add a create item on the fly code that adds item properties according to the value. but in that case you will endup with loot similar to titanquest and other hack and slash games,

#19
Groove Widdit

Groove Widdit
  • Members
  • 378 messages
How do you have loot on the enemy for the player to get when he kills it?

#20
CID-78

CID-78
  • Members
  • 1 124 messages
put it in the enemies inventory either manually or by script and allow it to be dropable.

#21
Groove Widdit

Groove Widdit
  • Members
  • 378 messages
The enemy is creatures randomly generated in an encounter - which script do i use?

#22
CID-78

CID-78
  • Members
  • 1 124 messages
well the enemies in the encounter has blueprints and you can edit those to have treasure, but it wouldn't be random. other then that you either edit the ondeath or onspawn script to generate the treasure, depending on if you want the monster to beable to use the treasure in the fight.

#23
Groove Widdit

Groove Widdit
  • Members
  • 378 messages
How do I bring up their blueprints?
I'm looking at the scripts on the encounter screen and I don't see ondeath or onspawn.
Either way would probably work.

#24
CID-78

CID-78
  • Members
  • 1 124 messages
the creatures blueprints is under creature in the palette. it's the same list as you pick from when you make the encounter.

#25
ffbj

ffbj
  • Members
  • 593 messages
I do a little of both. The onspawn method I use is to loop through what the npc has, usually I only use this on npc's that have a few items maybe 3 or 4. All the items are marked undroppable. Then in onspawn I run through those items and give a percent chance maybe 25% that any one item is marked droppable. So you can get none, or more usually 1 or 2 itmes from an npc.

The ondeath I use give a % chance either the left hand, right hand, or chest slot drops. The percent chance is varied by the difference in levels between the killer and the killed. Reducing the chance that higher level players can kill twits, low level creatures, for their loot. So once you are 10 levels higher than your enemy the drop zippo, for you. Anyway that's one thing I do.