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 - Hobo Joe

#1
There is a line in the Line_Display script that says

if (!IsTimerExpired(TIMER))

Would that do it?

EDIT: Yep. I'm an idiot.
#2
The buffer exploded because the function hHotspot5_WalkOn() was firing repeatedly for some reason. I changed it so the character disappears and an object animates there instead and that fixed it. All good now. Thanks!
#3
Yeah, sorry. The whole script looks like this (except the ACTUAL string, as I don't want you to know what that says... I'm being secretive.)

Code: ags
function hHotspot7_WalkOn()
{
cEgo.StopMoving ();
DisableInterface();
cEgo.SetWalkSpeed (8, 8);
cEgo.Walk (189, 128, eBlock, eAnywhere);
StopAmbientSound(1);
PlayAmbientSound(1, 2, 255, 0, 0);
cEgo.StopMoving ();
cEgo.Transparency = 100;
cEgo.x = 200;
cEgo.y = 200;
SetWalkBehindBase(3, 200);
SetWalkBehindBase(1, 200);
object[0].Visible = true;
object[0].SetView(2);
object[0].Animate(0, 4, eRepeat, eNoBlock, eForwards);
SetTimer(1, 80);
DisplayLD("I'm hiding the text because I'm a jerk");
}


and

Code: ags
function room_RepExec()
{
bool found;
  int x,y;
  if (!cChar.Moving) {
    while(!found) {
      x = Random(Room.Width);
      y = Random(Room.Height);
      if (Region.GetAtRoomXY(x, y) == region[1]) found = true;
    }
    cChar.Walk(x, y);
  }
  
if (IsTimerExpired(1) == 1){
  object[0].Visible = false;
}
if (IsTimerExpired(2) ==1){
PlayAmbientSound (1, 1, 255, 0, 0);
}
}


The second timer (to start the ambient sound after loading) works fine. It's the first one that doesn't make the object disappear.

EDIT: Also, for reference, DisplayLD is calling a script module Khris made for me to make a specific kind of scrolling, non-blocking text.
#4
Where can I find/put repeatedly_execute_always?
#5
Just one more thing: Is there a way I can make it so the text disappears when you walk off the screen?

EDIT: Crap. I've hit a snag. I got an "Increase buffer size" error. It's weird though, I have 2 identical scripts set up in 2 different rooms, it works fine in the first and then gives me that error in the second one. I'll keep looking at it to see what's wrong, but help on that would be appreciated also.
#6
Here's my scripts (both in same room):

