So, Deco don't spawn pawns.

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

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

Confusing as hell. I wish you stuck to the barrel so I could compare better. But that is a lot of added code I would NEVER know to add, or not.

Well I got it back to the barrel, but I still made a new deco class, not a subclass of barrel.

If I or we can get all the other breakable decos (not the exploding barrels) and if it works online, would be a good deco set to have.
Last edited by Red_Fist on Sat Aug 05, 2017 8:21 am, edited 1 time in total.
Binary Space Partitioning
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Post by sektor2111 »

All right, let's see that "barrel". Gimme a few minutes, please...

Edit: 3, 2, 1, ... Beep -Time up
Here ya go...
[attachment=0]MH-A_StartLev_01.7z[/attachment]
Is not that different...
Attachments
MH-A_StartLev_01.7z
(9.44 KiB) Downloaded 43 times
Last edited by sektor2111 on Sat Aug 05, 2017 8:39 am, edited 1 time in total.
Red_Fist
Godlike
Posts: 2166
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

sektor2111 wrote:All right, let's see that "barrel". gimme a few minutes, please...
got to go to bed, but here is the code I did, copied

Code: Select all

//=============================================================================
// BarDP.
//=============================================================================
class BarDP 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> Pcontents;
var() class<ScriptedPawn> Pcontent2;
var() class<ScriptedPawn> Pcontent3;
var Pawn Enemy;
var vector ELoc;

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 dropped, A;
	local class<actor> tempClass;

	if( (Pawn(Base) != None) && (Pawn(Base).CarriedDecoration == self) )
		Pawn(Base).DropDecoration();
	if( (PContents!=None) && !Level.bStartup )
	{
		tempClass = PContents;
		if (PContent2!=None && FRand()<0.3) tempClass = PContent2;
		if (PContent3!=None && FRand()<0.3) tempClass = PContent3;
		dropped = Spawn(tempClass);
		if ( dropped != None )
		{
			if ( ScriptedPawn(dropped) != None )
			{
				if ( Enemy != None )
				{
					Scriptedpawn(dropped).Enemy = Enemy;
					Scriptedpawn(dropped).Hated = Enemy;
					Scriptedpawn(dropped).LastSeenPos = ELoc;
					Scriptedpawn(dropped).GotoState('Attacking');
				}
			}
		}
	}	

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

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

Begin:
}

defaultproperties
{
     Health=1
     PushSound=Sound'UnrealShare.General.ObjectPush'
     EndPushSound=Sound'UnrealShare.General.Endpush'
     bStatic=False
     DrawType=DT_Mesh
     Skin=Texture'UnrealShare.Skins.JBarrel1'
     Mesh=LodMesh'UnrealShare.BarrelM'
     CollisionRadius=24.000000
     CollisionHeight=29.000000
     bCollideActors=True
     bCollideWorld=True
     bBlockActors=True
     bBlockPlayers=True
     Mass=50.000000
     Buoyancy=60.000000
}
Binary Space Partitioning
User avatar
editor Dave
Inhuman
Posts: 904
Joined: Mon Mar 10, 2008 6:40 pm
Personal rank: Passionate SP Mapper
Location: Germany/Bavaria
Contact:

Re: So, Deco don't spawn pawns.

Post by editor Dave »

I just throw in here that decorations may contain and spawn Pawns without custom scripting. It is only that the editor prevents you from doing so. In earlier versions of UnrealED 1 you were able to select any class to spawn. At the very least, in the original Unreal campaign, you can shoot a dead Nali body to spawn a Pupae in the map Outpost 3J. In 227, this feature has returned and if you place some decos there with any Pawn "content", you can import them in UT without the "content" lines disappearing.
Image
10-Year Anniversary on Jun 08, 2019.
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Post by sektor2111 »

I don't intend to make an U227 UT soup with classes. Separate things are healthy and I have even A.I. support for this MH task.

@RedFist
I have an update with custom pawns spawned and Bot Support. Optimized for 1 Bot covering shooting decos from time to time. If you want it, I'll post updated version.
Like I said before, you have defined "UnrealShare.BarrelM" in defaults which any new class can use - all those #EXEC have no purpose. What exactly you did not get here ? Those lines are from FACTORY when they did compile UnrealShare file - you don't even need this, this is not your job and neither mine. You don't want invalid copies of meshes which are already imported. Else those directives will never work if you don't have original resources, calm down with that useless copy-paste.
Red_Fist
Godlike
Posts: 2166
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

I don't get it, first they make a "Tree" of classes the one below takes on the settings of the one above.

