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 - Egmundo Huevoz

#21
I'm building my game on top of an older game of mine, that's why some of the things are outdated. But I fixed it now (laugh) Thanks for your help.
#22
I've tried calling it from on_event (i'm using this function correctly, as it does other things for me) and it didn't work. Then I tried with a specific room_load function within the room, didn't work either. I even tried with "room after fade in".
After testing a while, it worked. Then it stopped working again, and I didn't even change anything. Now it only works in certain rooms and not in others (roll). Not even a new room, which shouldn't have any conflicting code. ???
It doesn't place him on a walkable area, not with the F6 debug function, not with a custom key made by me, not with anything. :/
#23
Snarky, I solved it!
Under "Visual" in game settings, for some reason I had backwards compatible mode activated in both GUI alpha rendering style and sprite alpha rendering style. Selected "Proper Alpha Blending" in both, and it works!

(nod)
#24
Actually, it seems to be the other way around. I tested it with a previous game, which was 16-bit, and it worked fine. Switched to 32-bit, and it became transparent.
Started a new test game with 32-bit right off the bat, and it worked fine. I downgraded to 16-bit, and both the text and the bubble's background changed to weird colors. Back to 32 and back to working fine.
My current game was 16-bit, and I recently changed it to 32-bit. Maybe that's the problem. Downgraded to 16-bit to test it out, and it isn't transparent anymore, just weird colors like in the test game:



I'm not comfortable sharing my entire game files, I hope you understand.
#25
Incredible... I mean, I've been programming this game for the past 14 hours, but still, I can't believe I missed that (laugh) I was ADDING instead of SUBSTRACTING.

Thanks a lot, now I can go to sleep in peace.
#26
I'm making a map room, which is pretty big, and therefore scrolling.
I have this line of code, which I use to get what hotspot the character is currently standing, and then do something else with this information.
Code: ags
Hotspot *player_hotspot = Hotspot.GetAtScreenXY(player.x,player.y);

But it doesn't work properly; the hotspots are circles and the game only knows the player is standing in a hotspot in certain areas of this circle, but not in most of it (I know this because I have a label showing me a variable that changes whether or not the player is standing in a hotspot). I know it's the scrolling room's fault because I imported the room code into another room, put a smaller background so the room isn't a scrolling room, and it works perfectly. I've tried with GetViewport, but that only makes matters worse.

Any insight will be greatly appreciated.
#27
Tried red, yellow, and black, to no avail. :X
#28
I arrived to a similar code myself, but the problem with both your and my code is that I can click the hotspot, then interrupt my walking, do something else, and when I walk through the hotspot it without having JUST clicked it, it still changes the room.

After a lot of trial and error, I managed to do it!

Code: ags

int standing;

function repeatedly_execute_always()
{
if (!player.Moving)
    standing=0;
}

function on_mouse_click(MouseButton button){
if ((button == eMouseLeft)&&(mouse.Mode==eModeInteract)){
  player.Walk(GetViewportX()+mouse.x, GetViewportY()+mouse.y, eNoBlock);
  Hotspot *h=Hotspot.GetAtScreenXY(mouse.x, mouse.y);
  standing=h.ID;}
}

//then, on the particular hotspot/location walkon function:

function hAnyGivenHotspot_WalkOn()
{
if (standing==hAnyGivenHotspot.ID)
  Display("It worked!");
}
#29
Yeah, I already have it on the repeatedly_execute_always. But still, if the player clicked the location by accident, he would still have to walk all the way there (it takes like 20 seconds) and get ambushed by monsters without having a possibility to move.

Is there a way to make the "walk to hotspot" thingy non-blocking? I'm gonna try the variable thing right now.
#30
Quote from: Snarky on Mon 15/01/2018 12:47:24
Thanks! Could you also post your speech font and speech color settings, and SpeechBubble configuration?

Also, that white wedge that covers up some of the text in the second image, is there a reason for that or another bug?
Speech color: 184; 184; 248
Speech font: Comic Sans (the one that comes with Windows); 22pt
SpeechBubble config: the default. I installed the module and did nothing else.

Indeed, it's a cloud :-D
#31
Hello all. I'm making a "map" room, in which the locations are represented by hotspots. I want it to work in a way so that when the character is standing on the location/hotspot AND he clicks it with the interact cursor, then it changes the room. I know how to do either of those separately, but I can't figure out how to do both of them at the same time.
I need this to work like this because the character can just skip the location by walking over it, so just entering the room by standing on the hotspot is not an option. Also, only interacting with it it's not an option either, because when I interact with a hotspot, the character walks toward it while blocking the other scripts (which I need for monster spawning, yadda yadda).

Any other alternatives to my theoretical method are also welcome!

