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 - MiteWiseacreLives!

#581
That's kinda crazy, if you move on an angle it goes straight to target ??? maybe there is some reason for this (more interesting character paths?.. naw that's not it). Here's what I came up with to slide some blocks around a room that will move 60 pixels in a straight line unless something stops them, if then a little sparkle animation at point of impact. I removed the GUI part and the 'pushing' animations, so hopefully I didn't delete any crucial variables, but at least it can give some others ideas for a work-around.
(feel free to clean it up or let me know if I am going way beyond what is necessary... :) )

Code: ags

int spriteEdgeX;
int spriteEdgeY;
int roller;
int limit; 
int start;
bool obstruction;
Object *objStrike;
Object *objSlide;

void boink()    // Call this if object strikes something, will bring a 16x16 character named cBoink to the point of impact and animate
  {
  if (spriteEdgeX < 0) spriteEdgeX = 1;         // and keep it on the screen
  if (spriteEdgeY < 0) spriteEdgeY = 1;
  if (spriteEdgeX > 640) spriteEdgeX = 640;
  if (spriteEdgeY > 480) spriteEdgeY = 480;
  cBoink.ChangeRoom(player.Room, (spriteEdgeX + GetViewportX()), (spriteEdgeY + GetViewportY()) + 8);
  cBoink.Transparency = 20;
  cBoink.Animate(0, 3, eOnce, eBlock);
  cBoink.Transparency = 100;

  obstruction = true;
  }
  
bool checkStrikeY()        // runs along the Y-Axis of the sprite checking for obstructions
  {
    while (spriteEdgeY != limit)
      {     
        if (GetWalkableAreaAt(spriteEdgeX, spriteEdgeY))  // is it walkable?
          {
          if (Object.GetAtScreenXY(spriteEdgeX, spriteEdgeY) != null) // is there an object?
            {
            objStrike = Object.GetAtScreenXY(spriteEdgeX, spriteEdgeY); 
              if (objStrike.Solid)                      // it the object solid?
                {                
                boink();  // call the Boink function and set obstruction to true.
                spriteEdgeY = limit;            
                }
              
              else  {
                obstruction = false;   // nothing in the way!
                spriteEdgeY --;               
                }            
            }
          else
            {
            obstruction = false;   // nothing in the way!
            spriteEdgeY --;              
            }
          }
        else  {
          //  the pixel is not walkable, so call boink
          boink();
          spriteEdgeY = limit;           
          }
      }
      
    spriteEdgeY = start;        
  }
  
bool checkStrikeX()        // runs along the X-Axis of the sprite checking for obstructions
  {
    while (spriteEdgeX != limit)
      {
        if (GetWalkableAreaAt(spriteEdgeX, spriteEdgeY))  
          {
            if (Object.GetAtScreenXY(spriteEdgeX, spriteEdgeY) != null) 
              {
              objStrike = Object.GetAtScreenXY(spriteEdgeX, spriteEdgeY);
              if (objStrike.Solid && objStrike != objSlide)   
                {
                boink();     // there is an object there and it is solid!        
                spriteEdgeX = limit;              
                }
              
              else  {
                obstruction = false;
                spriteEdgeX ++;   // nothing in the way!
                } 
            }
          else  {
            obstruction = false;
            spriteEdgeX ++;   // nothing in the way!
            }             
          }
        else  {
          boink();          
          spriteEdgeX = limit;
          }
      }
    
    spriteEdgeX = start;
  }


  
function PushAnimate(int Way, int ObjPush)  
  {
    roller = 0;
    objSlide = object[objPush];
    
    int pushX = objSlide.X;
    int pushY = objSlide.Y;
    
    if (Way == 1) { // Left
      spriteEdgeY = (pushY - 1) - GetViewportY();  // Bottom edge
      start = spriteEdgeY;
      limit = (pushY - GetViewportY()) - (Game.SpriteHeight[objSlide.Graphic]/2) + 1; //Isometric Top edge
      
    }
    else if (Way == 2)  { // Up
      spriteEdgeX = (pushX - GetViewportX()) + 1; // Left edge
      start = spriteEdgeX;
      limit = ((pushX - GetViewportX()) + Game.SpriteWidth[objSlide.Graphic]) - 2; //Right edge     
      
    }
    else if (Way == 3) { //Right
      spriteEdgeY = (pushY - 1) - GetViewportY(); // Bottom edge
      start = spriteEdgeY;
      limit = (pushY - GetViewportY()) - (Game.SpriteHeight[objSlide.Graphic]/2) + 1; //Isometric Top edge
      
    }
    else if (Way == 4) { //Down
      spriteEdgeX = (pushX - GetViewportX()) + 1; // Left edge
      start = spriteEdgeX;
      limit = ((pushX - GetViewportX()) + Game.SpriteWidth[objSlide.Graphic]) - 2; //Right edge       
      
    }
    
    while (roller != 21)
        {
        
        if (Way == 1)  {  //Left 
          pushX -= 3;          
          spriteEdgeX = pushX - GetViewportX(); // Left edge
          checkStrikeY();
          }          
        else if (Way == 2)  {  //up
          pushY -= 3;        
          spriteEdgeY = (pushY - GetViewportY()) - (Game.SpriteHeight[objSlide.Graphic]/2); //Isometric Top edge
          checkStrikeX();
          }
        else if (Way == 3) {  //Right
          pushX += 3;
          spriteEdgeX = (pushX - GetViewportX()) + Game.SpriteWidth[objSlide.Graphic]; //Right edge          
          checkStrikeY();
          }            
            
        else if (Way == 4)  {  //Down
          pushY += 3;          
          spriteEdgeY = pushY - GetViewportY();  // Bottom edge
          checkStrikeX();         
          }       
        
        if (!obstruction)
          {
          objSlide.SetPosition(pushX, pushY);
          roller ++;          // If nothing in the way, advance the object.        
          }
        else 
          roller = 21;
          
        Wait(1);
        }    
  }
