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 - WHAM

#2421
I was suddenly reminded why I suck at math... I'll try to see if I can get it working, but at the moment I'm having a hard time even grasping the math and understanding how the script I was provided works.

I'll post back if I make progress!
#2422

Am I doing something wrong? I decided to use a character instead of an object (cBullet). Below is the script I blatantly copy-pasted from here. For some reason the bullet first travels in a straight line for a while and only then begins to curve towards the target...

You can download the InDev game from www.whamgames.com/downloads/success/POC.rar

To test the bullet script press F, move cursor over target area and press space to shoot. The bullet travels according to the below script and stops if it encounters a wall.

Code: ags

        cBullet.ChangeRoom(player.Room, player.x, player.y-7);
        
        String hupu = "x";
        int tupu = 0;
        Display("SHOT FIRED");
        while (tupu < 500 && hupu != "BLOCK") {
        
          float vx = IntToFloat(GetViewportX() + 160 - cBullet.x);
          float vy = IntToFloat(GetViewportY() + 78 - cBullet.y);
          float n = Maths.Sqrt(vx*vx + vy*vy);
          
          if (vx == 0.00 || vy == 0.00) {
            tupu = 501;
          } else {
            vx = vx / n;
            vy = vy / n;  
          }
          
          cBullet.x += FloatToInt(vx, eRoundNearest);
          cBullet.y += FloatToInt(vy, eRoundNearest);
          
          hupu = Game.GetLocationName(cBullet.x - GetViewportX(), cBullet.y - GetViewportY());
          
          tupu++;
         
          Wait(2);
        }
#2423
Thanks for the quick replies! I've got some nasty crap going on in my head and throat ("ooh! Gooooo!"), but I'll get to testing some time in the upcoming week.
#2424
Is there a way to do this (I haven't been able to get this kind of behavior with the move command, so I thought I'd ask):

Code: ags

//PSEUDOCODE
String hupu;
int tupu = 0;

while (tupu < 500 && hupu != "taa") {
  // move an object toward another object's coordinates by ONE PIXEL
  if (GetLocationName(object.x, object.y) == "target") {
    hupu = "poo";
  }
  wait(1);
}

#2425
Seconded... I've been taking peeks occasionally to see if there actually is someone who maintains the wiki regularly.
#2426
That's the catch: there is no array to keep track of. I hope this clarifies a bit as to what I'm actually doing under the bonnet, so to speak.

Code: ags

// *********************************
// CHARACTER MOVING FUNCTION 
// *********************************

function MoveChar(int CharID, int direction) {
  // This function moves the selected character (either player or an NPC) by a single square
  // CharID identifies the character being moved: 0 = player, others = NPC
  // The movement is blocking ONLY if it involves the player, otherwise the movements are run in five cycles or as needed
  // Dircerions: 0 = up, 1 = right, 2 = down, 3 = left
  
  if (character[CharID].Moving == false) { // Make sure the character is not already moving
    bool moveblocked = false;
    if (direction == 0) { // UP
      if (Game.GetLocationName(character[CharID].x-GetViewportX(), character[CharID].y-GetViewportY()-23) == "BLOCK") {
        character[CharID].FaceLocation(character[CharID].x, character[CharID].y - 10); // MOVEMENT UP IS BLOCKED
        moveblocked = true;
      } else {
        character[CharID].Animate(3, 1, eRepeat, eNoBlock); // MOVEMENT UP IS NOT BLOCKED
      }
    } else if (direction == 1) { // RIGHT
      //DEBUG mouse.SetPosition(character[CharID].x-GetViewportX() + 15, character[CharID].y-GetViewportY()-7);
      //DEBUG Display(" a %s", Game.GetLocationName(character[CharID].y-GetViewportY()-7, character[CharID].x-GetViewportX() + 15));
      if (Game.GetLocationName(character[CharID].x-GetViewportX() + 15, character[CharID].y-GetViewportY()-7) == "BLOCK") {
        character[CharID].FaceLocation(character[CharID].x+10, character[CharID].y); // MOVEMENT UP IS BLOCKED
        moveblocked = true;
      } else {
        character[CharID].Animate(2, 1, eRepeat, eNoBlock);
      }
    } else if (direction == 2) { // DOWN
      if (Game.GetLocationName(character[CharID].x-GetViewportX(), character[CharID].y-GetViewportY()+8) == "BLOCK") {
        character[CharID].FaceLocation(character[CharID].x, character[CharID].y + 10); // MOVEMENT UP IS BLOCKED
        moveblocked = true;
      } else {
        character[CharID].Animate(0, 1, eRepeat, eNoBlock);
      }
    } else if (direction == 3) { // LEFT
      if (Game.GetLocationName(character[CharID].x-GetViewportX() - 15, character[CharID].y-GetViewportY()-7) == "BLOCK") {
        character[CharID].FaceLocation(character[CharID].x-10, character[CharID].y); // MOVEMENT UP IS BLOCKED
        moveblocked = true;
      } else {
        character[CharID].Animate(1, 1, eRepeat, eNoBlock);
      }
    }

    if (moveblocked == false) {
      int tupu = 15;
      while (tupu > 0) {
        if (direction == 0) { // UP
          character[CharID].y--;
        } else if (direction == 1) { // RIGHT
          character[CharID].x++;
        } else if (direction == 2) { // DOWN
          character[CharID].y++;
        } else if (direction == 3) { // LEFT
          character[CharID].x--;
        }
        Wait(1);
        tupu--;
      }
      character[CharID].UnlockView();
      if (CharID == 0 && moveblocked == false) {
        playeractions++;
      }
    }
  }
}

