Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Kinoko

#1301
Ahhh right. Well, I was really just wondering out it and how it would work. I think it'd be a nice feature but I'm not gonna die without it.
#1302
Well, I tried this one out and I get an error with the line: float TryDiagonalMove(float dist, int dx, int dy, int slideDirX, int slideDirY) {

saying it has the wrong number of parameters. I thought you must have meant to write "function" instead of "float" so I changed it and I still get the same message.
#1303
Ahhh, I see. So you can't have both SCI and bitmap fonts in the engine?
#1304
Wasn't there a lot of controversy about London supposedly buttering up the judges with gifts and money?
#1305
General Discussion / Re: I'm a-going to Japan!
Wed 06/07/2005 14:37:22
Just in case anyone was interested (I know Vince will care!), I just found out today I'll be in a town called Kakegawa in Shizuoka ^_^ Pop. of about 100,000 and it sounds faaaaaaaaaaaaaaaaantastic.
#1306
General Discussion / Re: Origin II Tomorrow
Wed 06/07/2005 14:23:32
I think Kennedy sould have got a Logie for Best Actor. I've never seen such a pussy dive in all my life ^_^ As for the rest of the game, I wasn't crying but I was certainly not celebrating either. Our team just lost all confidence and kept making stupid mistakes. Mind you, there were so many dodgy penalties at the start I can understand them feeling bad.
#1307
Is it possible to have a font+outline with each character made up of more than one colour? For example, if you're going for an Indiana Jones fading effect with a couple of shades. I'm pretty sure this -isn't- possible but how could it be possible? I can only think of having each character made up of several "outlines" each making up a colour section of the font, then having the editor put them back together.
#1308
Okay, for clarification, I have this:

Code: ags

#define DIR_DISTANCE 10000
#define DIR_DOWN_LEFT 1
#define DIR_DOWN 2
#define DIR_DOWN_RIGHT 3
#define DIR_LEFT 4
#define DIR_STOP 5
#define DIR_RIGHT 6
#define DIR_UP_LEFT 7
#define DIR_UP 8
#define DIR_UP_RIGHT 9
#define DIR_NONE 0
int PrevDirection;
int isRunning = 0;
int CharId;
int Direct;
int oldDirect;
int newdir;
float characterX;
float characterY;
float animFrame = 0.0;


and:
Code: ags

function TryDiagonalMove(float dist, int dir, int dx, int dy, int slideDirX, int slideDirY)
{
  int newDir = dir;
  // test that direction
  float delta = 0.7071*dist;
  float dxf = IntToFloat(dx);
  float dyf = IntToFloat(dy);
  float newCharacterX = characterX + dxf*delta;
  int pixelMove = FloatToInt(newCharacterX) - FloatToInt(characterX);
  if (pixelMove != 0)
  {
    // check the diagonal move
    if (GetWalkableAreaAt(player.x + dx, player.y + dy) != 0)
    {
      // can move that way
      float maxDelta = delta;
      if (maxDelta > 1.0)
      {
        maxDelta = 1.0;
        dist -= 1.414;
      }
      else
      {
        dist = 0.0;
      }
      characterX += dxf*maxDelta;
      characterY += dyf*maxDelta;
    }
    else
    {
      // round off the position
      characterX = IntToFloat(FloatToInt(characterX)) + 0.5;
      characterY = IntToFloat(FloatToInt(characterY)) + 0.5;
      if (GetWalkableAreaAt(player.x + dx, player.y) != 0)
      {
        newDir = slideDirX;
      }
      else
      {
        newDir = slideDirY;
      }
    }
  }
  else
  {
    // pixelMove == 0
    // didn't change pixel so just move within the pixel
    characterX = characterX + dxf*delta;
    characterY = characterY + dyf*delta;
    // stop
    dist = 0.0;
  }
 
  return newDir;
}

function TryStraightMove(float dist, int dx, int dy)
{
  float delta = dist;
  float dxf = IntToFloat(dx);
  float dyf = IntToFloat(dy);
  float newCharacterX = characterX + dxf*delta;
  float newCharacterY = characterY + dyf*delta;
  int pixelMoveX = FloatToInt(newCharacterX) - FloatToInt(characterX);
  int pixelMoveY = FloatToInt(newCharacterY) - FloatToInt(characterY);
  if (pixelMoveX != 0 || pixelMoveY != 0)
  {
    // check the move
    if (GetWalkableAreaAt(player.x + dx, player.y + dy) != 0)
    {
      // can move that way
      float maxDelta = delta;
      if (maxDelta > 1.0)
      {
        maxDelta = 1.0;
        dist -= 1.0;
      }
      else
      {
        dist = 0.0;
      }
      characterX += dxf*maxDelta;
      characterY += dyf*maxDelta;
    }
    else
    {
      // round off the position
      characterX = IntToFloat(FloatToInt(characterX)) + 0.5;
      characterY = IntToFloat(FloatToInt(characterY)) + 0.5;
      // stop moving
      dist = 0.0;
    }
  }
  else
  {
    // pixelMove == 0
    // didn't change pixel so just move within the pixel
    characterX = characterX + dxf*delta;
    characterY = characterY + dyf*delta;
    // stop
    dist = 0.0;
  } 
}

function DirectionFromKeyPresses()
{
  Direct = DIR_NONE;
       if ((IsKeyPressed (371) > 0) || (IsKeyPressed (55) > 0) || ((IsKeyPressed (372) > 0) && (IsKeyPressed (375) > 0))) Direct = DIR_UP_LEFT;
  else if ((IsKeyPressed (373) > 0) || (IsKeyPressed (57) > 0) || ((IsKeyPressed (372) > 0) && (IsKeyPressed (377) > 0))) Direct = DIR_UP_RIGHT;
        else if ((IsKeyPressed (379) > 0) || (IsKeyPressed (49) > 0) || ((IsKeyPressed (380) > 0) && (IsKeyPressed (375) > 0))) Direct = DIR_DOWN_LEFT;
else if ((IsKeyPressed (381) > 0) || (IsKeyPressed (51) > 0) || ((IsKeyPressed (380) > 0) && (IsKeyPressed (377) > 0))) Direct =DIR_DOWN_RIGHT;
  else if ((IsKeyPressed (372) > 0) || (IsKeyPressed (56) > 0)) Direct = DIR_UP;
  else if ((IsKeyPressed (375) > 0) || (IsKeyPressed (52) > 0)) Direct = DIR_LEFT;
  else if ((IsKeyPressed (376) > 0) || (IsKeyPressed (53) > 0)) Direct = DIR_STOP;
  else if ((IsKeyPressed (377) > 0) || (IsKeyPressed (54) > 0)) Direct = DIR_RIGHT;
  else if ((IsKeyPressed (380) > 0) || (IsKeyPressed (50) > 0)) Direct = DIR_DOWN;

  return Direct;
}


and then in repeatedly_execute:
Code: ags

if (IsGamePaused()==0) {
					
				Direct = DirectionFromKeyPresses(); // as before
				if (Direct != oldDirect) {
					// changing direction, so reset these
					characterX = IntToFloat(player.x) + 0.5;
					characterY = IntToFloat(player.y) + 0.5;
				}
				if (Direct != DIR_STOP) {
								float dist = 0.75;
								if (IsKeyPressed(keya)) {
									// running, so go twice the distance
									dist = 1.5;
								}
								int newDir = Direct;
								while (dist > 0.0) {
											if (newDir == DIR_DOWN_LEFT) {
												newDir = TryDiagonalMove(dist, newDir, -1, 1, DIR_LEFT, DIR_DOWN);
											}
											else if (newDir == DIR_DOWN_RIGHT) {
												newDir = TryDiagonalMove(dist, newDir, 1, 1, DIR_RIGHT, DIR_DOWN);
											}
											else if (newDir == DIR_UP_LEFT) {
												newDir = TryDiagonalMove(dist, newDir, -1, -1, DIR_LEFT, DIR_UP);
											}
											else if (newDir == DIR_UP_RIGHT) {
												newDir = TryDiagonalMove(dist, newDir, 1, -1, DIR_RIGHT, DIR_UP);
											}
											else if (newDir == DIR_LEFT) {
												TryStraightMove(dist, -1, 0);
											}
											else if (newDir == DIR_RIGHT) {
												TryStraightMove(dist, 1, 0);
											}
											else if (newDir == DIR_UP) {
												TryStraightMove(dist, 0, -1);
											}
											else if (newDir == DIR_DOWN) {
												TryStraightMove(dist, 0, 1);
											}
								} /////////////ENDLESS LOOPING/HANGING HERE
								
				  // now animate the character
				/*animFrame += 0.1;
					int animFrameInt = FloatToInt(animFrame);
					if (animFrameInt > 4) animFrameInt = 0;*/
					// TODO: set the player loop and frame depending on Direct and animFrameInt
				}
				else {
					// TODO: set the standing frame based on oldDirect
				}
				player.x = FloatToInt(characterX);
				player.y = FloatToInt(characterY);
				oldDirect = Direct;

} //end if paused


I'm getting an error when I test the game and hit a direction key that basically tells me the code is looping over and over at the line I've marked above.
#1309
Now I'm getting undefined symbol with ANIM_SPEED and NUM_FRAMES
#1310
No problem, thanks ^_^ Sorry I misunderstood before. The code has always been wrapped in an IsGamePaused() line so no problem there.

EDIT: "Cannot convert int to float" ->   float dist = DIR_DISTANCE;

I'm not even sure what a float is so...
#1311
(Turns out I don't have to scoot out yet so I'm giving the code a go)

I'm getting an error with the "DirectionFromKeyPresses()" line. It's an undefinied symbol.
#1312
Remind me if we ever meet that I'm buying you a drink Steve. I don't mind at all if it's long, as long as it works.

I haven't got time to test it right now 'cause I have to scoot out for a bit but my gamespeed is actually 80, and (I might be understanding you wrong here but) do I have to put some of the code in a room script? This is the way the character will be moving throughout the entire game (hundreds of room).
#1313
General Discussion / Re: Just ... disturbing.
Tue 05/07/2005 02:11:34
Hey, we've all wanted to bash PeeWee Herman's head in at some stage ^_^

I must admit, I was watching those scenes with the monkey and the cat drawing and just going, "Er... is this goig somewhere? I don't get it". When she started to take her overalls off, I thought, "I know where THIS is going!" but it didn't go there. I think the most disturbing was the picture of herself but that's probably also because self-cutting is a sensitive subject with me, which made it rather real. The eye thing was too far fetched to be really shocking.
#1314
General Discussion / Re: War of the Worlds
Tue 05/07/2005 02:07:22
I remember first stealing the CD out of my brothers room and sticking it in my own CD player in my room. It was all twilight-ey outside and the song was great, then came the unscrewing... starting to get a little on edge there. The hairs on the back of my neck positively stood on end when I heard that piece of music that plays as the aliens leave the pod. Doomdoomdoom doom doomdoom. Suddenly I was looking out of my window imagining the tripods coming to get me.

Great, great memories. The only bad part on the whole CD is the awful song that plays when his wife leaves...always skipped than one.

The "ULA" though is the most fantastic noise ever created for an alien.
#1315
General Discussion / Re: War of the Worlds
Mon 04/07/2005 15:34:46
Excellent, Darth. Listen to it in a dark room ^_^
#1316
This old code is back for yet another appearance.

Code: ags

#define DIR_DISTANCE 10000
#define DIR_DOWN_LEFT 1
#define DIR_DOWN 2
#define DIR_DOWN_RIGHT 3
#define DIR_LEFT 4
#define DIR_STOP 5
#define DIR_RIGHT 6
#define DIR_UP_LEFT 7
#define DIR_UP 8
#define DIR_UP_RIGHT 9


In repeatedly execute:

Code: ags

if (IsGamePaused()==0) {
Ã,  
	if ((IsKeyPressed (371) > 0) || (IsKeyPressed (55) > 0) || ((IsKeyPressed (372) > 0) && (IsKeyPressed (375) > 0))) Direct = DIR_UP_LEFT;
	else if ((IsKeyPressed (373) > 0) || (IsKeyPressed (57) > 0) || ((IsKeyPressed (372) > 0) && (IsKeyPressed (377) > 0))) Direct = DIR_UP_RIGHT; 
	else if ((IsKeyPressed (379) > 0) || (IsKeyPressed (49) > 0) || ((IsKeyPressed (380) > 0) && (IsKeyPressed (375) > 0))) Direct = DIR_DOWN_LEFT;
	else if ((IsKeyPressed (381) > 0) || (IsKeyPressed (51) > 0) || ((IsKeyPressed (380) > 0) && (IsKeyPressed (377) > 0))) Direct =DIR_DOWN_RIGHT;
	else if ((IsKeyPressed (372) > 0) || (IsKeyPressed (56) > 0)) Direct = DIR_UP; 
	else if ((IsKeyPressed (375) > 0) || (IsKeyPressed (52) > 0)) Direct = DIR_LEFT; 
	else if ((IsKeyPressed (376) > 0) || (IsKeyPressed (53) > 0)) Direct = DIR_STOP; 
	else if ((IsKeyPressed (377) > 0) || (IsKeyPressed (54) > 0)) Direct = DIR_RIGHT; 
	else if ((IsKeyPressed (380) > 0) || (IsKeyPressed (50) > 0)) Direct = DIR_DOWN; 
	else Direct = DIR_STOP;
	
	if (IsKeyPressed(keya)==1) { //RUNNING - 'A' button held down
	
	Ã,  Ã, if (isRunning==0) {
	Ã,  Ã,  Ã,  StopMoving(GetPlayerCharacter());
	Ã,  Ã,  Ã,  SetCharacterSpeed(GetPlayerCharacter(), 12);
	Ã,  Ã,  Ã,  isRunning = 1;
	Ã,  Ã,  Ã,  ReleaseCharacterView(EGO);
	Ã,  Ã,  Ã,  ChangeCharacterView(EGO, 33);
	Ã,  Ã,  Ã,  Direct = DIR_STOP;
	Ã,  Ã, }
	
	} 
Ã,  else {
	
	Ã,  Ã, if (isRunning==1) {
	Ã,  Ã,  Ã,  StopMoving(GetPlayerCharacter());
	Ã,  Ã,  Ã,  SetCharacterSpeed(GetPlayerCharacter(), 6);
	Ã,  Ã,  Ã,  isRunning = 0;
	Ã,  Ã,  Ã,  ReleaseCharacterView(EGO);
	Ã,  Ã,  Ã,  ChangeCharacterView(EGO, 1);
	Ã,  Ã,  Ã,  Direct = DIR_STOP;
	Ã,  Ã, }
	}
	
	if ((PrevDirection != Direct) || (character[EGO].walking == 0)) {
			PrevDirection = Direct;
			CharId = GetPlayerCharacter ();
			if (Direct == DIR_STOP) StopMoving (CharId); // 5 Stop (numeric pad)
			else {
				if (Direct == DIR_UP_LEFT) {
					dx = -DIR_DISTANCE; dy = -DIR_DISTANCE;
					StrCopy (direct, "ul"); 
					} // 7 Home (numeric pad)
				else if (Direct == DIR_UP) {
					dx = 0; dy = -DIR_DISTANCE;
					StrCopy (direct, "u");
					} // 8 Up arrow
				else if (Direct == DIR_UP_RIGHT) { 
					dx = DIR_DISTANCE; dy = -DIR_DISTANCE;
					StrCopy (direct, "ur");
					} // 9 PgUp (numeric pad)
				else if (Direct == DIR_LEFT) { 
					dx = -DIR_DISTANCE; dy = 0; 
					StrCopy (direct, "l");
					} // 4 Left arrow
				else if (Direct == DIR_RIGHT) { 
					dx = DIR_DISTANCE; dy = 0;
					StrCopy (direct, "r");
					} // 6 Right arrow
				else if (Direct == DIR_DOWN_LEFT) { 
					dx = -DIR_DISTANCE; dy = DIR_DISTANCE;
					StrCopy (direct, "dl");
					} // 1 End (numeric pad)
				else if (Direct == DIR_DOWN) { 
					dx = 0; dy = DIR_DISTANCE; 
					StrCopy (direct, "d");
					} // 2 Down arrow
				else if (Direct == DIR_DOWN_RIGHT) { 
					dx = DIR_DISTANCE; dy = DIR_DISTANCE; 
					StrCopy (direct, "dr");
					} // 3 PgDn (numeric pad)
				MoveCharacterStraight (CharId, character [CharId].x + dx, character [CharId].y + dy);
			}
	}
}


At the moment, the code works -great-. I love it. Responds perfectly to keyboard control. There's another feature I'd like to add though.

Basically, when a character is walking along, say, left... if he hits an edge, he stops. Fair enough, but if I then, while holding left still, hold down the 'up' key, he still won't move. In a typical RPG, what would happen is that the character would start moving up along the edge (while still facing left) until it either hit a spot where it could go left/up-left or in neither direction anymore.

Also, even if the character is against an edge, I'd like him to keep "walking" on the spot if I have the key pressed.

One other thing is that if the character is against an edge and I hit a direction key (not hold it down necessarilly) facing that edge, the character won't move because, well, it's an edge. I'd like him to face that direction still, even if there's no walkable area.

I've written down all sorts of basic code ideas but when I try to think practically about how to adjust the above code, I just end up with a headache. Can anyone at least point me in the right direction? I don't know how to ask the game if it's a possibility to walk when I hit a key. It's not as simple as just checking if a certain coordinate is a walkable area or not because the next pixel over isn't necessarilly where the character would move given his speed and that it changes between walking and running.

I've been thinking about this for days and I just can't get my head around it.
#1317
General Discussion / Re: War of the Worlds
Mon 04/07/2005 13:38:06
I totally agree that Jeff Wayne's theme should have been used. That, right there, is some absolute kick-ass music. It has that same effect that the Hitchhiker's theme has.
#1318
General Discussion / Re: Just ... disturbing.
Mon 04/07/2005 06:15:08
Yeah, it's disturbing in a very mild way, really. For some of them, I was like, "Pff, that's it?" or "What on earth is that about?". It's not really any worse than watching someone's head get chopped off in a movie.

Maybe if they made the room a little creepier (it's pretty darned cute. Not even TOO cute. I'd feel warm and fuzzy in that room) and put some scary music on in the background. Then again, that'd be over the top and too obvious.

The weird thing is that usually scary dools is my -absolute WORST fear-. I used to have some serious, serious issues with imagining dolls crying blood. I had plenty a night that I couldn't sleep if I thought about something like that, and I still can't even look at a lot of horror movies that feature scary dolls. Still, I just look at this and think, "Awwwww". It's strangely life-like in the way it moves, really... well, cute.
#1319
Advanced Technical Forum / Re: Sound of stairs
Mon 04/07/2005 06:07:16
That works pretty well Steve, thanks!
#1320
Advanced Technical Forum / Re: Sound of stairs
Mon 04/07/2005 05:55:09
It's definitely only turning on and off a few times in each walk over the stairs (halves if I 'run', not surprisingly).

I know the problem is that it's only counting the x/y coords that my character is standing on each game loop, and he moves too quick to be positioned on each coordinate. I don't have a  clue what to do about it though. I can't make the steps bigger.
SMF spam blocked by CleanTalk