Author Topic: Easiest way for Random armor/weapons?  (Read 582 times)

Legacy_Zeidae

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« on: May 28, 2011, 10:01:22 pm »


               Greets.
I finally finished all of the areas in my mod a little while ago. Now I  need to fix the random monster armor script.

Currently the script randomly adds properties and then makes sure that the item is not too high of a level.
Unfortunately, this takes too long and the monster is more likely to stand there waiting for the armor to be produced than to fight.

So I  wish to scrap that setup.

But now I  am not certain of the best way to proceed.

I would like all monsters to have random item properties on their equipment so as to make every encounter unique. Some would be very easy and some could be downright challenging if an NPC  happened to get all of the good stuff.

There are many levels of skill. AC  1-20, damage 1-2d12. etc

I could sit here and produce 20 property lists based on estimated worth. IE AC +1 and AB +1 would be in one list and AC +20 and AB +20, and everything that correlates, could be in another list, with everything inbetween.

I  don't know that having 40+ property lists would be a very good thing. I'd need ranked lists for both armor and weapons.

The way I  am currently creating NPC's is to give them a certain number of blank armor pieces. So all of the low creatures would have just 1 piece of armor to add random properties to, and all of the top monsters would have 9. I would then need to get the appropriate level item property to be placed on each piece of equipment the monster has.
Not only that, but if possible, I would have the script run multiple times based on the PC's level. If a L40 comes walking through a L1 area, I would attempt to give the L1 creatures 8+ item properties instead of a standard 1. However, this is not critical.

I should be satisfied with having just 1 item property be placed on the equipment the NPC is wearing. I  can make creatures easier or tougher by either giving them more equipment or making them use an easier or tougher item property list.


Please do not make the suggestion of having pre-created armors and using those or some such standard idea. One of the primary goals of my mod from the start was a random factor. I  did not want to face the same exact kobold 100 times with the same exact gear and abilities, for once you can kill one, you can kill all. Yawn. Thank you, but "standard" is not what I  am seeking and that idea has already been suggested to me in the past, so I  wish to head it off now '<img'>


Basically, my question is, how can I get a L1 creature to add L1 type properties and L40 creature add L40 properties without creating 40+ lists. If I  have to create 40 lists, fine, but i'm sure there must be a better way.
Also, a L1 creature could conceivably be wearing items that are too high for it. Even adding Bright Light puts it past L1 if I  remember correctly. And there will be plenty of "useless" properties in the lists that make the item's level high, but keep the creature from being "high". So to the best of my knowledge, a value check would not be a good way to avoid 40 property lists.

Thanks!
               
               

               
            

Legacy_HipMaestro

  • Hero Member
  • *****
  • Posts: 2849
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #1 on: May 28, 2011, 11:01:24 pm »


               I am just wondering.

If you have found an effective way to seed random properties on equipment but it's sole drawback is that it is screwing up combat effectiveness, (i.e. pausing to complete all the calculations) could you build an inaccessible area to be used exclusively to house these custom spawns as one enters a trigger area, possibly at a location with enough lead time to allow the prop seeding to complete before entering the designed combat area, and then simply drop each NPC (or group of NPCs) in from the holding area to the combat zone as needed?

Just a scripting dunce making a stab in the dark and hoping for the best.
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #2 on: May 28, 2011, 11:16:03 pm »


               I like your random Idea, seems like it should work.  If we set aside level use, and gear, just start with creature skin thats one way to adjust and randomly add to creature.  Next we take armor wich aslong as creature not in combat I dont think its an issue. then finaly weapon.

Q1) are all items preequiped in creature toolset resref, if so seems it shold be easyier.

I will try a fewthings out and see what I come up with.  my plate is pretty full, but one can always have a little more '<img'>

EDIT ADD:  Your script may be great, perhaps change some of it to functions, If you wish to post it we could look it over to see if we can make it faster.  Or send me a pm with email and I can look it over once we connect.

upon closer reading of your post it looks like you almost had it just had a spawn standing you said...seems fixable
               
               

               


                     Modifié par Greyfort, 28 mai 2011 - 10:25 .
                     
                  


            

Legacy_Karvon

  • Sr. Member
  • ****
  • Posts: 430
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #3 on: May 29, 2011, 12:24:38 am »


               A script I've used in the past, might prove helpful as it can be used to equip creatures.

A4 Easy Building Series: Treasure Tables, Equipment and Stores

Karvon
               
               

               
            

Legacy_Zeidae

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #4 on: May 29, 2011, 12:40:41 am »


               

