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

#1
That was it! That fixed it! Thank you very, very much! :smiley::smiley::smiley::smiley::smiley::smiley:
#2
Here's the bulk of it. The People struct creates a bunch of random people, and then later calls on them. With the Fools struct, I'm trying to get it to correspond with each of the five characters, but it only keeps track of the last one called in the People struct.

Code: ags
int CallSuspect;
String FirstName[520];
String LastName[260];

struct People{
    bool Active;
    int Formality;
    int Manners;
    int Forgetfullness;
    int Firstly;
    int Middly;
    int Lastly;
    int Beard;
    int Hair;
    int PersonView;
    int Race;
  };
  
struct Placement{
  int MumX;
  int MumY;
  bool Active;
  int Dummy;
};

Placement Fools[5];
People Suspects[1000];

function MakePlacements(){
      Fools[0].MumX = 120;
    Fools[0].MumY = 120;
    Fools[0].Active = true;
    Fools[1].MumX = 140;
    Fools[1].MumY = 120;
    Fools[1].Active = true;
    Fools[2].MumX = 160;
    Fools[2].MumY = 120;
    Fools[2].Active = true;
    Fools[3].MumX = 180;
    Fools[3].MumY = 120;
    Fools[3].Active = true;
    Fools[4].MumX = 200;
    Fools[4].MumY = 120;
    Fools[4].Active = true;
    
  
}


function MakeSuspects(){
  int Countit = 999;
  while (Countit >= 0){
    int ViewCount = 0;
    Suspects[Countit].Active = true;
    Suspects[Countit].Formality = Random(2);
    Suspects[Countit].Manners = Random(2);
    Suspects[Countit].Forgetfullness = Random(2);
    Suspects[Countit].Firstly = Random(519);
    Suspects[Countit].Middly = Random(519);
    Suspects[Countit].Lastly = Random(259);
    Suspects[Countit].Beard = Random(1);
    Suspects[Countit].Hair = Random(1);
    if (Suspects[Countit].Beard == 0){
        ViewCount += 7;
    }
    if (Suspects[Countit].Hair == 0){
      ViewCount += 14;
    }
    Suspects[Countit].Race = Random(3);
    if (Suspects[Countit].Race == 1){
      ViewCount += 28;
    }
    else if (Suspects[Countit].Race == 2){
      ViewCount += 56;
    }
    else if (Suspects[Countit].Race == 3){
      ViewCount += 84;
    }
    
    Suspects[Countit].PersonView = (Random(6)+1) + ViewCount;
    Countit --;
    
  }
      
  }

function RandomName(int Pack){
  CallSuspect = Random(999);
  Fools[Pack-1].Dummy = CallSuspect;
character[Pack].ChangeView(Suspects[Fools[Pack-1].Dummy].PersonView);
Display("Number is %d",Fools[0].Dummy);
Display("Number is %d",Fools[1].Dummy);
Display("Number is %d",Fools[2].Dummy);
Display("Number is %d",Fools[3].Dummy);
Display("Number is %d",Fools[4].Dummy);
}

