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

Topics - johnny1finger

#1
I'm needing to create a walk path for NPC that theoretically needs to span across 8 rooms.  Would it be possible to do this globally or would I have to code each path in each room?  For the coding, am I on the right track by using:
Code: AGS
cChar1.Walk (100,100, eNoBlock); //start him walking
    cChar1A.AddWayPoint(230, 150); //add some more waypoints to his path
    cChar1.AddWayPoint(20, 120);


Thanks!
-j
#2
This may be a quick yes or no answer, but now with my NPCs moving simultaneously, I need to have them continue to move while Room messages are displayed.  Is there a way to do this??

Here's the code I'm using: (thanks Khris):

Code: AGS
// room script file
function room_Load()
{
  mouse.UseModeGraphic(eModeWait);
  mouse.SetPosition(312, 192);
  //mouse.UseDefaultGraphic();
}

function room_AfterFadeIn()
{
  SetTimer(1, 400);
}

int delay;
     
function room_RepExec()
{
  if (!cAerialGirl1.Moving && delay) //only check if the NPC isn't moving
  {
    if (cAerialGirl1.y == 136) cAerialGirl1.Walk(203, 149, eNoBlock, eAnywhere);
    else if (cAerialGirl1.y == 149) cAerialGirl1.Walk(204, 136, eNoBlock, eAnywhere);
    delay = 0;
  }
    else if (!delay) delay = 1;
  
  if (!cAerialGirl2.Moving && delay) //only check if the NPC isn't moving
  {
    if (cAerialGirl2.x == 237) cAerialGirl2.Walk(170, 142, eNoBlock, eAnywhere);
    else if (cAerialGirl2.x == 170) cAerialGirl2.Walk(237, 147, eNoBlock, eAnywhere);
    delay = 0;
  }
    else if (!delay) delay = 1;

  if (!cAerialGirl3.Moving && delay) //only check if the NPC isn't moving
  {
    if (cAerialGirl3.x == 303) cAerialGirl3.Walk(235, 144, eNoBlock, eAnywhere);
    else if (cAerialGirl3.x == 235) cAerialGirl3.Walk(303, 135, eNoBlock, eAnywhere);
    delay = 0;
  }
    else if (!delay) delay = 1;
    
  if (IsTimerExpired(1))
  {
    DisplayMessageAtY(0, 20);
    DisplayMessageAtY(1, 20);
    DisplayMessageAtY(2, 20);
    DisplayMessageAtY(3, 20);
    cEGO.ChangeRoom(1, 229, 156);
  }
}


Everything works that in the code, however I would like for the NPC movement to continue while the messages were displayed.  I've searched for a eNoBlock type of condition to put on a textbox/message and can not find anything.

Thanks!
-j
#3
I'm needing to have 3 characters (or objects) walk/move on the screen at the same time.  I say either, because it doesn't matter to me which they are for this scene.  I have tried tackling it with timers, regions, hotspots, however nothing yields a successful result.  I've tried numerous blocking style arrangements, but I either get 1 moving and the other 2 not moving or I get all 3 moving to one location, then nothing.

For the scene, I have 3 characters/objects that each have their own separate 2 locations (walking points).  I need each to walk continuously back and forth between point A & B.

I think I'm on the right track with this code, but I seem to be missing something.  This is for one of the 3 (cAerialGirl1), which I'm assuming if I get it working, I can replicate it across the other 2 characters (cAerialGirl2 & 3).

Code: AGS

function room_RepExec()
{
  int characterLocation;
  if (!cAerialGirl1.Moving) //only check if the NPC isn't moving
  {
    if (characterLocation==1)
    {
      cAerialGirl1.Walk(203, 149, eNoBlock, eAnywhere);
      characterLocation=2;
    }
    else
    if (characterLocation==2)
    {
      cAerialGirl1.Walk(204, 136, eNoBlock, eAnywhere);
      characterLocation=1;
    }
  }
}


Again, I apologize if it's something simple.  Integers are not my strong suit yet and I'm learning as I go.  I've searched high and low in the manual, wiki and forums and the search has turned up nothing.  I may not be using the correct search criteria, but in any case, I'm stumped.  Thanks in advance for the help....AGAIN!!  :P
-j
#4
Not sure where to start, but I'm needing a way to make characters change rooms and be positioned to a relative coordinate from the previous room.  (for example:  When cEGO is leaving the right edge of Room #1 at (317, 125), cEGO should appear at (3, 125) and so on...  I'm guessing I need to define this in the globalscript, since I need this for any/all rooms.  I'm familiar with the basic cEGO.ChangeRoom and cEGO.ChangeRoomAutoPosition commands, but I'm guessing that there's an easier way to do this than to have up to 200 cEGO.ChangeRoom.(#,x,y) commands...

I would assume that this has been implemented in other projects, however my searches are not producing anything helpful.  I'm 99% sure I'm not using the right criteria to find it, so if anyone could at least point me in the right direction, I would appreciate it.

Thanks in advance!!
-j
#5
Here's what I'm trying to achieve:
My game starts with cEGO sitting in a chair.  Once the game starts, the player can either interact (HAND or EYE) an object on the table next to the chair or use WALK to stand up and move freely around the room.  While cEGO is sitting, there is an animated view that shows cEGO reaching out to the table next to the chair that he's in.

Here are the problems that I am running into:
Starting out with cEGO sitting:
Code for room_load:
Code: AGS
function room_load()
{
cEGO.LockViewFrame(17, 0, 0);
}

Currently, cEGO is sitting when the game starts, however if I use the WALK cursor anywhere else in the room, the view (17) is used as cEGO moves around the room (the game crashes once loop 0 completes, since its not a standard 4 loop view for walking.  Once cEGO starts moving using the sitting view, the wait cursor is displayed and nothing else can be done.  I have found that if I unlock the view under the function room_AfterFadeIn, cEGO will stand on his own and then everything works (WALK, etc...).  I'm using:
Code: AGS
function room_AfterFadeIn
{
cEGO.UnlockView();
}


Wasn't sure if I need to use IdleView here, since an animation plays while cEGO is sitting.  Also, I thought about using a hotspot for the entire room to make cEGO stand when the WALK cursor was used, but I read in the manual or wiki that the "any click on hotspot" was for anything EXCEPT the walk icon...so I'm stuck at what I need to do from here on this piece.

Next issue is the animation while cEGO is sitting.  cEGO "shifts" when the frame is played with his arm outstretched.  The view that I'm using is 5 frames.  Using the Preview option on the view animates it correctly (no shift), however if I check the Character View (centre pivot) option, the "shift" is there.  I have tried using cEGO.LockViewAligned with all 3 alignments with no luck.

In my game's current state, I am doing everything from the room script.  I have not attempted and global scripts and/or variables.  I'm not opposed to them, it's just not a topic that I've attempted yet... I am not an experienced programmer by any definition (which I'm sure is apparent).  Everything that I have has been a self discovery process using the forums/wiki/manual.  Please accept my apologies ahead of time if I'm unclear with my explanations.

Thanks in advance for any help/advice!

-j
SMF spam blocked by CleanTalk