Mutator "Gift From Decoration" for MonsterHunt

Search, find and discuss about Mutators!
Buggie
Godlike
Posts: 2776
Joined: Sat Mar 21, 2020 5:32 am

Re: Mutator "Gift From Decoration" for MonsterHunt

Post by Buggie »

I know about this "feature". Already investigate that. IIRC, it specific to your server and caused by fact spawn new copy of weapon on pickup or throw (not remember details) instead of direct usage it. For normal usage all goes ok.
But you spawn copy of weapon and destroy old.

It be long time ago, so I not remember details.   
Auto merged new post submitted 1 hour 2 minutes later
Ah. now I remember. It be part of code about death. On death you spawn copy of inventory, instead of drop exists weapons. Obviously this lead to destroy link to InventoryDestroyer. So weapon goes be permanent now.
Unfortunately there nothing what I can do with that.   
Auto merged new post submitted 6 minutes later
Look at bDropWeaponsOnDeath, DiscardInventory and DropWeapon. Last one spawn permanent copy.

I can suggest you few solutions.
1. Drop real weapon, not copy.
2. Drop copy only of real weapon, not for gifted.
3. Drop copy for all weapons, but for gifted search and replace link to it in InventoryDestroyer.
User avatar
Barbie
Godlike
Posts: 2831
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Mutator "Gift From Decoration" for MonsterHunt

Post by Barbie »

Ah, never touched that part of code. I suppose that function DropWeapon() was introduced because with the stock code only the current holding weapon is dropped. BTW that function can be found in some game controllers of MonsterHunt packages like in KHMBase.uc, MH2Base.uc, KHMBase.uc.

It's now fixed by dropping original weapon in my game controller.
"If Origin not in center it be not in center." --Buggie
User avatar
Barbie
Godlike
Posts: 2831
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Mutator "Gift From Decoration" for MonsterHunt

Post by Barbie »

Is it possible to
1) Make the hard coded check time of currently 0.1 sec configurable?
2) Make counter voice and number configurable?
3) Set spawned item's LifeSpan? With that I can easily show remaining time in HUD.
<EDIT>
Not to forget: 4) possibility of dropping any Actor, not only inventory
</EDIT>
Ofc I also could do the changes and send you the result.
"If Origin not in center it be not in center." --Buggie
Buggie
Godlike
Posts: 2776
Joined: Sat Mar 21, 2020 5:32 am

Re: Mutator "Gift From Decoration" for MonsterHunt

Post by Buggie »

v0.5
- Add more config options (see ini file)
- Set LifeSpan time (reset on last second, for avoid race condition)
- Now can be spawned any Actor class, not Inventory only. However, items, which not able be owned (pick up), will be eat server resources if LifeSpan for them more then 0.

Update in first post: viewtopic.php?t=14014
User avatar
Dr.Flay
Godlike
Posts: 3348
Joined: Thu Aug 04, 2011 9:26 pm
Personal rank: Chaos Evangelist
Location: Kernow, UK

Re: Mutator "Gift From Decoration" for MonsterHunt

Post by Dr.Flay »

Why reinvent the wheel ?
Dropper by MrLoathsome viewtopic.php?t=2885
Buggie
Godlike
Posts: 2776
Joined: Sat Mar 21, 2020 5:32 am

Re: Mutator "Gift From Decoration" for MonsterHunt

Post by Buggie »

First time hear about it. Also look like it not able do, what this mutator do.
User avatar
Barbie
Godlike
Posts: 2831
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Mutator "Gift From Decoration" for MonsterHunt

Post by Barbie »

Barbie wrote: Sat Jun 03, 2023 10:12 am Is it possible to
3) Set spawned item's LifeSpan? With that I can easily show remaining time in HUD.
Sadly LifeSpan is not replicated to clients and so always 0 for them. Does anyone have any idea how to determinate if an item is a life time limited?

One idea is to iterate over all InventoryDestroyers, but they are not visible for clients and furthermore it would be an expensive polling.

Another idea is to raise a configurable event when item is given to a player:

Code: Select all

InventoryDestroyer extends Triggers config(GiftFromDecoration);
...
state Wait {
Begin:
	Sleep(0.1);
	If (Target != None) {
		if (TournamentPlayer(Target.Owner) != None)
		{
			Foreach AllActors(class'Actor', A, OwnerChangedEvent)
				A.Trigger(Target, Target.Owner);
			...
In my HUD class I can spawn a custom Actor that receives these events and adds or removes Target to/from a list.
"If Origin not in center it be not in center." --Buggie
Buggie
Godlike
Posts: 2776
Joined: Sat Mar 21, 2020 5:32 am

Re: Mutator "Gift From Decoration" for MonsterHunt

Post by Buggie »

You need spawn own actor and replicate it to client. There you can replicate LifeSpan, or do other stuff.
This need make your package client-sided.
This mutator purely server-sided and can't do such stuff.
Eternity
Skilled
Posts: 176
Joined: Sat Nov 30, 2019 10:56 pm

Re: Mutator "Gift From Decoration" for MonsterHunt

Post by Eternity »

There is one odd way some mods use to replicate data through unused variables or through partially used variables...
A corresponding client-side script has to be aware of this, of course.

Though, being a kind of "hack" solution, such approach in general might be unacceptable in some cases...
The only proper way to do this - is through a dedicated actor for custom data replication.