function Talkie(int Pick){
  if (Suspects[Fools[Pick-1].Dummy].Manners == 2){
    character[Pick].Say("It's a pleasure to meet you.");
   character[Pick].Say("My name is %s %s. %s", FirstName[Suspects[Fools[Pick-1].Dummy].Firstly], FirstName[Suspects[Fools[Pick-1].Dummy].Middly].Truncate(1), LastName[Suspects[Fools[Pick-1].Dummy].Lastly]);
  character[Pick].Say("My middle initial stands for %s", FirstName[Suspects[Fools[Pick-1].Dummy].Middly]);

}
  else if (Suspects[Fools[Pick-1].Dummy].Manners == 1){
    int Greet = Random(1);
    character[Pick].Say("Hello.");
    if (Greet == 0){
    character[Pick].Say("I'm %s %s.", FirstName[Suspects[CallSuspect].Firstly], LastName[Suspects[CallSuspect].Lastly]);
    }
    else{
    if (FirstName[Suspects[Fools[Pick-1].Dummy].Firstly].Length > 5){
    character[Pick].Say("I'm %s %s.", FirstName[Suspects[Fools[Pick-1].Dummy].Firstly].Truncate((FirstName[Suspects[Fools[Pick-1].Dummy].Firstly].Length)/2), LastName[Suspects[Fools[Pick-1].Dummy].Lastly]);
    character[Pick].Say("%s's short for %s.", FirstName[Suspects[Fools[Pick-1].Dummy].Firstly].Truncate((FirstName[Suspects[Fools[Pick-1].Dummy].Firstly].Length)/2), FirstName[Suspects[Fools[Pick-1].Dummy].Firstly]);
    }
    else {
      character[Pick].Say("I'm %s %s.", FirstName[Suspects[Fools[Pick-1].Dummy].Firstly], LastName[Suspects[Fools[Pick-1].Dummy].Lastly]);
    }
    }
    
  }
   else{
    int Greet = Random(1);
    if (Greet == 0){
    character[Pick].Say("I'm %s.", FirstName[Suspects[Fools[Pick-1].Dummy].Firstly]); 
    }
    else{
    if (FirstName[Suspects[Fools[Pick-1].Dummy].Firstly].Length > 5){
    character[Pick].Say("I'm %s.", FirstName[Suspects[Fools[Pick-1].Dummy].Firstly].Truncate((FirstName[Suspects[Fools[Pick-1].Dummy].Firstly].Length)/2));
     }
    else{
    character[Pick].Say("I'm %s.", FirstName[Suspects[Fools[Pick-1].Dummy].Firstly]);
     }
   }
   }
  if (Suspects[CallSuspect].Beard == 0){
  character[Pick].Say("I have a beard.");
  }
  if (Suspects[CallSuspect].Hair == 0){
 character[Pick].Say("I have hair.");
  }

character[Pick].Walk(Fools[Pick-1].MumX, 140, eBlock, eAnywhere);
character[Pick].Walk(330, 140, eBlock, eAnywhere);
character[Pick].ChangeRoom(1, -10, 140);
RandomName(Pick);
character[Pick].Walk(Fools[Pick-1].MumX, 120, eBlock, eAnywhere);
}


#3
I've been working on a program that puts five people on the screen for a police line up. The people are randomly generated, so each time someone comes onto the screen, they have a different skin and name and other stats. The problem I've been having is that each of the characters follow the stats of the last character to enter the room. I've been fiddling with arrays to contain the information of each of the five characters, and everything appears that it should be working, but it's not. I looked around for some info on arrays and structs, but I'm coming up dry. If anyone can give me some insight, it would be greatly appreciated.
#4
So I've been working from your code and came up with this. I feel it should be working, but it stays stuck in a loop. I'm thinking it might be because X_Axis isn't a float, and so can't create a remainder. If that were the case, is there a way to turn it into a float that is also a number for an array?

Code: ags
// main global script file



bool Ready = false;
bool RoomLoc[];

export RoomLoc;

function MazeMake(){
  RoomLoc = new bool[X_Axis * Y_Axis];
  RoomLoc[X_Axis/Y_Axis] = true;
  RoomCount --;
  while (RoomCount > 0){
  int RoomCall = Random((X_Axis * Y_Axis)-1);
  if (RoomLoc[RoomCall] == false){
    if (RoomCall - X_Axis > 0){
       if (RoomLoc[RoomCall - X_Axis] == true){
         RoomLoc[RoomCall] = true;
         RoomCount --;
       }
    }
   else if (RoomCall + X_Axis < ((X_Axis * Y_Axis) - 1) ){
     if (RoomLoc[RoomCall + X_Axis] == true){
       RoomLoc[RoomCall] = true;
       RoomCount --;
     }
   }
   else if (RoomCall % X_Axis != 0){
     if (RoomLoc[RoomCall-1] == true){
       RoomLoc[RoomCall] = true;
       RoomCount --;
     }
   }
   else if ((RoomCall + 1) % X_Axis != 0){
     if (RoomLoc[RoomCall+1] == true){
       RoomLoc[RoomCall] = true;
       RoomCount --;
     }
   }
  }
  
  }
  while (Ready == false){
    int Startit = Random((X_Axis * Y_Axis)-1);
    if (RoomLoc[Startit] == true){
      StartingLocal = Startit;
      Ready = true;
    }
  }
  }
