Sprite based Pawn (Might and Magic VII)

Discussions about Coding and Scripting
Post Reply
User avatar
Daewon
Novice
Posts: 19
Joined: Sun Jan 04, 2009 4:57 pm
Location: Czech Republic

Sprite based Pawn (Might and Magic VII)

Post by Daewon »

I would like to create a pawn class, sprite based like in Might and Magic VII (8 direction sprite).
I found some scripts in forums, but it works only for static things. Pawns changes their rotation to player, and this solution doesn't work.

Code: Select all

simulated function Tick(float deltatime)
{
	local PlayerPawn P;
	local byte TextureIndex;
	local rotator r;

	foreach RadiusActors(class'PlayerPawn', P, RadiusCheck, Location ){ //player is in radius
		if(Viewport(P.Player) != None){ // find local client player.
			if(P.ViewTarget == none){
				r = rotator(P.Location - self.location);
				if (r.yaw <= +4096 && r.yaw > -4096)
					TextureIndex = 0;
				else if (r.yaw <= -4096 && r.yaw > -12288)
					TextureIndex = 2;
				else if (r.yaw <= +12288 && r.yaw >+4096)
					TextureIndex = 1;
				else if (r.yaw <= -12288 && r.yaw > -20480)
					TextureIndex = 4;
				else if (r.yaw <= +20480 && r.yaw > +12288)
					TextureIndex = 3;
				else if (r.yaw <= -20480 && r.yaw > -28672)
					TextureIndex = 6;
				else if (r.yaw <= +28672 && r.yaw > +20480)
					TextureIndex = 5;
				else
					TextureIndex = 7;

				if (TextureIndex != CurrentTextureIndex)
				{
					CurrentTextureIndex = TextureIndex;
					Texture = Sprites[CurrentTextureIndex];
				}
			}else{ // player view is from other actor

			}
		}
		return;
	}
}
ANUBITEK solved this in his RPG mod. His camera changes position and Player sprite was on correct side.
User avatar
Daewon
Novice
Posts: 19
Joined: Sun Jan 04, 2009 4:57 pm
Location: Czech Republic

Re: Sprite based Pawn (Might and Magic VII)

Post by Daewon »

there is some progress. this pawn is child of scriptedpawn. so i make mesh plane, with notify anims for attack, etc.(mesh anim changes animation texture). mesh rotate direct to player like sprite. dot product used for switch corect texture index.

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

Re: Sprite based Pawn (Might and Magic VII)

Post by EvilGrins »

Those are cool and definitely a step up from the knights from Quake.

How much health do they have and do they only have sword attacks?
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
User avatar
OjitroC
Godlike
Posts: 3613
Joined: Sat Sep 12, 2015 8:46 pm

Re: Sprite based Pawn (Might and Magic VII)

Post by OjitroC »

Those are good - they look and move rather better than the sprite scripted pawns from Wolf3D that work in UT and are on a par with the Doom pawn sprites for Unreal.
User avatar
EvilGrins
Godlike
Posts: 9689
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: Sprite based Pawn (Might and Magic VII)

Post by EvilGrins »

I kinda wanna ask you to make another video with an army of those sprites doing to war with krall.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
User avatar
Leo(T.C.K.)
Inhuman
Posts: 875
Joined: Sat Aug 13, 2011 10:26 pm

Re: Sprite based Pawn (Might and Magic VII)

Post by Leo(T.C.K.) »

Maybe you could check the wolf3d TC mod that I recently converted from version 220, this was one of those forgotten mods that was lost from the internet at the turn of the new millenium and only thanks to gamestar cd this was preserved now (but there are a lot more mods like that).

Not sure if it helps any in what you want to do but it is interesting nonetheless. There was also the doompawns mod in the modern times by dots but heard it had issues in 227.
Post Reply