#582
I want full screen everytime, unless I don't really care and want to do something else at the same time.
#583
Quote from: OneDollar on Sun 29/09/2013 21:26:57
I don't know, but I'm guessing Monkey Island 1's backgrounds were originally pixeled on a computer, and trying to make them semi-photo realistic didn't fit.

I do know that the original game was drawn in Deluxe Paint, and as for the remakes, I was just happy to see them in the mainstream :) and I wanted to support an adventure game come back (I probably didn't know how much awesome free stuff was available through AGS then). Honestly though i didn't actually get through the either game completely.. did so about a hundred times back in the day.
#584
What!? Edits don't bump!!11!!!1 :)
Anyhow, the presentation is really cool. I think all the people on this forum who are smarter than me should watch the presentation by Oliver.. so that makes every AGS'er, right? Some pretty cool Android stuff some would find interesting (Monkey_90_91 are you out there?).
#585
Quote from: DBoyWheeler on Sat 28/09/2013 14:42:30
I just like drawing balancing acts or asking for them drawn.
Oh Dear (roll)
I think there might be a little more to it than that, DBoy...
#586
Are those Tattoos or Branding on those poor abused creatures?? naw I'm kidding... branding isn't cruel.
#587
SpeechAnimationTimeout ?
#588
Its because of the way I am caling the function, probably convoluted..
Code: ags

PushAnimate(1, object[objPush].X, object[objPush].Y); 
...
function PushAnimate(int Way, int WhatX, int WhatY)  

The object 75% of the time will move straight, the other times it likes to move in large U shapes, some times move several pixels away from the destination (if the walkable area is tight and usually to the left or right). I am moving these things around rooms with corners etc, the walkables are not all perpendicular lines, often curved.
I've found that making my own movement function is actually easier than deciphering the pathfinding voodoo. But the coding is more complex, trying to do it right with pointers this time.
Maybe you can have a look at what I've done, if it can be cleaned up the next person with this issue might find it useful.
Code: ags

function PushAnimate(int Way)  
  {
    roller = 0;
    Object *objSlide = object[objPush];
    Object *objStrike;
    int pushX = objSlide.X;
    int pushY = objSlide.Y;

    while (roller != 21)
        {
        
        if (Way == 1)  {  //Left 
          pushX -= 3;          
          spriteEdgeX = pushX - GetViewportX(); // Left edge
          spriteEdgeY = pushY - GetViewportY();  // Bottom edge
          }          
        else if (Way == 2)  {  //up
          pushY -= 3;        
          spriteEdgeX = pushX - GetViewportX(); // Left edge
          spriteEdgeY = (pushY - GetViewportY()) - (Game.SpriteHeight[objSlide.Graphic]/2); //Isometric Top edge
          }
        else if (Way == 3) {  //Right
          pushX += 3;
          spriteEdgeX = (pushX - GetViewportX()) + Game.SpriteWidth[objSlide.Graphic]; //Right edge
          spriteEdgeY = pushY - GetViewportY();  // Bottom edge
          }  
        else if (Way == 4)  {  //Down
          pushY += 3;
          spriteEdgeX = pushX - GetViewportX(); // Left edge
          spriteEdgeY = pushY - GetViewportY();  // Bottom edge
          }
          
        if (GetWalkableAreaAt(spriteEdgeX, spriteEdgeY))  
        // create something to scan across entire side for an object and use  are-objects-colliding...
          {
          if (Object.GetAtScreenXY(spriteEdgeX, spriteEdgeY) != null) {
            objStrike = Object.GetAtScreenXY(spriteEdgeX, spriteEdgeY);
            if (objStrike.Solid)    boink();               
            }
          else  {
            objSlide.SetPosition(pushX, pushY);
            roller ++;
            }            
          }
        else  
          boink();
          
        Wait(1);
        }    
  cEgo.UnlockView();
  hunger -= 3;
  }

I want to next make a little loop to scan across the entire leading side of the sprite for a solid object etc... just worried it might be too many loops per game-cycle or something... any help appreciated :)