Thanks in advance! :-D
#32
It's just the look and talk functions of my character. I tried changing the speech color to other colors, to no avail. The same goes with dialogs. :-\

Code: ags
function cNacho_Look()
{
player.SayBubble ("I'm looking good!");}
}

function cNacho_Talk()
{
player.SayBubble ("As much as I'd enjoy talking to myself, I have better things to do with my time.");
}





Thanks for your help!

Edit: btw, I'm using a 22 pt comic sans (the one that comes with Windows)
#33
Hey Snarky, thanks for your response! I downloaded and "installed" your Speech bubble module, and it would solve my problem, but it doesn't work properly. Instead of showing my character's speech color, the letters are transparent (everything else it works as it should).

Also, if I weren't to use that module, and just wanted to use the outline code you provided, how would I do it? I don't even know where to paste that code, lol. (laugh)

Thanks in advance.
#34
Hi! I've scoured the forums for an answer, but there aren't any satisfactory ones. I'm currently using a TTF font, but I would settle for any type of font, really, as long as it's readable. Right now it's not unreadable, but it could cause problems. Thanks in advance.
#35
I already knew about the reading order, but I thought that by just importing it in the global script header was enough. I did as you said, and it worked perfectly, thanks a lot! (laugh) I'm going on a trip in a few hours, it's nice to go with a working code, lol. Happy new year!
#36
Gilbert, you're right, I feel silly now. I should just track everything with variables. The code was even worse before, so I can't complain. I'm progressing (laugh)
Kweepa, I replaced my code with yours, it seems better. Then only problem is that "Min" is not a member of "Maths". I understand what you mean by that line, so I'm gonna replace it with something else and see if it works.

EDIT: Got it working! :D

In my custom Shoot and Miss functions:
Code: ags

  btnAmmo.Width-=20;
  Bullets_magazine--;


In my Reload function:

Code: ags
function Reload_gun (){
//int Bullets_to_load= Maths.Min(Magazine_size - Bullets_magazine, Bullets_total); ERASED THIS BECAUSE IT DIDN'T WORK

if (Bullets_total!=0){
  Bullets_to_load=Magazine_size-Bullets_magazine;

  if (Bullets_to_load > 0){
    if (Bullets_to_load>Bullets_total){
      Bullets_magazine=Bullets_magazine+Bullets_total;
      Bullets_total=0;
    }

    else 
    {
      Bullets_total -= Bullets_to_load;
      Bullets_magazine += Bullets_to_load;
    }
  aReloadgun.Play();
  btnAmmo.Width = 20 * Bullets_magazine;
  }
  else{
    aEmptygun.Play(); // to be replaced with a "can't reload, full gun" sound, or something
  }
}
else
{
  aEmptygun.Play();
}
}


BTW, just one minor problem I have left. I don't know if it merits making another post, so I'll just ask it here, maybe it's easy for you, more experimented AGSers. All of these functions (Shoot, etc) are in globalscript. I want to make separate modules to avoid the clutter and also find them easily. But I tried to do it with the Shoot function, and I get an "undefined token" error, although the variables in question are defined in the global script, exported, and then imported in the global header.

At the top of Global Script.asc:

Code: ags
Stats personaje [100];
export personaje;


Then, in Global script.ash:
Code: ags

struct Stats{ //character stats
  int Health;
  int Damage;
  int Defense;
  int Luck;  
};

import Stats personaje[100];


Then I make a module, called Shoot, where I put a lot of things, but the thing that sends me an error is this:
Code: ags
  personaje[this.ID].Health-=personaje[player.ID].Damage-personaje[this.ID].Defense; //how much health is the enemy gonna lose


The error in question is this:
Quote"Shoot.asc(19): Error (line 19): Undefined token 'personaje' "

Apparently it's not a coding error, because it works perfectly as long as I put the Shoot function in the global script instead of its own module.

The full Shoot function, in case it's relevant:
Spoiler
Code: ags

// new module script
//what happens when you shoot someone

function Shoot (this Character*, AudioClip* sonido, int Velocidad2){ //extender function. usage: cCharacter.Shoot(aSound, X), where X is the amount of speed increase in the character's movement after being shot.
//if you have bullets, and you hit your target:
if (Bullets_magazine!=0){
  
  btnAmmo.Width-=20;
  Bullets_magazine--;
  
  Score++;
  Velocidad+=Velocidad2; //increasing the speed of the target after being shot, like in classic NES games.
  
  this.StopMoving();
  //this.Teleport();
  this.SetWalkSpeed(Velocidad, Velocidad);
  this.Walk (walkx, walky);
  
  personaje[this.ID].Health-=personaje[player.ID].Damage-personaje[this.ID].Defense; //how much health is the enemy gonna lose
  
  
  //String HPenemigotxt = String.Format("HP %s: %d", this.Name, Health[this.ID]);
  String HPenemigotxt = String.Format("HP %s: %d", this.Name, personaje[this.ID].Health);
  lblHPenemigo.Text=HPenemigotxt;
  aGunshot.Play();
  sonido.PlayQueued();
}  
else{ //if you have an empty clip
  aEmptygun.Play();}
}
[close]
#37
Hello! I'm having trouble with a "reloading bullets" script that I made. Some info before we start:
-I call this function from "on_key_press", by pressing R.
-I track the bullets with a GUI that has a button (btnAmmo), which has a picture 120 pixels wide, with 6 bullets with 20 px wide each. That works perfectly.
-I have another function for shooting, which also works perfectly, and deducts 1 from the global var "Bullets", which tracks my remaining bullets outside of the gun. The shooting function also deducts 20px from btnAmmo. If the button is 0 px wide, then the gun is empty.

