Buried inventory

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Buried inventory

Post by Barbie »

papercoffee wrote:I had a buried Ripper in some maps. :noidea
I guess the reason is UnrealEd's algorithm how to place items - if a mapper adds an item in the perspective view, the item's pivot point is snapped into the grid. With the default grid of 16 UU some items stuck in the ground then (see pic).
BuriedInventory.jpg
(Also the collision cylinder should be adapted to the shape of item's visible mesh.)

I was annoyed by this also and added a function in my MapPatcher's auto state that sucks the inventory items out of the ground:

Code: Select all

function int FixGroundStuckStuff(ELogType LogLevel) {
const CFunctionNameFGS = "FixGroundStuckStuff";
local int result, i;
local Inventory Inv;
local vector Delta;
local bool bSuccess;

	foreach AllActors(Class'Inventory', Inv)
		if (Inv.AttachTag == '' && ! Inv.bHidden)
			if (StucksInGround(Inv.CollisionHeight, Inv.Location))
			{
				bSuccess = false;
				Logger(Log_Debug, CFunctionNameFGS, Inv @ "stucks in ground at" @ Inv.Location $ ", CollisionHeight=" $ Inv.CollisionHeight);
				delta.z = 0;
				while (delta.z < 2* Inv.CollisionHeight) // CollisionHeight is half the height of a Collision Cylinder
				{
					delta.z = delta.z + 1;
					if (StucksInGround(Inv.CollisionHeight, Inv.Location + Delta))
						Logger(Log_Debug, CFunctionNameFGS, Inv @ "still stucks in ground at" @ Inv.Location + Delta $ ", increasing z");
					else if ( ! SetLocationEx(Inv, Inv.Location + Delta))
					{
						break;
					}
					else
					{
						Logger(Log_Verbose, CFunctionNameFGS, "changed location for" @ Inv @ "from" @ Inv.Location - Delta @ "to" @ Inv.Location);
						result++;
						bSuccess = true;
						break;
					}
				}
				if ( ! bSuccess)
					Logger(Log_Verbose, CFunctionNameFGS, Inv @ "would even stuck in ground at" @ Inv.Location + Delta $ ", giving up");
			}
	return result;
}
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
SC]-[WARTZ_{HoF}
Adept
Posts: 426
Joined: Tue Feb 21, 2012 7:29 pm

Re: Buried inventory

Post by SC]-[WARTZ_{HoF} »

Thanks for a nice no edit approach to fixing this issue for newb made maps. Most experience mappers make sure pickup items never fall inside a maps geometry.
Image
Image
Image
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Buried inventory

Post by sektor2111 »

Ahah, finally you have noticed why I'm pulling upper inventories in my games(/even maps), good. Keep going...
You can also check "bandages", even "Eclip" and all crap making Bot to look dumb - and go figure in game occurrences. This is why I set similar collision for ALL pathed items... somewhere.
Probably I have to write a Items builder feature in MapGarbage before starting to add inventories in map preventing some borked placement.
Personally I don't like even how goes Miniammo as well. Why is so big and then a half goes buried ?

Edit: By looking at your code I see again that fantasy with AttachTag. Dear, an inventory doesn't attach anything - as for current case is pointless - Where is used this ? Movers are doing this attachment. Inventories set with a fake AttachTag will go ignored by your patcher...
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Buried inventory

Post by Barbie »

sektor2111 wrote:By looking at your code I see again that fantasy with AttachTag. Dear, an inventory doesn't attach anything
Because the property name "AttachTag" is used for different variables, this may lead to confusion - Attachmover introduces a new property but unfortunately with the the already existing name "AttachTag":

Code: Select all

class Actor extends Object
var(Movement) name AttachTag;

Code: Select all

class AttachMover extends Mover;
var() name AttachTag;
You can move an Actor in two ways:
  1. using a normal Mover and setting Actor.AttachTag == Mover.Tag.
  2. using an Attachmover and setting Attachmover.AttachTag == Actor.Tag
Because positioning may be critical with such Actors, my code does not alter the location, at least with Actors moved by method (1).
sektor2111 wrote:Where is used this ?
Map MH-GodzSaltified-5k for example.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Buried inventory

Post by JackGriffin »

Well, that's a first. I've never seen a Godz map used as a demonstration of anything other than how to shitmap :lol2:
So long, and thanks for all the fish
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Buried inventory

Post by sektor2111 »

Ahah, I think I can drop an inventory on a Mover without AttachTag myths...
I'm gonna check first because I know a map where inventory is pushed by a door opened based on Nothing tagged just because mover can affect actors like inventories when encroach them :lol2:

Else: some occurrence happened with ammo when I was trying to do that Chaos patcher and... I'll use default ammo nature for this task with no fake tags...

Edit:
Hmm, yes, some things are just not as supposed. Actor can love some Mover with a problem... if is changing physics in autostate I have doubts to stay with mover... I'm not sure that Inventory in mover is not even self destructing.
Edit2:
Okay, I got the plonker bummer for a small show. Today's candidate is BioAmmo.
One Ammo is On Top placed through Editor in upper spot far from Mover.
Second ammo is under Mover - not colliding because it will go away but having that awesome "AttachTag" corresponding to Mover.
[attachment=1]Editor_Occurrence.PNG[/attachment]

Good boy Edy Goblin so far.
And now let's see the game :lol2:
[attachment=0]Gaming_Occurrence.png[/attachment]
GotoState( :omfg: )
Upper Ammo has felt attaching itself to mover with no tags defined but because that's the new base after fall.
Lower Ammo (without colliding mover - is going vanished if collides) has simply felt on the ground in a deep sleep even if "AttachTag" is matching Mover's "Tag" as described.

To summarize, probably your code has to take in account rebel ammo with physics falling, if are located under mover they will have chances to never attach nowhere ( EPIC based ).
For a map like that I would not be worried, else AttachMover (other way) is not in account for your case as well...

This was a demonstration to myself that I might be wrong for a while - and... you too...

Edit3:
Part no. III - let me see the right replacements deal. Which method is the best ? With/Without delay ? Speaking about ammo replacements. Which ammo located where ? Some mappers might know these better and then - replaced ammo will never fell in a reachable location.
Keep asking...
Question: Can I do such a map just to show all borked mutators used and "ReplaceWith" garbage ?
Answer: No, some admins will hate you.
Attachments
Gaming_Occurrence.png
Editor_Occurrence.PNG
Post Reply