// *********************************
#2427
But my main idea was to create a game that can and should be player 100% with the keyboard! Mouse interactions are just a bonus for some of the menu's. There is also the fact that if I use the mouse to target enemies, then I need to create a separate script to allocate the target coordinates of the mouse click to the center of the tile the player clicked...

Drat! I thought this was a good idea but now it seems that everyone else disagrees. I'll have to look at ways to bring more mouse interactions into the game...

Or I could just be a dick and remove the mouse cursor altogether, making the game pure keyboard one.
#2428
Quote from: Dualnames on Fri 11/03/2011 05:08:37
I have to say this is quite nice and impressive. But I'd prefer if the targeting with the F made the cursor change instead.

You might want to change your weapon, access inventory etc while in the targeting mode. You need the mouse cursor for this. I also wanted to bind the targetting cursor to the same tiles as character movement, as the shooting script uses an object that is moved from the center of one square to another to calculate line of sight.
#2429
Critics' Lounge / Re: A really small walkcycle
Thu 10/03/2011 17:23:40
Here's a link to a proof-of-concept test game I made for the character.

www.whamgames.com/downloads/success/POC.rar

Controls are:
arrow keys to move character around
space bar to interact with objects (not much to do)
F to bring up a targeting cursor (for picking targets to shoot at in the final game), or to turn the targeting cursor off.

The game uses a very simple system to keep player from walking through walls. The walls are painted with a hotspot that is named "BLOCK". Whenever the player (or an NPC in the final game) attempts to move to a direction, the game checks if the move woulc cause the player to collide with this BLOCK hotspot. If so, the move is not executed.

The only thing I am not too happy about is the mouse cursor flickering when you keep an arrow key pressed to walk a longer distance, but I doubt there is much I can do about it at the moment.
#2430
Looks like I'll have to do some playing!
#2431
Critics' Lounge / Re: A really small walkcycle
Thu 10/03/2011 11:13:14
I take it that nobody has anything to add so far. I'll probably upload a "playable" proof of concept in this thread this evening, where you can see the walkcycles in action. I'll also see if I can find the time to make new walkcycles with the character holding weapons, as well as animating him firing said weapons in at least four, maybe all eight directions.

Does anybody know if AGS has a way to rotate a sprite in-game? ie. an exact way to make a sprite rotate to face a certain X-Y coordinate?
#2432
Reality-on-the-Norm / Re: Resource depot
Wed 09/03/2011 11:30:13
Quote from: ProgZmax on Mon 07/03/2011 00:00:39
Realized I had some older designs I'd made with hooky and omnikitten so I translated those over to the new style.




