Sprite based Pawn (Might and Magic VII)

Discussions about Coding and Scripting
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 » Sun Sep 27, 2020 2:08 pm

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 » Thu Oct 22, 2020 7:48 pm

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: 7896
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA

Re: Sprite based Pawn (Might and Magic VII)

Post by EvilGrins » Thu Oct 22, 2020 8:44 pm

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: 2334
Joined: Sat Sep 12, 2015 8:46 pm

Re: Sprite based Pawn (Might and Magic VII)

Post by OjitroC » Thu Oct 22, 2020 10:15 pm

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: 7896
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA

Re: Sprite based Pawn (Might and Magic VII)

Post by EvilGrins » Thu Oct 22, 2020 11:12 pm

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.)
Masterful
Posts: 571
Joined: Sat Aug 13, 2011 10:26 pm

Re: Sprite based Pawn (Might and Magic VII)

Post by Leo(T.C.K.) » Fri Oct 23, 2020 10:40 am

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.