However the one above has crap that I DON'T want, so why even bother if the new actor always gets stuck with the same crap as the one above ?

Every time I tried to make a new subclass it has something wrong because the class above it won't let it work.

So what is the purpose of having a tree in the first place. other than the very top class that is needed to keep it a pawn, or inventory or decoration, those cannot be duplicated.

I made a new skaarjwarrior, I had to put it as a subclass of "skaarj" NOT a subclass of skaarjwarrior

So I copy the whole thing from "SkaarjWarior" top class, then I paste it as a new class under "skaarj" not just make an empty new class below skaarjwarrior with no code at all.

That starts me out being able to modify any new thing below the top class "Skaarj" but yet makes a brand new "skaarjworrior2". Then I edit everything that says "skaarjworrior" to the new name, or other things that refers back to the original wrong pawn name.

For instance, if you want a pawn to use a new projectile with a different name, if it's subclassed it will always read the default of the class above it, there is no place to edit it. So I take the full code of the pawn, and edit each word inside to match the new class name.

I mean why bother with a tree when I know the subclass will drag the same wrong stuff above it.

I am not doing it like that for no reason, I even did it like that in UT2004, things always went wrong making a subclass
A new weapon gets placed under "weapon" with the code pasted of the weapon I want to modify. Then I change all the words in the code until it compiles correctly to match any other new class I made.
That way I have full control, only the default class of "weapon" gives it's defaults that are needed.

This stems from the fact that when you want a new actor if you play DM online it always goes back to the damn same old thing.
So in order for a new changed actor to work online it needs a whole new duplicate class with a different name so it won't revert back to the original, because placed edited actors don't work online, but only offline for DM.
Last edited by Red_Fist on Sun Aug 06, 2017 5:02 am, edited 2 times in total.
Binary Space Partitioning
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Post by sektor2111 »

Entirely wrong.
Main feature of this UT with its UScript is that you can REWRITE the most of functions which are not "final" but you can even slope them as well through others.
Even if you do a custom game-type child of "BotPack.Whatever" you can rewrite all stuff in a different format and game is turned into other better direction - see my Game-Speed related Posting - you can block old parent code by rewriting a clean one. Let's take a random example:

Code: Select all

function doNastyDefault()
{
code();
code();
code();
}
If you don't want this function in child tree classes just override it:

Code: Select all

function doNastyDefault()
{
}
And simply define parent function as a null thing and/or call anything else more "improved" if it do exists.
In this case I did a child barrel but it will dance as I'm singing not as dictates the parent decoration or barrel code itself, I'm using only what I need from it. All these have nothing to do with a new import copied for no purpose - those lines are not executed. BarrelM is a stock mesh you cannot redefine it without source-code.
Red_Fist
Godlike
Posts: 2166
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

Test map,

I did other decos, but if someone could test it online would be cool.

I think I set it to coop gametype, so you might need to change that.
Attachments
DecoPawnDropTest.unr
a UNR file
(34.67 KiB) Downloaded 40 times
Binary Space Partitioning
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: So, Deco don't spawn pawns.

Post by JackGriffin »

