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 - Yuri Patrick

#21
ARGH! AGS hates me. :(

Here's my code:
Code: AGS
function UpdateCrocodile2()
{
  bool not_found = true;
  
  while (not_found) {
  if (cCroc2.Moving)
    return;
  int x = 171 + Random(179);
  int y = 14 + Random(274);
  
  if (GetWalkableAreaAt(x,  y) == 2) not_found = false;
  }
}


The second croc won't wander. He just sits there like moat scum... Until I remove the last line: if (GetWalkableAreaAt(x, y) == 2) not_found = false;

As long as that last line is there, his code breaks and I can't, for the life of me, figure out why. I'm not even getting a compile time error. :(

Heh, btw. Yesterday all my crocs were swimming just fine yesterday with Crimson's code. I started working on my game some more today and they swam right out of the mote. Hrmph. They went right into walkable area 1 from walkable area 2. 2 is the moat 1 is some field space.
#22
Well, it's nice to know that I can still solve my own coding problems. On occasion. ;)

I had all the right code in all the right places, but I forgot to import cMenuCallback and then reference the interaction function char1_a through him. Heh. Silly me.

Hopefully this helps someone else in the future. :)
#23
Heya, Crimson. :)

First off, it's only in the crocodile moat room. Haven't got any other rooms just yet. ;)

Second off, it is usually during alt-x, alt-f4, clicking the close button for the window. Usually, as long as I use a scripted close function it works just fine. I can type quit in the parser, click quit in the game menu, etc, and everything quits like it should.

I have been reading a little more in the manual and just got to wondering if that might not be my problem. Looks like I have to revise my wandering script.
#24
I was just wondering, I have a room in my game with a lot of stuff going on. Yet, there is a 50/50 chance that when I quit/close/alt-f4 my game, that it will freeze and tell me that AGS has stopped responding.

Can a blocking function or action cause this reaction if it is not properly unblocked or whatever the proper term is?
#25
I tried ending the scenario and the game froze... I tried moving ego from where he was to the same room at different coordinates and it just froze. So... I'm debating on trying to figure out the whole region or the DoOnce goody.

Thanks for the input again, Khris. :)
#26
Thanks, Khris. I have to double-check, haven't created the other side of the castle, yet, but I think my crocodiles already go onto the half of the moat. ;) Sheer accident.
#27
I have a room with a moat. Finally got the crocodiles swimming the way I want, btw. ;)

I have a hotzone outline, not filled in. Ego walks over the outline into the water and I can get his view to change to drowning, I can even get him to stop walking, but I can't get anything else to work right. The game just loops endlessly telling me that I died. There any way to get him to just fall into the water and drown without the looping? Or is there another method I should be using here than the hotzone?

PS: Sorry, Moderators. I made a mistake and posted this one once already under recruiting. Don't ask how I didn't notice. ;) Please delete the copy under recruiting when you get a sec. :) Thanks.
#28
Heh. Cool. Someone who gets me. ;)

And as for the moat thing, I was thinking about two croc functions on each screen. One at the bottom and one at the top so that they can both run at the same time. But you are getting me to think again.

You just reminded me how to work with if and numbers and now you are reminding me how to work with random generators. So... I'm having more ideas. :) I might be able to get the one Croc to swim the majority of the moat on the one screen instead of two. Still want two on each screen, but I think I get it now. :)

Let's see how I fair.
#29
So, with that wonderful example of my artistic skills, back to the code at hand. You put up:

Code: AGS
function UpdateCrododile()
{
   if (cCrocodile.Moving)
      return;
   int x = MOAT_RECT_X1 + Random(MOAT_RECT_X2 - MOAT_RECT_X1);
   int y = MOAT_RECT_Y1 + Random(MOAT_RECT_Y2 - MOAT_RECT_Y1);
   cCrocodile.Walk(x, y, eNoBlock, eWalkableAreas); // don't block, stay and moat's walkable area (I assume there's one prepared for him)
}
 
// Then in room's rep_exec
function room_RepExec()
{
    // call croco update
    UpdateCrododile();
}


And now I'm thinking about maybe splitting the moat within the code. But now I'm wondering how difficult that might be. Perhaps a xa, xb, ya and yb set of coordinates depending on which quarter of the moat the croc is in and then redesignating boarder coords for each section of the moat. Hrm.

I must concede, this is twice in one day you got me thinking, Crimson. :)

OH! I got it! One croc in the bottom right, one in the right, one in the bottom left and one in the far left. And each one has their own set of coords. Since each croc is it's own object, that should be doable. I can just have functions for each quarter of the moat. DUH!
#30
I loath ASCII art, but here goes:

I'm trying to picture your code working in my mind. It looks like a swimming pool more than what I have designed for my croc. Here's how I picture your code:

__________
|                    |
|                    |
|__________|

And here is what I have laid out:

__     CASTLE          __
|  |_______|______|  |
|_________|_______|

I need my crock to go a little up the left side of the moat, across the moat and then up the right side, all randomly. Just remembered I have the visible moat set up across two screens. Lemme add a divider real quick. ;)

There we go.

Perhaps this will help: Think King's Quest I, I need a castle and a moat and crocs randomly swimming throughout the visible moat.

PS: Posted and then realized, "Wow! ASCII art without a monospace font is difficult. ;)
#31
How does one make a crocodile wander aimlessly around a mote without leaving the mote's area or having to make him walk onto the screen? I did a search through the manual and found AddWayPoint.

AddWayPoint appears clumsy for what I am trying to do. Simply have the crocodile swim aimlessly around a rectangular moat. I would think there would be a way to just tell AGS to aim him randomly and keep him within the moat.
#32
Thank you sooo much, Crimson. I feel kinda silly. The if section was the easy part for me. However, the idea of a string.format was what was blowing my mind.

I know that everything is in the manual, but finding it either by search or by reading is difficult for me. :(

Thanks for the help again, Crimson. :)

BTW: I had some flags to animate in the background and was able to do that on my own. ;)
#33
Grrumpf! Like I said, brain death. I have a label on the status bar, lblVolume. When I try to get it to display the current volume, I get an error stating that I cannot convert an integer to a string. That's not what I'm trying to do. I'm trying to display the integer, for now.

Here's my code:
Code: AGS
lblVolume.Text = System.Volume;


And AGS' response to that line of code:
GlobalScript.asc(76): Error (line 76): Type mismatch: cannot convert 'int' to 'String*'

Hrm! Would a switching function work? If volume is 0, then it is muted, anything else means that it is on? But then, how do I get the current value of System.Volume into my label?

I just want to display OFF or the current volume level.
#34
My mind seems to have recently turned to mush. ;)

I'm working away on my game and I remember that I wanted a audio display on the statusbar that says what the volume is set to, muted, 1-100, etc. Now, I can't remember how to get the current value of the volume out of AGS. :(

Can someone point me in the right direction, please? :)

Thanks.
#35
Alright. My prior post on this topic disappeared when the forums server crashed the other day.

I'm having trouble with the pull down menus code. I followed the example as best I could and defined my whole menu layout in the repeat_always function just like the demo. Then I wrote the character1_a function just like in the demo, but whenever I click on a menu item, it flashes like it's taking my click and then nothing happens. :(

Anyone have any clue what I might have done wrong? Please help.
#36
Site & Forum Reports / Re: Server migration
Tue 18/09/2012 15:20:33
YAY! Now I know where all my posts went to and why I couldn't get in this week. ;)

Thanks. :)

Just an FYI: I have no clue what is going on, but I'm in the US and the server is still very sluggish for me. It works, but is sluggish. Just wanted to see if it was me somehow or what.
#37
Quote from: Wyz on Mon 25/06/2012 13:47:52The only real struggle I have there is AGS' lack of doing callbacks. I want AGS to call certain functions when messages arrive but I've yet to find an elegant way of doing this.

Just a silly idea, Wyz, but couldn't we hack the AGS source code? It is available. I forgot where I found it but it was somewhere under the downloads section.

I was already thinking about attempting to hack my own networking directly into the engine and use PennMUSH for the server after some hacking on that source code as well. I love open source. :)

Sorry for pushing the PennMUSH link so much, but lately when I ask, nobody seems to remember text-only gaming. ;)
#38
I was just thinking, most multiplayer games store their player data on the server. Is there anyway to disable the save load game subroutines in the AGS client?

In other words, disable local-machine game saving...?
#39
Hrm. It's starting to look like if I use the CSV concept you have on that thread, Khris, that I would need to consider using one database file per player to be able to retrieve all their individual variables. But that should be fairly easy. Some of the really old MUD engines still use that setup - each player has their own database on the server. Just call up the database by player name based on their login name to the server and then cross reference the password they inpu with the password line of their database, etc, etc. Just have a slight issue with no coffee and trying to read someone else's code yet. ;) LOL - joke.

I'll get it figured out yet. Thank you for your idea of the CSV files, Khris. Really, it does help.
#40
I just had another idea, instead of readstring and writestring, how about readrawline and writerawline, it appears that they both take input and variables which would make things just a smidge easier. Still researching.
SMF spam blocked by CleanTalk