Random item for enemy[message #327873]
|
Sun, 10 November 2013 20:16
|
|
cnagorneac |
|
Messages:190
Registered:April 2012 |
|
|
Hi.
Is it possible to create a feature that will give enemies random items of set category? For example, instead writing a lot of weapons into the EnemyGunChoice.xml, I would prefer to write instead "SMG of coolness 4" or "Pistol of coolness 5" And this "pistol of coolness 5" would contain all the items of Pistol type and coolness 5. So the enemy would take random item from those pistols.
It doesn't looks like a complicated feature to implement.
Also. I saw random items in "Stock data overhaul" so maybe this is one of the possible ways to do it, i just have no idea how it works.
Report message to a moderator
|
Staff Sergeant
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Random item for enemy[message #328017]
|
Tue, 12 November 2013 14:39
|
|
cnagorneac |
|
Messages:190
Registered:April 2012 |
|
|
FlugenteIt does. Unless you use xml values that don't allow to spawn any items, because the xml coolness modifier is to high and your progress is too low.
Just want to report.
I tried to use this feature for enemies.
I made a new random item that contained some coolness 1 and 2 weapons and that coolness is the same as progress level.
Made changes in enemygunchoices so enemy can have only this random item.
Finaly it worked as I planned enemies had only items of coolness 1. Enemies have those weapons I put in the random item.
So far everything is fine.
Edit:
Is it possible to enter more then 10 items into one of the random items?
I understand that Random item can have another random item in it, but can it have more then 10 ordinary items?
[Updated on: Tue, 12 November 2013 14:42] by Moderator Report message to a moderator
|
Staff Sergeant
|
|
|
|
|
|
|
|
Re: Random item for enemy[message #328081]
|
Wed, 13 November 2013 14:44
|
|
cnagorneac |
|
Messages:190
Registered:April 2012 |
|
|
FlugenteYou can enter a random item at , which can itself link to other random items. Nothing changed there.
One more question.
If i have:
XXXX containing 10 items
YYYY containing 100 items
zzzzz 1 item itself
zzzzz same 1 item itself
What are the chances of appearing of those items.
My assumption is that system first is choosing 1 of those 4 strings. So 25% for any of XXXX items, 25% for any of YYYY items and 50% for zzzzz item.
And then, after choosing XXXX items, it is choosing 1 item of those 10 items.
But it is also possible that appearing of zzzz item is not 50%, but random of all 10+100+2 items.
What is correct?
[Updated on: Wed, 13 November 2013 14:45] by Moderator Report message to a moderator
|
Staff Sergeant
|
|
|
|
|
|
|
Re: Random item for enemy[message #328411]
|
Thu, 21 November 2013 13:32
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
cnagorneacn stock 1.13 there are 2 random items:
1623 - random NATO AR 1 and
1624 - Random WP AR 1
Are they used anywhere in the game or it is safe to delete them? They aren't used ingame and exist purely for demonstration reasons, they can safely be deleted.
cnagorneacOne more question.
If i have:
XXXX containing 10 items
YYYY containing 100 items
zzzzz 1 item itself
zzzzz same 1 item itself
What are the chances of appearing of those items.
My assumption is that system first is choosing 1 of those 4 strings. So 25% for any of XXXX items, 25% for any of YYYY items and 50% for zzzzz item.
And then, after choosing XXXX items, it is choosing 1 item of those 10 items.
But it is also possible that appearing of zzzz item is not 50%, but random of all 10+100+2 items.
What is correct? When dissolving a random item, we build a list of all items referred on the random item and its random items (with recursion). We only add legal items (read: allowed by current coolness). To prevent cycles, a random item can be dissolved only once in the process. After that it is ignored, as otherwise cycles can occur very likely.
Up to 1000 (? not sure, have to check when I'm home) items are possible in the list we create. We then randomly draw one of them.
In your above example, zzzz has a 2/112 * 100 % chance of appearing.
Report message to a moderator
|
|
|
|