HipMaestro wrote...

I am just wondering.

If you have found an effective way to seed random properties on equipment but it's sole drawback is that it is screwing up combat effectiveness, (i.e. pausing to complete all the calculations) could you build an inaccessible area to be used exclusively to house these custom spawns as one enters a trigger area, possibly at a location with enough lead time to allow the prop seeding to complete before entering the designed combat area, and then simply drop each NPC (or group of NPCs) in from the holding area to the combat zone as needed?

Just a scripting dunce making a stab in the dark and hoping for the best.


My script also greatly lags the server. Just spawning the npc's in a different spot wouldn't solve that. Not to mention, i think it would be rather complex to spawn the creature to the correct area once they do have gear.

Thanks though.
It's the level check that makes it take so long. But i can't just get rid of it because i have every level of property in the current list. Obviously I don't want to add 20 AC  to mr 1 level rat '<img'>
               
               

               
            

Legacy_Zeidae

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #5 on: May 29, 2011, 12:46:07 am »


               

Greyfort wrote...

I like your random Idea, seems like it should work.  If we set aside level use, and gear, just start with creature skin thats one way to adjust and randomly add to creature.  Next we take armor wich aslong as creature not in combat I dont think its an issue. then finaly weapon.

Q1) are all items preequiped in creature toolset resref, if so seems it shold be easyier.

I will try a fewthings out and see what I come up with.  my plate is pretty full, but one can always have a little more '<img'>

EDIT ADD:  Your script may be great, perhaps change some of it to functions, If you wish to post it we could look it over to see if we can make it faster.  Or send me a pm with email and I can look it over once we connect.

upon closer reading of your post it looks like you almost had it just had a spawn standing you said...seems fixable


Creatures are all pre-equipped with blank armor. I  tried not having them wear it to start but that didn't work well. I had it that way so that I  would not have to do the level check. I would just randomly spawn X pieces of equipment onto the creature and if they could wear it, fine, if not, fine.

I will have to include the script later as I don't have the toolset open just now '<img'> It isn't terribly complex. It's just that it loops a TON so that the item properties don't make the armor go above the creature level. When you get a group of 6 monsters spawned at one time, there is noticable server lag. I can't imagine having multiple players spawning creatures all the time. The lag would be too much. Not to mention that I had to greatly chop down the properties list just to try and speed it up, but i would rather have every property be available.

And for the record, player loot is all nice and random as well! But that one works at least heh. It does make it interesting finding good gear, which was also part of the point.
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #6 on: May 29, 2011, 01:21:07 pm »


               It would be much simpler and easier to handle this with effects. This would essentially end your performance problems since no loops and reduce your personal hassle, with the 9 items and all...

(example)
Make you mob receive supernatural permanent AC increase on spawn equal to Level/4 + d10.
You would have your random factor and it would scale with the creatures level. (+11-20 at level 40)
               
               

               
            

Legacy_Zeidae

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #7 on: May 29, 2011, 04:53:55 pm »


               I will be using effects in addition to item properties to boost things like HP and AC. But from what I have seen, I cannot get anywhere near all of the item properties into effects. This isn't just about AC or AB. There are tons of other affects that can be added to items.
Can you add "on hit cast spell" with an effect?
Can you add "light dim yellow" with an effect?
Can you add "Tumble +30" with an effect?
Can you add Damage reduction with an effect?
etc

Ability bonus, AC, AC vs Align, AC vs Race, AC vs Dmg Type, Bonus feats, saving throws, saving throws vs dmg type, spell resistance, damage immunity, damage reduction, damage resistance, darkvision, freeaction, haste, misc immunity, immunity to spell level, improved evasion, light, on hit cast spell, regen, skill bonus, school immunity, spell immunity, true seeing, item weight reduction.        Those are the properties i'm adding to the armor. Then there's also the weapons.

Thanks '<img'>
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #8 on: May 29, 2011, 05:01:33 pm »


               You can use effects for all of those and more, except On Hit property, bonus feats (without nwnx) and weigth reduction. (which seems kinda pointless) Besides, who's to say you couldn't use a mix of item properties and effects. You are applying the item properties with a script anyway...

Generally you can do much more with effects then item properties, unless its some On Hit property. (Which by the way at least with 'cast spells' launches a script that applies effects to the enemy hit)
               
               

               
            

Legacy_Zeidae

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #9 on: May 29, 2011, 05:14:52 pm »


               i don't think your suggestion, though, has solved the problem I described.