The problem is with a function that manages reloading bullets into the gun. The max amount of bullets is 6, tracked by the global var "Maxammo" (I plan to make other guns with more bullets, but for now, it's always 6). I track the missing bullets from the magazine with the global var Empty_ammo (ie, if you shot 4 bullets, Empty_ammo should be =2). It works, but with a "delay", so to speak. I shoot some bullets, let's say 3, for this example, and I reload. My maganize refills (as shown by the GUI), but my remaining bullet count doesn't change (as shown by another GUI). When I reload again, no matter if I shot 1, 6 bullets, or anything inbetween, I lose 3 bullets (the amount I reloaded previously). And so on, it seems like the reloading is out of synch.

Any help will be deeply appreciated. I tried for hours to fix this, but I can't do it on my own.

Code: ags
// new module script
function Reload_gun(){ //important: every bullet is 20 px wide in the GUI, which is the origin of the 20's seen below.

Empty_ammo=Maxammo-(btnAmmo.Width/20); //global var representing bullets missing from the magazine, i.e fired bullets

  if ((btnAmmo.Width!=Maxammo*20)&&(Bullets>0)){ //don't do anything if magazine is full or you don't have bullets
    if (Empty_ammo>Bullets){
      btnAmmo.Width=btnAmmo.Width+Bullets*20;
      Bullets=0;
    }
    else{ //we have enough bullets to fill the magazine no matter what
      Bullets-=Empty_ammo; //lose the amount of bullets missing (1-6)
      btnAmmo.Width=btnAmmo.Width+Empty_ammo*20; //ammo = ammo left + ammo missing
      Empty_ammo=0;
      if (btnAmmo.Width>Maxammo*20){ //so you can't have more bullets than the size of your magazine
        btnAmmo.Width=Maxammo*20; 
      }
    }
    aReloadgun.Play();
  }
  else {
    aEmptygun.Play();
  }
}
#38
Hi Kweepa. "Ags3d.dll", according to an error screen that appears when I open the "game". Even worse, I can only open it with AGS 2.7. Maybe you can direct me to a different download link, which works?

EDIT: Looking around, I found it inside the compiled folder. Maybe it goes somewhere else? Still, I'd like to use it with modern AGS. BTW, the demo game is great. I wish I can make it work.
#39
Hello! Does anybody know of any 3d modules working in the newer versions of AGS? At least 3.0 onwards. I tried easy-3D, to no avail. 3D-AGS seems to be missing some plugins. I don't even want something too complex; something like doom working on a few rooms is enough (I plan to use it for mini-games, not the whole game). Thanks in advance!
#40
Quote from: Radiant on Thu 26/12/2013 01:08:49
Well, fellow adventure gamers, let me tell you a little story. Years ago, when I was new to AGS and all I had written so far were some action/puzzle games, I first came across this site and thought it was awesome (and by the way, I still think it is awesome, and more so every year). That's basically because I grew up with adventure games, and I learned English by playing King's Quest and Space Quest and figuring out what commands to type. So obviously I made plans to write a game in AGS, but since I was doing puzzle games I was also looking into other genres than just adventures. And then I noticed this thread or its predecessor: is it possible to design an RPG in AGS? I thought about it for a while and concluded yeah, sure. As far as I know, back then nobody had actually done any RPGs yet, so I decided I would go and write an RPG, and then make a post in this thread here containing just the word "yes" and a link to my game. Well, it took awhile; game design takes up quite a bit of time and real life has a tendency to interject itself every now and then, so it's now almost ten years after I first registered for bigbluecup. That means that there have been several RPGs made before, and nobody has to prove any more that something is possible in AGS because we've all seen how versatile the engine actually is. That said, RPGs are still great and so are AGS games, so there's always room for another AGSRPG; it was fun to write one and I hope other people remain inspired to write more. So without further ado,

YES!
Why don't you write a tutorial instead? At least the basics of how to make one...
SMF spam blocked by CleanTalk