It might not spawn correctly online. I ran into this problem when I was fucking around with Bob making a pupae spawner rifle (don't ask, just blame Bob). This took several evenings to get right and eventually I had to appeal to Masterkent to explain why. First the code:

Code: Select all

class PupaeRocket expands RocketMk2;

var() string TrailT;
var float ACount;

simulated function PostBeginPlay()
{
	ACount = -0.1;
}

function Tick(float DeltaTime)
{
	local class<actor> b;
	local vector X,Y,Z, projStart;
	local string classname;
	local actor a;
	projStart = Location;
	classname=trailt;

	GetAxes(Rotation,X,Y,Z);

	if (bHitWater)
	{
		Disable('Tick');
		Return;
	}
	ACount += DeltaTime;
	if (ACount> 0.09)
	{
		b = class<actor>(DynamicLoadObject(ClassName, class'Class'));
		if(b!=None)
			a=Spawn(b,,'',projstart,);
		ACount=0.0;
		if (a!= none)
			a.remoterole=ROLE_simulatedproxy;
	}
}

defaultproperties
{
   TrailT="UnrealI.Pupae"
   DrawScale=0.01
}
What this does is spawn an "invisible" (very tiny) rocket that leaves a trail of pupae. The issue I was having before this is that online they just wouldn't work right. They spawned OK but they wouldn't interact right and you couldn't hurt them IIRC. The problem was that they have to be spawned dynamically in order for the replication to be set up correctly. This is only applicable to pawn classes, pickups and everything else work just fine. The code I posted is correct and can be applied anywhere where a non-pawn class calls up a pawn and you are having issues.

If you want I can write the code for your deco so it works right. I'll annotate it and you can apply that code to other things you might want to use.
So long, and thanks for all the fish
Red_Fist
Godlike
Posts: 2166
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

Only for Breakable Deco, box- chest etc.

The code is Sektor, and me being total (logical) nerd, I hope, just to add his code to more decos. He did the Barrel for me, and I managed to get the others to work and compile.
By all means, if you can trim down the code and-or make it not glitch, go for it.


Seems to work

However, all it needs is individual actors like I added, that you are able to make ONE pawn spawn, ie; "dropped", , for that Deco.
Nothing more, other than work well. I don't know Unreal code like you guys. but it worked :tu: :)

Also this was with MH in mind, (or any gametype if possible) So if you edit it, try to make it work for all Unreal versions. Mainly so more people can use it.

no elaborate functions minimal code !!!!! just a damn Deco to pick from with an (actor new name) that drops a pawn, and tested for online. (each deco type)
I think it is 8 decos, good enough for 8 different pawns.

Be a really good item for the mappers because it adds a wide tactile range of use. Anything is appreciated, both you and Sektor

You and SeKtor can hash it out about the code. I was just happy I got the other decos to work, :D
Last edited by Red_Fist on Thu Oct 05, 2017 5:20 am, edited 1 time in total.
Binary Space Partitioning
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Post by sektor2111 »

Dude, my goal is to point things into a clean state and explaining if Net Play has issues. These decos On-Line HAVE let's say 0 (ZERO) issues. Do you want an evidence ? Sure, see my signature folder with maps, aiming target is MH-BattlingLottery (archived) and which I play ONLY on Net environment. ONLY Net Play ? Yes, because some lightning stuff there works better ON-LINE, read well, it works better On-Line than Off-Line - that's lightning in UT not me - dynamic coronas in some area. That one has 2 types of such decorations dropping pawns and being randomized to do an event with another actor which... doesn't even need Net stuff because it's an authoritative thing that is not client's job. Of course there is other stuff there as well, I have posted this already, if you don't have time to check it, then leave presumptions away about Net flaws because it doesn't have any flaw. Why ? Because Actor is replicating self's presence + some required properties - SpawnNotify is working as it was working with any CreatureFactory spawning pawns - new actor spawned at with all data related to an actor having a mesh (mesh, velocity, location, drawscale, etc.) - monster is such an actor. What Flaws might be On-Line ? I'm not rushing maps, I'm doing a minimal NET testing before saying "DONE", I'm not mapping like with hair burning as others are doing, seriously...
Biography: Engine.Actor.

Flaws (if are triggered) are just like everywhere, ON-Line and OFF-Line - I'm not gonna describe them because are not breaking map anyway (I was thinking at them), but are my secret, find them by yourself.
Last edited by sektor2111 on Thu Oct 05, 2017 5:41 am, edited 2 times in total.
Red_Fist
Godlike
Posts: 2166
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

Ha :noidea

Well test the map I uploaded,

Cuz I have no clue.
Binary Space Partitioning
Red_Fist
Godlike
Posts: 2166
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

sektor2111 wrote:Dude, my goal is to point things into a clean state and explaining if Net Play has issues. These deco On-Line HAVE 0 (ZERO) issues. Do you want an evidence ? Sure, see my signature folder with maps MH-BattlingLottery. That one has 2 types of such decorations dropping pawns and being randomized to do an event with another actor which... doesn't even need Net stuff because it's an authoritative thing that is not client's job.
I am using your code on this map.

My reason for posting the map was to make sure if I use them in another map, every aspect worked, including online or offline.

So
I might have done it wrong while adding your code, I got it all to compile. But it needs to be checked by you programmers.

Thanks all :!:
Binary Space Partitioning
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Post by sektor2111 »

Yes, Jack said that it might be a problem On-Line - I don't think so. I'm playing such a map for 2 or 3 weeks and excuse me, but exist a flaw (will not break map but I repeat, IT'S MY SECRET - Engine based), and it might not be seen... it's up on player...
Red_Fist
Godlike
Posts: 2166
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Post by Red_Fist »

Ya but,,,,,,you don't know Jack,,,,,,,,,,, :P

He will have a 3 tier deco variable collision field Mega transfer field stereo generator plant deco. :P :P
Binary Space Partitioning
Post Reply