It may be easy to do a graded AC scale, but what about the other properties? How can I get the AC bonus (if there is one) to sometimes be vs alignment or race and not universal?

How can I get weapon damage onto a weapon?

I am not a scripter. I use lilacs for most things. And the last time I fiddled with effects, I couldn't do nearly as much as I wanted via Lilacs. I remember trying to add hit points, but the best I could do was the temporary hit points spell which was too limiting.

I am a little torn in how to set up the monster scaling. On one side, I would love that L1 monster to not be a 1 hit easy kill for Mr L40 who is walking through. But on the other side, I find that always facing monsters of the same ability as yourself gets to be boring (aka Oblivion). So I am more leaning towards not having the monsters scaled based on level with perhaps exception to something like hit points, or simple things. Having Random abilities is my primary concern. Monsters already get random skill bonuses from another script I downloaded, but that isn't easily seen. A monster with an additional 2-4 con is likely to still be just as weak as his buddies.
               
               

               
            

Legacy_omen_shepperd

  • Sr. Member
  • ****
  • Posts: 347
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #10 on: May 29, 2011, 05:46:04 pm »


               I use Commche’s random loot system to generate random weapons and armors; it also generates random items as well. And commche has been very helpful in making adjustments when I needed the adjustments made and he responds fairly promptly to e-mails. Here is a link
http://nwvault.ign.c....Detail&id=3233 hope this helps.
               
               

               


                     Modifié par omen_shepperd, 29 mai 2011 - 04:48 .
                     
                  


            

Legacy_Zeidae

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #11 on: May 29, 2011, 06:13:06 pm »


               Would it generate random weapons and armors on NPC's for them to use in combat?
I can generate random loot. I just can't do what i'm trying to do lol not effectively anyway
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #12 on: May 29, 2011, 07:08:32 pm »


               Well since you are going with the item properties....
ItemPropertyACBonus
ItemPropertyACBonusVsAlign
ItemPropertyACBonusVsDmgType
ItemPropertyACBonusVsRace
ItemPropertyACBonusVsSAlign
Use these, look 'em up in the nwscript

Though if you dont know nwscript and dont want to spend time getting into it, commche's system is should do just fine.
               
               

               
            

Legacy_Zeidae

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #13 on: May 29, 2011, 07:23:16 pm »


               

Xardex wrote...

Well since you are going with the item properties....
ItemPropertyACBonus
ItemPropertyACBonusVsAlign
ItemPropertyACBonusVsDmgType
ItemPropertyACBonusVsRace
ItemPropertyACBonusVsSAlign
Use these, look 'em up in the nwscript

Though if you dont know nwscript and dont want to spend time getting into it, commche's system is should do just fine.


I  have the entire ItemProperty list. That is not my problem.
My problem is getting the right level ItemProperty on to the right level NPC! There are 20 levels of AC, AB and other properties. I  can get AC 1 or AC 20 onto any NPC. I can get onhit cast acid spash 1 or 40. What I  can't do is get AC 1 and onhitcast acidspash 1 on a L1 monster or AC 20 and onhitcast acidsplash 40 on a level 40 monster. Not without creating 40 lists! There are 2300 item properties! What I  want to know is how to get the low properties onto the low monters and the high ones onto the high monsters.

I think I am going to end up simply having to create 1 big massive list. Then i'll give low level monsters like 1 piece of armor and high level monsters 9 pieces, and then maybe have the script run through X times so that the L1 monster is only going to get 1 random item property on his 1 piece of equipment while a L40 monster could get 8 properties on 9 pieces of equipment (just an example not actual numbers =P). If a L1 NPC happens to get 20 AC, I  guess i'll have to live with that. It should not happen very often. 1% of the time perhaps. There are hundreds of item properties when you include all of the levels and variables. 1 random property on 1 piece of armor should hopefully not cause too much grief. I  would hate to run into the L1 monster with onhitcast L40 firebrand though lol. I am not opposed to keeping onhits relatively weak though.
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Easiest way for Random armor/weapons?
« Reply #14 on: May 29, 2011, 07:33:28 pm »


               Use GetHitDice to get the creatures level. You can derive other numbers from it as you wish.
Here is an simple example...

int iLvl = GetHitDice(oNPC);
   int iAC = iLvl/2;
   AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyACBonus(iAC), oItem);


This would add an item AC bonus property equal to half the NPC's level to oItem.
               
               

               


                     Modifié par Xardex, 29 mai 2011 - 06:34 .