Really nice looking art. Like many others, I would probably also try making a RON game if there just were some readymade walkcycles for these.
No matter, I just wanted to compliment! =)
#2433
So far, from a few different sources, my list of potential games is boiling down to (arranged, top to bottom, by popularity, with platform and comments):

- Beyond Good and Evil (GC) (An interesting game, though I played it through not too long ago)
- Tombi / Tombi 2 (PSX) (Hard as all hell, but fun to play, might end up backtracking too much to make it entertaining to watch)
- Resident Evil 3 (PSX) (Been a long time since I played, entertaining, to be sure!)
- Abe's Oddysee (PSX) (I was never good at this, but if people want to watch poor Abe die over and over again...)
- Tony Hawk's Pro Skater 2 (PSX) (Oh what fun I had with this as a kid!)
- Eternal Darkness (GC) (Controls and gameplay were not too good, but the story IS interesting...)
- Ace Combat 5 (PS2) (Fun as heck to play, probably not too entertaining to watch)
- Jak & Daxter 1-3 (PS2) (A lot to play, and the games are funny, but the voice acting is too good to ruin by me muttering over it)
- Quake 2 (PSX) (THE retro FPS for the PSX, never was too good at it, though, which might actually make it more entertaining)
- Soul Reaver (PSX) (I've only ever played the demo, now that I think about it...)
- Deathtrap Dungeon (PSX) (I've never even heard of this one before... hmmmmm...)
- Resident Evil 4 (GC) ("Leeeoooon, Heeeeeeeelp!" This game makes the comedy appear without any assistance!)

I would love to do fighting force, but I really think it is best with 2 or more players, and none of my available friends speak adequate english to make the video not hurt people's ears. Finnish accent is not a pretty thing most of the time...
#2434
Critics' Lounge / Re: A really small walkcycle
Wed 09/03/2011 07:21:11
I was afraid the helmet would be a bit unclear on direction. I lightened the colours a little bit to bring out the blues, and added a lighter patch to the frontal section of the helmet to make it a bit easier to see where he is facing. I'm aiming to make a tile-based game where the tiles are just 15x15px, so making the characters and environments more angled would, in my opinion, just make a few outlines thicker. I don't want to goo too angled, because then it would just look silly.



Improvement?

As soon as this basic walkcycle is approved, I'll do variations with different weaponry, as well as some shooting etc animations.
#2435
Critics' Lounge / Re: Pancake day
Tue 08/03/2011 15:57:51
I got a sudden craving for pancakes...
#2436
A very small down walkcycle for a top-down 15x15 tile based game I'm starting work on.

With helmet (2x original size)


Wothout helmet (2x original size)


Tear me a new one, people!
#2437
Moresco: you do have a point. I've just had abominable luck with PC gaming of late and as such I am, at least for a while, concentrating on console games. Also, I already got myself a video capturing device just for this, so...
#2438
Sorry but no. I'm specifically targeting games for the consoles and avoiding PC games due to their instability. I think my attempts at making let's play videos on the PC are cursed...
#2439
I'm planning on making some of those highly popular newfangled "Let's Play" videos on youtube.
The idea is to play a game, record it and comment it while I play. I already tried once on Ultima IX for the PC (http://www.youtube.com/user/whamtheman#g/c/5CF5058A90C49591), but my PC disagreed and promptly disassembled itself into its base components, and corrupted my save files in the process.

Now I am planning to try with a more reliable setup, ie. console games. Namely the PS1 and PS2, and perhaps GameCube.

What I need: suggestions on good games to play!

Must be single player, can be any genre, as long as it isn't too boring to watch (ie. no formula 1 games or the like, it gets dull after a while)
Preferrably some fairly short games to start off with, so no Final Fantasy games, thank you. =)

Speak up and be heard! Whoever has the best idea that I use to make a video gets mentioned in the video and thus earns unlimited internet fame!
#2440
First: http://dagobah.net/flash/miyamoto.swf

Second: http://dagobah.net/flash/Caramelldansen_mix.swf

That is all!

OH! Also: congratulations to Pinback as well! Great competition!
SMF spam blocked by CleanTalk