Edit:
here's the other thread I referenced earlier,
http://www.adventuregamestudio.co.uk/forums/index.php?topic=48529.msg636462401#msg636462401

* So I've built a function that I am pretty happy with, it scans along the leading edge of the object for anything solid or un-walkable then moves the object, and repeat... I doesn't get messed up in tight spaces like the built in pathfinding, it just goes strait until it can't anymore (nor does it suffer slow-down, I underestimate computers). I would post it but there doesn't seem to be alot of interest in this topic :( , I searched like crazy for some answers when my objects moved like drunk sailors when they have no apparent reason to do so!
#589
Hey guys!
It was recently brought up by Bilbis too from a editor dev. angle though..
I am trying to effectively use the pushing of objects and blocks around in a game for use in puzzles, sorta like Zelda.
I am pulling my hair out trying to isolate why the object does not travel in a straight path. Ex.
Code: ags

object[objPush].Move(WhatX + 60, WhatY, 4, eBlock, eWalkableAreas); 

Played with the walkable areas, baselines, blocking heights, location of my character.. I cannot make sense of it at all.
Found some clues on the forum which make me think perhaps it's because I have to figure out where, on the 3x3 grid AGS uses for pathfinding, I have to align my objects... or maybe it is trying to avoid walkbehinds???

1) Any insight into the behavior of the pathfinding that will help me to cooperate *with* it?
2) Should I create my own a loop using "object.SetPosition" in one pixel increments, and checking for walkable space each loop? (will that work any  better?)
#590
Jack Black will be voicing a small part, if you haven't already heard. Along with some other people I don't recognise, but they tell me they are almost-famous.
*Edit: I know most will be busy listening to the new Blue Cup Tools Podcast, but there's a new video on Broken Age. 40min presentation on multi-platform programming stuff at the Europe GDC.. Going to go watch it now.
#591
Quote from: Khris on Tue 24/09/2013 02:28:30
The world as I'd love to see it:

[imgzoom]http://i208.photobucket.com/albums/bb259/khrismuc/Pixelart/CB_Adeel_zps5f70981e.png[/imgzoom]
Maybe you should check out the Mars One mission... But if you go who will patch our code?? :(
#592
Site & Forum Reports / Re: Bug reports
Mon 23/09/2013 23:56:48
Its a little confusing posting the screen shots. it seems as if you can list three separated by a semicolon?? maybe.. but it doesn't seem to work, seemed to be happening to others as well. Is there a way to list multiple shots or was it only ever made for one?
#593
I've got to say, I am really enjoying following this whole thing. I would have been on board with this one anyway, but the 2PP documentary is so worth the price of admission. The whole thing is a bit of a zoo I suppose, I think that's what you get when a studio like this is suddenly thrown into being expected to make the greatest adventure game ever with technology 15yrs ahead of the genre. I understand what people seem to be saying lately about keeping modern games short, but I really hope to be able to meander around the game world for many hours :)
#594
This works really nicely, just download and play! no jail-breaking or work-arounds, just clicking. How much work is it to package a game up like this? I assume your building some kind of compiler? or is each game it's own process?
#595
The Rumpus Room / Re: *Guess the Movie Title*
Wed 18/09/2013 06:31:24
Hard Times 2: This is Not a Banana in Charles Bronson's Pocket
#596
I'm on Gingerbread with a v2.3.5.. am I of any help?
#597
Alright Rapstar 1.5, let's give this a go... (sheesh a non-adventure game (roll) ).

edit: Oh  wow, I don't think that was a proper game, uh-huh.. yeah!
Rapstar 1.5 is a turn-based rap-battle game, your opponent will rap some combination of uh-huh, yeah, come-on.. then you do the same, someone loses HP then you do it again.. I still prefer the OSD battle engine.
There is clearly some indeterminable mechanic underneath the combat, but it is fairly un-engaging. Funny little idea, but I kinda hoped for something that would hold my attention past three rounds.
May I have another spin?
#598
It looks like your While statement is missing a closing brace } , also Wait(100) is a pretty long pause for a 160 cycle loop... 2 1/2 seconds * 160?
#599
The Rumpus Room / Re: Icey games' thread
Mon 09/09/2013 08:46:08
You can restrict mouse movements to a box, or declare certain hotspots clickable false (check some global variables when the map room loads...). I'm sure you already know this though. I think it would be best to have some heavy mist so you can make out the land masses, but give some kind of "wrong-buzzer" noise when you try to click some area not opened yet.
#600
The Rumpus Room / Re: *Guess the Movie Title*
Mon 09/09/2013 08:37:09
Hamlet II: The Banditos and the King.
SMF spam blocked by CleanTalk