So, Deco don't spawn pawns.

Tutorials and discussions about Mapping - Introduce your own ones!
Red_Fist
Godlike
Posts: 2163
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

Oooo I forgot about the chest.

I need to look, but this can't have deco hurting other deco, as in explosions as such, throw another wrench into the thing.

But if it does spawn pawns I could check the settings for no explosions, or damage to other decos.
Not sure if this is a mutator or not, it's GOTTA be for mappers. F those serverdueds LoL


:thuup:
Binary Space Partitioning
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Post by sektor2111 »

Perhaps I understand what you mean. Player can even grab a decoration and dropping it from a building by example. That dude might be hoping to get a gun this way. In the lottery, he might get... a monster. So this will require a few tiny lines written in a sub-class of default breakable decoration - barrel included, if won't hurt the spawned creature. All to do is declaring there an actor as variable and adding some conditions if we have Inventory or if we have Pawns. You can even make a drop effect in a random direction using... default UT codes. When something doesn't work as I like, MyLevel is the friend, this is how I do - see those sort of "eggs" spawning Skaarj those are custom things as Diamonds from Sk_Godz which are more jumpy than default book and.. doesn't stupidly colliding player/monster/Bot reacting only at damage. More ideas can go right in Map, yes, mappers are welcomed to use MyLevel all time as long as this is the real mapping not only painting walls. There is a major advantage if you can write 2 lines which UT doesn't have - to not mention Navigation options which are just... so many... I repeat here what I said, by using only stock stuff is nothing too challenging, as long as stock is poor and your creativity will suffer here...
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: So, Deco don't spawn pawns.

Post by Barbie »

Red_Fist wrote:OK, do you mean make each deco class spit out the same pawn but only drop it at the "location" of that deco ?
You are coming close. :)
Each time the "ThingSpawner" is triggered, it spawns a thing at triggerer's location. That should meet your requirements.

A map says more than written words, so just have a look at attached example map. The code of Actor->KeyPoint->SBThingSpawner is as follows:
Spoiler

Code: Select all

class SBThingSpawner expands Keypoint;

var() class<Actor> ThingToSpawn;
var() name ThingTag;
var() name ThingEvent;
var() bool bSetEnemy;
var() bool bShowError;


event Trigger(Actor Other, Pawn EventInstigator) {
local Actor Spawnthing;

	if (Other != None && ThingToSpawn != None)
	{
		Spawnthing = Spawn(ThingToSpawn, , ThingTag, Other.Location, Other.Rotation);
		if (Spawnthing != None)
		{
			Spawnthing.Event = ThingEvent;
			if (ScriptedPawn(Spawnthing) != None && EventInstigator != None)
				ScriptedPawn(Spawnthing).SetEnemy(EventInstigator);

		}
		else if (bShowError)
			BroadcastMessage(self $ ".Trigger(): could not spawn" @ ThingToSpawn);
	}
}
Unfortunately Decoration.Destroyed() does not pass the EventInstigator, so that bSetEnemy is useless in this case.
Attachments
TestSBThingSpawnerV0.7z
(4.09 KiB) Downloaded 45 times
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Post by sektor2111 »

Barbie wrote:Unfortunately Decoration.Destroyed() does not pass the EventInstigator, so that bSetEnemy is useless in this case.
That's why a rewritten decoration will work as requested.
Red_Fist
Godlike
Posts: 2163
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

sektor2111 wrote:Perhaps I understand what you mean. Player can even grab a decoration and dropping it from a building by example. That dude might be hoping to get a gun this way. In the lottery, he might get... a monster. So this will require a few tiny lines written in a sub-class of default breakable decoration - barrel included, if won't hurt the spawned creature. All to do is declaring there an actor as variable and adding some conditions if we have Inventory or if we have Pawns. You can even make a drop effect in a random direction using... default UT codes. When something doesn't work as I like, MyLevel is the friend, this is how I do - see those sort of "eggs" spawning Skaarj those are custom things as Diamonds from Sk_Godz which are more jumpy than default book and.. doesn't stupidly colliding player/monster/Bot reacting only at damage. More ideas can go right in Map, yes, mappers are welcomed to use MyLevel all time as long as this is the real mapping not only painting walls. There is a major advantage if you can write 2 lines which UT doesn't have - to not mention Navigation options which are just... so many... I repeat here what I said, by using only stock stuff is nothing too challenging, as long as stock is poor and your creativity will suffer here...
All it needs is 100% stock deco, but be able to choose a pawn class in the "contents".

No explosion or damage from deco, but the same as the stock deco, they just break and gone, leave a pawn.
(There is the two exploding barrels but those would not fit the maps theme at all.)

I am amazed that either I forgot or never tried to use a pawn for contents after all these years, I always assumed it would just drop anything, even actors that should not be spawned.
Binary Space Partitioning
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Post by sektor2111 »

