Home » MODDING HQ 1.13 » v1.13 Feature Requests » Random item for enemy
Random item for enemy[message #327873] Sun, 10 November 2013 20:16 Go to next message
cnagorneac is currently offline 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 #327874] Sun, 10 November 2013 20:27 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
Gee, if only someone had made a random item feature already :secret:

Report message to a moderator

Captain

Re: Random item for enemy[message #327875] Sun, 10 November 2013 21:03 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:190
Registered:April 2012
DepressivesBrot
Gee, if only someone had made a random item feature already :secret:

But Strohmann did it already. At least in some extent. He made random loot maps for Arulko revisited mod and I saw in his files a lot of random items. I mean they are even called "random shotgun, random large pistol".

Report message to a moderator

Staff Sergeant
Re: Random item for enemy[message #327880] Sun, 10 November 2013 21:52 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
Sarcasm carries badly over written text.
http://www.bears-pit.com/board/ubbthreads.php/topics/310581/Advanced_randomization_for_ite.html

Report message to a moderator

Captain

Re: Random item for enemy[message #327937] Mon, 11 November 2013 14:05 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:190
Registered:April 2012
DepressivesBrot
Sarcasm carries badly over written text.
http://www.bears-pit.com/board/ubbthreads.php/topics/310581/Advanced_randomization_for_ite.html

Hm... I can translate every word but do not understand the meaning of what you wrote =)
Regarding the link, thanks for it, but I couldn't understood what is the situation at the moment. Looks like this has already been implemented, but wil473 tried it for enemy and it is not working?
Most probably the reason is my english skills, but maybe I am just to tired, so I hope any 1 will explain me the situation in "easy words".
Thanks in advance.

Report message to a moderator

Staff Sergeant
Re: Random item for enemy[message #327954] Mon, 11 November 2013 20:54 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
The feature is implemented and works. What is currently needed are two things:
  • modders come up with a definite scheme to fill 1k base random items that shall be the only items placed on any map. These 1k items have to consider every possible item placed on any map, not just guns. These items have to be items 3k-4k in every Items.xml.
  • Someone has to replace existing items inexiting maps according to this scheme. So for example, any pre-placed canteen in any map has to be replaced with the 'random item: canteen' placeholder.
This feature does what it is supposed to do: it replaces a random item with another item randomly drawn from a selection built via RandomItem.xml. This is intended for use on maps.

Wether people try to also use it for different purposes and fail with that is of no particular interest to me.

Report message to a moderator

Captain

Re: Random item for enemy[message #327957] Mon, 11 November 2013 21:06 Go to previous messageGo to next message
Sam Hotte

 
Messages:1966
Registered:March 2009
Location: Middle of Germany
If i got it right, request is to invent this very same scheme of feature for' enemy gun choice' as well.

Report message to a moderator

Sergeant Major
Re: Random item for enemy[message #327959] Mon, 11 November 2013 21:16 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
Ah. Well, that works.

Report message to a moderator

Captain

Re: Random item for enemy[message #327972] Mon, 11 November 2013 23:43 Go to previous messageGo to next message
Kriplo is currently offline Kriplo

 
Messages:256
Registered:February 2008
Location: Zagreb - Croatia
Actually people are right. Something seems wrong with this feature, maybe once was working but not anymore.

Items 1623 and 1624 should be random but had misc class in items.xml.
Anyway even change them to random class and they appear on editor, put both of them on the map and one of soldiers, but in both case after map is loaded for first time in game, all of them remains random item without replacement with proper real item as should be according to randomitems.xml :whoknows:

Report message to a moderator

Master Sergeant
Re: Random item for enemy[message #327974] Mon, 11 November 2013 23:51 Go to previous messageGo to next message
Strohmann is currently offline Strohmann

 
Messages:287
Registered:August 2011
Location: Division Thought Crimes
Could it be, that they don't spawn properly because the random item list they link to doesn't have guns with coolness 1 in them and you tested at progress 0%?

Report message to a moderator

Master Sergeant
Re: Random item for enemy[message #327975] Mon, 11 November 2013 23:51 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
It 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.

Report message to a moderator

Captain

Re: Random item for enemy[message #327976] Mon, 11 November 2013 23:58 Go to previous messageGo to next message
Kriplo is currently offline Kriplo

 
Messages:256
Registered:February 2008
Location: Zagreb - Croatia
Yes, I just start the game from A9 where items are too, and always use fresh unaltered files from game branch.
But if such restriction is put that will be better to not appear at all until you reach progress level.

Report message to a moderator

Master Sergeant
Re: Random item for enemy[message #328017] Tue, 12 November 2013 14:39 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:190
Registered:April 2012
Flugente
It 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 #328035] Tue, 12 November 2013 20:38 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
It cannot have more than 10 items. But as you can easily link to other random items that each can have 10 items and link to other random items again... you can draw from a massive selection that way (I think I limited the list from which you draw to 1k or sth like that).

Report message to a moderator

Captain

Re: Random item for enemy[message #328050] Tue, 12 November 2013 22:48 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:190
Registered:April 2012
I thought so. A bit inconvenient, but it is OK anyway.

Report message to a moderator

Staff Sergeant
Re: Random item for enemy[message #328058] Wed, 13 November 2013 00:53 Go to previous messageGo to next message
Strohmann is currently offline Strohmann

 
Messages:287
Registered:August 2011
Location: Division Thought Crimes
I thought a random item can't link to another random item, meaning a limit of 200 (10x10 genuine item + 10x10 random item), translating into 10000 items per ENEMYITEMCHOICES group.

Or was that changed without notification?

Report message to a moderator

Master Sergeant
Re: Random item for enemy[message #328059] Wed, 13 November 2013 00:58 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany

		0
		blank
		0
		0
		0
		0
		0
		0
		0
		0
		0
		0
		0
		0
		0
		0
		0
		0
		0
		0
		0
		0
	
You can enter a random item at , which can itself link to other random items. Nothing changed there.

Report message to a moderator

Captain

Re: Random item for enemy[message #328075] Wed, 13 November 2013 09:47 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:190
Registered:April 2012
In 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?

Report message to a moderator

Staff Sergeant
Re: Random item for enemy[message #328081] Wed, 13 November 2013 14:44 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:190
Registered:April 2012
Flugente
You 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 #328126] Thu, 14 November 2013 08:28 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:190
Registered:April 2012
any 1?

Report message to a moderator

Staff Sergeant
Re: Random item for enemy[message #328132] Thu, 14 November 2013 11:20 Go to previous messageGo to next message
pheloncab is currently offline pheloncab

 
Messages:278
Registered:August 2004
Location: So. Cal. or texas
Thats the usual way code works. It would ladder, first running the chance based on the level 1 random, if a random was nested as one or more of those choices it would then run that level 2 random.

This allows something like

1 random 357
2 random 9mm
3 glock 17
4 glock 17


random 357
revolver 357 snub
revolver 357 long
357 sig

random 9mm
glock 17
glock 19
berreta 93
sig 22x


first roll 50% chance on glock 17, 25% random 357 or 9mm. then if it hits a random it runs a second roll for nested result.

Report message to a moderator

Master Sergeant
Re: Random item for enemy[message #328137] Thu, 14 November 2013 11:49 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:190
Registered:April 2012
As I wrote, this is also my assumption, but would be nice to know exactly.

Report message to a moderator

Staff Sergeant
Re: Random item for enemy[message #328410] Thu, 21 November 2013 12:20 Go to previous messageGo to next message
Parkan is currently offline Parkan

 
Messages:439
Registered:April 2010
Location: Russia,Sevastopol

Is it possible to implement to game a function which will delete all incorect items on map on first loading?Example:Launched game with AFS and WF maps.On map there is will be a lot of Nada on them,to correct this on first loading map those items will be delete by game,so if there was an item NADA-it is gone for good.Made such thing optional(like in ja2_option.ini)

Report message to a moderator

Master Sergeant
Re: Random item for enemy[message #328411] Thu, 21 November 2013 13:32 Go to previous message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
cnagorneac
n 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.
cnagorneac
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?
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

Captain

Previous Topic: Hotkeys externalization
Next Topic: Wearable exoskeleton - Boost to carry capacity, nerf to APs
Goto Forum:
  


Current Time: Fri Apr 19 22:32:19 GMT+3 2024

Total time taken to generate the page: 0.01580 seconds