function hHotspot5_WalkOn()
{
cEgo.StopMoving ();
DisableInterface();
cEgo.SetWalkSpeed (8, 8);
cEgo.WalkStraight (cEgo.x, 170, eBlock);
StopAmbientSound(1);
PlayAmbientSound(1, 2, 255, 0, 0);
cEgo.ChangeView(2);
cEgo.Animate(0, 4, eRepeat, eNoBlock);
SetTimer(3, 80);

and

function room_RepExec()
{
if (IsTimerExpired(3) == 1){
  cEgo.Transparency = 100;
  object[0].Visible = false;
}
}

Problem is that the character and the object don't disappear. What gives?
#7
That is absolutely and utterly perfect. You are my hero. Thank you so much!
#8
Okay. I'll fiddle around. I can get a listbox to display, but not much else. I'm not really clear on how arrays work and I don't know what an echo command is either. Sorry!
#9
Oh, sorry, forgot to mention: I'm not going to be using a parser. It's point and click. Just want the text to DISPLAY like that. Sorry again for not being more specific.
#10
I don't know how best to explain what I want, so I made a video to show you.

http://www.youtube.com/watch?v=jfOxpOrbP0I

Looking for text in a game that can function like it does in the old KQ. Any help would be much appreciated.
#11
Thanks Khris. Worked perfectly.
#12
I'm trying to get a character to move around at random, but I only want him to move around within a certain area/set of coordinates. How would I go about doing this?
#13
Looking over it, I'm not sure enum is what I need. I need to keep track of a number of hidden statistics and then use them as a basis for what the "AI" will do. I'll keep working on it.
#14
Hey, that's great. I can expand off that and hopefully figure out how to incorporate it doing things that aren't completely random. I'm trying to set him up so he has a bunch of needs to fulfill, sort of a semi AIish thing, and chooses what to do based on his stats. This is a huge help. Thank you very much!
#15
Yeah. I figured it out by, shockingly enough, checking the help file and then paying attention. Sorry. I'm good on that now. Now I just have to figure out what ELSE I'm doing wrong.
#16
I fixed the whole thing. It all sets up properly, but now I have this problem:

function repeatedly_execute() {
  // put anything you want to happen every game cycle here

  if (hungry > pee){
    cEgo.Walk(74, 199, eBlock, eWalkableAreas);
    cEgo.FaceLocation(74, 160, eBlock);
  }
  else if (pee > hungry){
    cEgo.Walk(301, 199, eBlock, eWalkableAreas);
  }
 
}


I want it to be eNoBlock, but that just makes him twitch in place. The problem is that I want this all to happen sort of randomly. I'm trying to set up a series of statistics that the guy will act on, on his own, but the problem is that other than putting it in repeatedly_execute, I don't know how to do this, so he just tries to do it endlessly.

Is there a way to make it check the stats, decide an action, do it, then check again when he's done and so forth?
#17
Okay. So. I've changed the global int crap to setgraphical variable, downloaded the latest version of AGS and set up the global variables as "int" with their names and a value of 0 each. Now I get an error with this:

  SetGraphicalVariable ("thappy", Random(10));

the error is -

Error: SetGraphicalVariable: interaction variable 'thappy' not found

What did I do wrong NOW? ???
#18
I guess that's my problem, then. I have 3.0.1. Time to upgrade!
#19
I'm trying to do this:

function repeatedly_execute() {
  // put anything you want to happen every game cycle here

  if (GetGlobalInt (hungry)> GetGlobalInt (pee)){
    cEgo.Walk(74, 199, eNoBlock, eWalkableAreas);
    cEgo.FaceLocation(74, 160, eNoBlock);
  }
  else if (GetGlobalInt (pee)> GetGlobalInt (hungry)){
    cEgo.Walk(301, 199, eNoBlock, eWalkableAreas);
  }
 
}

So he'll walk one way if his "hungry" int is greater than blah blah yeah you get it. The problem is, I've set up the ints and what they do in the game start section, and the repeatedly execute here gives me a script error telling me that those ints don't exist. How do I fix this?

Also, how can I make an int that counts up slowly over time?
#20
Okay, new problemish thing. Here's my script: (it's kind of long)

  int thappy;
  int tsad;
  int tangry;
  SetGlobalInt (thappy, Random(10));
  SetGlobalInt (tsad, Random(10));
  SetGlobalInt (tangry, Random(10));
  if (GetGlobalInt (thappy) <=5 && GetGlobalInt(tsad)<=5){
  SetGlobalInt (tangry, Random(5)+5);
  }
  if (GetGlobalInt (tsad) <=5 && GetGlobalInt(tangry)<=5){
  SetGlobalInt (thappy, Random(5)+5);
  }
  if (GetGlobalInt (tangry) <=5 && GetGlobalInt(thappy)<=5){
  SetGlobalInt (tsad, Random(5)+5);
  }
  if (GetGlobalInt (tangry) ==0){
  SetGlobalInt (tangry, Random(10));
  }
  if (GetGlobalInt (thappy) ==0){
  SetGlobalInt (thappy, Random(10));
  }
  if (GetGlobalInt (tsad) ==0){
  SetGlobalInt (tsad, Random(10));
  }
 
    if (GetGlobalInt (thappy)==1){
  Display("Happiness equals one.");
  }
  if (GetGlobalInt (thappy)==2){
  Display("Happiness equals two.");
  }
  if (GetGlobalInt (thappy)==3){
  Display("Happiness equals three.");
  }
  if (GetGlobalInt (thappy)==4){
  Display("Happiness equals four.");
  }
  if (GetGlobalInt (thappy)==5){
  Display("Happiness equals five.");
  }
  if (GetGlobalInt (thappy)==6){
  Display("Happiness equals six.");
  }
  if (GetGlobalInt (thappy)==7){
  Display("Happiness equals seven.");
  }
  if (GetGlobalInt (thappy)==8){
  Display("Happiness equals eight.");
  }
  if (GetGlobalInt (thappy)==9){
  Display("Happiness equals nine.");
  }
  if (GetGlobalInt (thappy)==10){
  Display("Happiness equals ten.");
  }
 
  if (GetGlobalInt (tsad)==1){
  Display("Sadness equals one.");
  }
  if (GetGlobalInt (tsad)==2){
  Display("Sadness equals two.");
  }
  if (GetGlobalInt (tsad)==3){
  Display("Sadness equals three.");
  }
  if (GetGlobalInt (tsad)==4){
  Display("Sadness equals four.");
  }
  if (GetGlobalInt (tsad)==5){
  Display("Sadness equals five.");
  }
  if (GetGlobalInt (tsad)==6){
  Display("Sadness equals six.");
  }
  if (GetGlobalInt (tsad)==7){
  Display("Sadness equals seven.");
  }
  if (GetGlobalInt (tsad)==8){
  Display("Sadness equals eight.");
  }
  if (GetGlobalInt (tsad)==9){
  Display("Sadness equals nine.");
  }
  if (GetGlobalInt (tsad)==10){
  Display("Sadness equals ten.");
  }


The problem is that every time both numbers are the same. If "Happiness" is 10, so is sadness, and so forth. What am I doing wrong?
SMF spam blocked by CleanTalk