I'm not sure if ignoring classes doesn't head to dumb things. Once by mistake I've assigned a sound for some texture, you might not want to find what I saw and how much I was trying to figure whatta heck was wrong, game being stuck each time when I was looking in that direction. If variables are Inventories then they are not pawns, and pawns won't go to state "Pickup" "Dropped" ever because this is what is doing a 100% stock if you are not using factories or other factories, or other similar decos. Is very easy to reconfigure such things, for me was a harder task to remove geometry errors not scripting new stuff... and long as I was aiming "semi-solid" mapping with no one solid and this job is not that cute. For rebel stupid decorations with no net stuff I was working a few sessions in order to make them good for On-Line, doing multiple tests.
Red_Fist
Godlike
Posts: 2163
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

What I mean as ,stock, as-in no explosions or effects or added things, but yet still leave a pawn.
Binary Space Partitioning
User avatar
EvilGrins
Godlike
Posts: 9668
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: So, Deco don't spawn pawns.

Post by EvilGrins »

I did an edit, on my fave MH testing map, of deco monsters; mainly chose books of different colors for each creature factory...

...and, just to put it out there, running backwards with double pistols or minigun or rocket launcher is not very effective against a stampede of books!
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
Red_Fist
Godlike
Posts: 2163
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

HEY, I got it, it drops my new pawn but the only way to get it to attack is to touch it.

Shooting and seeing it just sets there with no animation, as soon as I touch it, it acts normally and attacks.

So there needs to be some added thing to re-put a spark up their arse once it drops.

HELP !!!

Code: Select all

//=============================================================================
// Decor3.
//=============================================================================
class Decor3 expands Decoration;

#exec AUDIO IMPORT FILE="sounds\general\bPush1.wav" NAME="ObjectPush" GROUP="General"
#exec AUDIO IMPORT FILE="sounds\general\EndPush.wav" NAME="Endpush" GROUP="General"

#exec MESH IMPORT MESH=BarrelM ANIVFILE=MODELS\Barrel_a.3D DATAFILE=MODELS\Barrel_d.3D ZEROTEX=1
#exec MESH LODPARAMS MESH=BarrelM STRENGTH=0.5 
#exec MESH ORIGIN MESH=BarrelM X=320 Y=160 Z=95 YAW=64
#exec MESH SEQUENCE MESH=BarrelM SEQ=All    STARTFRAME=0   NUMFRAMES=1
#exec MESH SEQUENCE MESH=BarrelM SEQ=Still  STARTFRAME=0   NUMFRAMES=1
#exec TEXTURE IMPORT NAME=JBarrel1 FILE=MODELS\Barrel.PCX GROUP=Skins FLAGS=2
#exec MESHMAP SCALE MESHMAP=BarrelM X=0.15 Y=0.15 Z=0.3
#exec MESHMAP SETTEXTURE MESHMAP=BarrelM NUM=0 TEXTURE=JBarrel1 TLOD=10


var() int Health;
var() class<ScriptedPawn> contents;
var() class<ScriptedPawn> content2;
var() class<ScriptedPawn> content3;

Auto State Animate
{
	function HitWall (vector HitNormal, actor Wall)
	{
		if (Velocity.Z<-200) TakeDamage(100,Pawn(Owner),HitNormal,HitNormal*10000,'shattered');	
		bBounce = False;
		Velocity = vect(0,0,0);
	}


	function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, 
						Vector momentum, name damageType)
	{
		Instigator = InstigatedBy;
		bBobbing = false;
		if (Health<0) Return;
		if ( Instigator != None )
			MakeNoise(1.0);
		Health -= NDamage;
		if (Health <0) 	
			Frag(class'WoodFragments',Momentum,1.75,12);		
		else 
		{
			SetPhysics(PHYS_Falling);
			bBounce = True;
			Momentum.Z = 1000;
			Velocity=Momentum*0.01;
		}
	}

function Destroyed()
{
	local actor spawned, P;
	local class<actor> tempClass;

	if( (Pawn(Base) != None) && (Pawn(Base).CarriedDecoration == self) )
		Pawn(Base).DropDecoration();
	if( (Contents!=None) && !Level.bStartup )
	{
		tempClass = Contents;
		if (Content2!=None && FRand()<0.3) tempClass = Content2;
		if (Content3!=None && FRand()<0.3) tempClass = Content3;
		spawned = Spawn(tempClass);
		spawned.RemoteRole = ROLE_DumbProxy;
		spawned.SetPhysics(PHYS_Falling);
		spawned.bCollideWorld = true;
		if ( Pawn(spawned) != None )
			Pawn(spawned).GotoState('ScriptedPawn', 'spawned');
	}	

	if( Event != '' )
		foreach AllActors( class 'Actor', P, Event )
			P.Trigger( Self, None );

	if ( bPushSoundPlaying )
		PlaySound(EndPushSound, SLOT_Misc,0.0);
			
	Super.Destroyed();
}




Begin:
}
Binary Space Partitioning
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: So, Deco don't spawn pawns.