#5
So, I have a general idea of how this code should work in my head, but trying to figure out how to get it into code isn't working too well. I've been searching the forums a bit, and found this which talks about pretty much what I was thinking about. I just can't figure out how to get started. The main part I'm trying to figure out right now is getting a grid made that I can work with. I've tried using arrays, and I've messed a bit with structs, but the way I was doing that required a dynamic array within the struct, which is apparently a no-no. So if anyone has some helpful tricks, I'd greatly appreciate it.
#6
Thanks for the advice. This helped point me in the right direction and I think I've figured enough out to get where I need to go! :grin::grin::grin:
#7
I've been working on a project that might require procedural dungeons and was wondering if there was a tutorial or source code available to teach how to make something like that possible. I've been looking around and seeing a few games that utilize this, but can't find any how-to's on the matter. It won't be standard rogue-like ASCII style dungeon, but rather a more binding of isaac/room-by-room procedure. If you can shed any light on this, I'd very much appreciate it.
#8
Thanks for the positive input guys. I'm really happy you're enjoying it! I'll be adjusting a few aesthetics in the game, but ultimately the mechanics will go unchanged, as most of my time has been consumed with the next project which will feature similar designs but refined. Again, Pete was a side project to help me get better at AGS and with what I've learned from this game and all of your support, I think I can go further and bigger. And yeah, the thunderclap is a crit and the little "going" noise is a botch. And its true you can grind the first three goblins until you can afford stuff, however getting the final gear may take some time with that method. Also, if you haven't found the secret room yet, it's somewhere in town. Also, has anyone found the money on the ground. It appears in town sometimes when you start a new game. Again, thank you for enjoying the game. Look forward to more in the future. My resolution is to finish this new project, so hopefully I don't procrastinate as much as I did on this one, lol.
#9
Okeedoke. So I fixed the file so you can run winsetup by putting the original name back (4hg). I've been messing around with AGS for years off and on. It was only a matter of time before I finally finished something. The game itself was a side project to another game I was working on, and I just kept adding to it. It's not a big game. It'll take you an hour to beat the first time, but there's a few things in it that offer some replay value. I fixed the link in the first post too so it takes you directly to the game's page instead of the homepage (first time using Patreon). Everything else should be in order. Enjoy the game, guys!
#11


Pete embarks on a quest to save the princess fare in this RPG-lite adventure.

click here to play

