How to prevent an Inventory to disappear when crushed?

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
User avatar
PrinceOfFunky
Godlike
Posts: 1040
Joined: Mon Aug 31, 2015 10:31 pm

How to prevent an Inventory to disappear when crushed?

Post by PrinceOfFunky » Wed Oct 10, 2018 5:35 pm

I just noticed weapon pickups disappear when a mover crushes them, how can I prevent this from happening?
Image

User avatar
Barbie
Godlike
Posts: 1699
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: How to prevent an Inventory to disappear when crushed?

Post by Barbie » Wed Oct 10, 2018 6:17 pm

PrinceOfFunky wrote:I just noticed weapon pickups disappear when a mover crushes them, how can I prevent this from happening?
See code of mover (I guess that Inventory's owner is None):

Code: Select all

// Return true to abort, false to continue.
function bool EncroachingOn( actor Other ) {
...
	if ( Other.IsA('Fragment') || (Other.IsA('Inventory') && (Other.Owner == None)) )
	{
		Other.Destroy();
		return false;
	}
...
Use a custom mover; maybe you can manipulate existing code by XC_Engine.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

User avatar
EvilGrins
Godlike
Posts: 6252
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: How to prevent an Inventory to disappear when crushed?

Post by EvilGrins » Fri Oct 12, 2018 12:05 am

Before you get crushed, throw all your weapons away!
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:

Higor
Godlike
Posts: 1765
Joined: Sun Mar 04, 2012 6:47 pm

Re: How to prevent an Inventory to disappear when crushed?

Post by Higor » Fri Oct 12, 2018 6:49 am

Tossed weapons should have bCollideWorld set to false.
The right question is: how you'll set that var at the right time?
ImageImage
Image unreal://23.111.157.138:7777
Image unreal://46.228.199.205:7788

User avatar
PrinceOfFunky
Godlike
Posts: 1040
Joined: Mon Aug 31, 2015 10:31 pm

Re: How to prevent an Inventory to disappear when crushed?

Post by PrinceOfFunky » Fri Oct 12, 2018 3:45 pm

Higor wrote:Tossed weapons should have bCollideWorld set to false.
The right question is: how you'll set that var at the right time?
I'm not talking about Weapons only, and not only about tossed weapons, a Mover is an Actor, so the problem is bCollideActor, which is needed if you want a pawn to pick that inventory up.
Image

Post Reply