Post by Barbie »

The ThingSpawner in the test map did not fulfil your requirements?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Post by sektor2111 »

OMG, man stop doing crap
Point 1.
Red_Fist wrote:#exec AUDIO IMPORT FILE="sounds\general\bPush1.wav" NAME="ObjectPush" GROUP="General"
#exec AUDIO IMPORT FILE="sounds\general\EndPush.wav" NAME="Endpush" GROUP="General"

#exec MESH IMPORT MESH=BarrelM ANIVFILE=MODELS\Barrel_a.3D DATAFILE=MODELS\Barrel_d.3D ZEROTEX=1
#exec MESH LODPARAMS MESH=BarrelM STRENGTH=0.5
#exec MESH ORIGIN MESH=BarrelM X=320 Y=160 Z=95 YAW=64
#exec MESH SEQUENCE MESH=BarrelM SEQ=All STARTFRAME=0 NUMFRAMES=1
#exec MESH SEQUENCE MESH=BarrelM SEQ=Still STARTFRAME=0 NUMFRAMES=1
#exec TEXTURE IMPORT NAME=JBarrel1 FILE=MODELS\Barrel.PCX GROUP=Skins FLAGS=2
#exec MESHMAP SCALE MESHMAP=BarrelM X=0.15 Y=0.15 Z=0.3
#exec MESHMAP SETTEXTURE MESHMAP=BarrelM NUM=0 TEXTURE=JBarrel1 TLOD=10
YOU DON'T NEED these, they are already available by declaring default properties...

Point2.Wheeew !!!
Red_Fist wrote: spawned = Spawn(tempClass);
spawned.RemoteRole = ROLE_DumbProxy;
spawned.SetPhysics(PHYS_Falling);
spawned.bCollideWorld = true;
if ( Pawn(spawned) != None )
Pawn(spawned).GotoState('ScriptedPawn', 'spawned');
WHAT THE HECK DO YOU DO ?
Pawn with ROLE_DumbProxy ? This is utter crap.
GoToState('ScriptedPawn','Spawned') - You can stop guessing, that state doesn't even exist, where did you get it from ? :loool: And then what have we learned from Epic's goofing ? Nothing ? Exactly.

Code: Select all

If (Spawned != None)
{
all bla bla with Spawned
}
Point 3. This decoration using stock defaultproperties at display doesn't need old imports copied because mesh exists. But as replacement for those useless lines you can declare a variable or two. One is Pawn intended to be assigned as Instigator/Instigatedby if exist in TakeDamage/HitWall and other variable is a vector - Location of Instigator. Why ?
If stupid Monster is being successfully spawned (because it might have a failure as well), assign LastSeenPos the vector in cause and send it in STATE ATTACKING right in next line. The rest of toilette guessing state can be deleted because it does stuck pawn as long as ScriptedPawn doesn't have such state.

Point 4.

Code: Select all

Super.Destroyed();
I think you'll have troubles here by duplicating spawn and event - this is EPIC style in doing a double execution wasting CPU TIME for nothing. Not even in actor doesn't exist a code needed - so I believe is totally useless.
Last edited by sektor2111 on Sat Aug 05, 2017 3:21 am, edited 1 time in total.
Red_Fist
Godlike
Posts: 2163
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

Well it is ALL 100% GUESSING I have no idea at all, but at least I got a pawn to spawn.

The pawn just needs to be told what to do after it spawns.

I have ZERO brains when it comes to that proxy stuff or even where to start to look for whatever the hell the engine calls things or what they do or what order they are in or the syntax.

So I posted the code see if you (anyone) can make it work right.

I think it's stuck in a state of being a deco, unless touched.
AND if you can get it to work right, it would be a great actor to have around. !! :)

____________________________________________
Barbie.

No I didn't try it yet, I just got to fooling around with code and got carried away.
Binary Space Partitioning
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Post by sektor2111 »

Line with remoterole can be deleted because is doing bad - physics also is automated by Pawn itself.
Line with state also is useless - leave pawn alone to initialize as it wants if you don't have enemy info
Line with Super.Destroyed can be removed, you don't want Pawn in state Pickup - also is a dumb thing.
Red_Fist
Godlike
Posts: 2163
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

sektor2111 wrote:Line with remoterole can be deleted because is doing bad - physics also is automated by Pawn itself.
Line with state also is useless - leave pawn alone to initialize as it wants if you don't have enemy info
Line with Super.Destroyed can be removed, you don't want Pawn in state Pickup - also is a dumb thing.

Well fix-er-up, all I do is stare into blank space and hope it compiles. :noidea
Binary Space Partitioning
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Post by sektor2111 »

Shoot some WoodenBoxes here and then look at codes.
[attachment=0]MH-A_StartLev.7z[/attachment]
See if function Frag needs wrapping, else I've put them as safe as possible to not fail spawning fragments...
Attachments
MH-A_StartLev.7z
(7.91 KiB) Downloaded 39 times
Post Reply