Replacement for Projectile "Glob"

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Replacement for Projectile "Glob"

Post by Barbie »

Replacement for "HauntedCreatures.Glob" and "Dawn.Glob" (which are equal) to prevent Access Nones:
Spoiler

Code: Select all

/*******************************************************************************
Replacement for "HauntedCreatures.Glob" and "Dawn.Glob" (which are equal).
-- some log entries --
Glob MH-Haunted++.Glob3043						(Function UnrealShare.BioGel.Flying.BeginState:0088) LoopAnim: Sequence 'Flying' not found in Mesh 'bigchunk2'
Glob MH-()mG-HallOfGiantMonsters{fixed2}.Glob6	(Function UnrealShare.BioGel.Flying.BeginState:0088) LoopAnim: Sequence 'Flying' not found in Mesh 'bigchunk2'
Glob MH-Dawn_of_the_Dead+Fix2.Glob11				(Function UnrealShare.BioGel.Flying.HitWall:0035) PlayAnim: Sequence 'Hit' not found in Mesh 'bigchunk2'
Glob MH-Dawn_of_the_Dead+Fix2.Glob12				(Function UnrealShare.BioGel.Flying.BeginState:0088) LoopAnim: Sequence 'Flying' not found in Mesh 'bigchunk2'
Glob MH-Dawn_of_the_Dead+Fix2.Glob3				(Function UnrealShare.BioGel.Flying.HitWall:0035) PlayAnim: Sequence 'Hit' not found in Mesh 'bigchunk2'
Glob MH-Dawn_of_the_Dead+Fix2.Glob5				(Function UnrealShare.BioGel.Flying.BeginState:0088) LoopAnim: Sequence 'Flying' not found in Mesh 'bigchunk2'
etc.
*******************************************************************************/
#exec OBJ LOAD FILE=Textures\NaliFX.utx

class GlobSB extends BioGel;

var() int VelocityZIncrement;

function Timer() {
	local UT_BloodPuff f;

	f = spawn(class'UT_BloodPuff', , , Location + SurfaceNormal * 8);
	f.DrawScale = DrawScale * 4.0;
	PlaySound(MiscSound, , 3.0 * DrawScale);
	if ((Mover(Base) != None) && Mover(Base).bDamageTriggered)
		Base.TakeDamage(Damage, instigator, Location, MomentumTransfer * Normal(Velocity), '');
	HurtRadius(damage * Drawscale, DrawScale * 120, 'Burned', MomentumTransfer * Drawscale, Location);
	Destroy();
}

auto state Flying {

	function BeginState()
	{
		if ( Role == ROLE_Authority )
		{
			Velocity = Vector(Rotation) * Speed;
			Velocity.z += VelocityZIncrement;
			if (Region.zone.bWaterZone)
				Velocity = Velocity * 0.7;
		}
		if (Level.NetMode != NM_DedicatedServer)
			RandSpin(100000);
		LoopAnim('Flying', 0.4);
		bOnGround = False;
		PlaySound(SpawnSound);
	}
}


defaultproperties {
	CollisionHeight=8
	CollisionRadius=8
	Damage=25.00
	DrawScale=3.00
	ImpactSound=Sound'UnrealShare.Gibs.Gib1'
	LightBrightness=51
	LightHue=0
	LightRadius=12
	MiscSound=Sound'UnrealShare.Gibs.Gib5'
	MultiSkins(1)=WetTexture'NaliFX.WLAVA'
	SpawnSound=Sound'UnrealShare.Gibs.Gib1'
	speed=1111.00
	VelocityZIncrement=200
}
Use it in Mutator's CheckReplacement() with

Code: Select all

function bool CheckReplacement(Actor Other, out byte bSuperRelevant) {
	...
	if (ScriptedPawn(Other) != None)
		if (string(ScriptedPawn(Other).RangedProjectile) == "Dawn.Glob"
		 || string(ScriptedPawn(Other).RangedProjectile) == "HauntedCreatures.Glob")
			ScriptedPawn(Other).RangedProjectile = Class'GlobSB';
	...
Test map attached.
Attachments
TestGlobSB.unr.7z
(4 KiB) Downloaded 68 times
GlobSB.jpg
"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: Replacement for Projectile "Glob"

Post by sektor2111 »

Actually you can change HauntedCreatures package - you'll see what I mean...
Post Reply