#12
Okay, I'll fiddle around with the character properties and get back to you.
#13
I don't think so. I'm trying to call an integer that already exists, but from what I understand of pointers, is that pointers can't call an integer.
Code: ags
  function Tinak_Attack(int monster, [color=#ff0]int monsterhp[/color], int hitpoints){
  
  int ToHit = Random(19)+ cTinak.InventoryQuantity[iFourLeaf.ID];
  
  if (ToHit <=0){
  
  cTinak.Walk(175, 130, eBlock, eAnywhere);
  cTinak.ChangeView(2);
  cTinak.Animate(0, 3, eOnce, eBlock);
  cTinak.SayBackground("Miss");
  Status_Effects();
  cTinak.ChangeView(1);
  cTinak.Walk(100, 130, eBlock, eAnywhere);
  cTinak.FaceLocation(300, 130, eBlock);
  }
  
  if ((ToHit > 0) & (ToHit <19)){
  
  cTinak.Walk(175, 130, eBlock, eAnywhere);
  cTinak.ChangeView(2);
  cTinak.Animate(0, 3, eOnce, eBlock);
  character[monster].SayBackground("Ouch!");
  if (Destruction == false){
  [color=#ff0]monsterhp[/color] -= Damage;
  lblCash.Text = String.Format ("H:%d", BabyGullHP);
  }
  else if (Destruction == true){
    [color=#ff0]monsterhp[/color] -= 10;
    Destruction = false;
  }
  Status_Effects();
  Weapons_Check();
  cTinak.ChangeView(1);
  cTinak.Walk(100, 130, eBlock, eAnywhere);
  cTinak.FaceLocation(300, 130, eBlock);
  }
  
  if (ToHit >= 19){
  
  cTinak.Walk(175, 130, eBlock, eAnywhere);
  cTinak.ChangeView(2);
  cTinak.Animate(0, 3, eOnce, eBlock);
  character[monster].SayBackground("That one REALLY hurt!");
  if (Destruction == false){
 [color=#ff0] monsterhp[/color] -= Damage * Crit;
  lblCash.Text = String.Format ("H:%d", BabyGullHP);
  }
  else if (Destruction == true){
    [color=#ff0]monsterhp[/color] -= 10;
    Destruction = false;
  }
  Status_Effects();
  Weapons_Check();
  cTinak.ChangeView(1);
  cTinak.Walk(100, 130, eBlock, eAnywhere);
  cTinak.FaceLocation(300, 130, eBlock);
  }
  
   if (Enemy_Bleed == true){
      character[monster].Say("I'm BLEEDING!");
      monsterhp -= 1;
   }
      
  if ([color=#ff0]monsterhp[/color]8-) <= 0){
  character[monster].ChangeRoom(0);
  [color=#ff0]monsterhp[/color] = hitpoints;
  MoneyDrop();
  Enemy_Bleed = false;
  cTinak.Walk(315, 130, eBlock, eAnywhere);
  }
  else if ([color=#ff0]monsterhp[/color] > 0){
  
  }
  
  }


this is the current code. The "int monsterhp" is currently the placeholder I have that needs to call a monster's hitpoint integer.
#14
I'm working on a function that needs to call for a specific variable within it. Not the value of the variable, but the variable itself. Is there any way to do that? Am I even doing it right?
#15
ooooooooooooooooooooookay, nm. I got the potion and right clicked it and it worked :DDDDDDDDDDDDDD. Thank you so much for the help, you have no idea how much this means to me.
#16
Okay, I think I found the problem. Where it says

if (player.ActiveInventory != null) player.ActiveInventory == null; // active item? drop it

I changed it to

if (player.ActiveInventory != null) player.ActiveInventory = null; // active item? drop it

Also, I'm still not entirely sure what this code does :/

#17
It says "parse error at 'player'", so I switched it to the main character's script name (cTinak), and it then says "parse error at 'cTinak'".
#18
Khris, I tried putting your code in where it says and it's not recognizing "player". So, I switched them to the player's name and then it wouldn't recognize that. My scripting skills are still new, so I'm not sure what to do.
#19
I must be staring at the screen too long, because for the life of me I can't figure out how to use an inventory object. I have a magic potion and an inventory bar at the bottom of the screen where you can see all your inventory. I want it to be possible to right click on your inventory items and use them that way, but I'm having trouble figuring it out. If anyone knows a simple way of doing this, please help.
#20
I've been having some early AGS nostalgia and going back to the older games made with it. There was one that I'm having trouble remembering where you play a police officer in a hotel, and a sequel where you explore a town. It has similar art styles to that of Pleuhrburg: Dark Age or the Calsoon games, but it wasn't made by the same person. If anyone has information on the title of these games, I'd appreciate it.
SMF spam blocked by CleanTalk