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

#1
Quote from: Crimson Wizard on Mon 10/03/2025 12:00:35
Quote from: Jordanowen42 on Mon 10/03/2025 06:04:30
Quote from: Crimson Wizard on Sat 01/03/2025 09:51:10Please tell what it was, this is very important for me. Any error message with "Illegal exception" means a bad bug in the engine, that I must fix.

Not your issue- I was asking the program to switch to a room that didn't exist yet.

Thank you.
That is still my issue. The error message "Illegal exception" means that the engine is doing something wrong.
Under normal circumstance, even if the game has mistakes, the engine must display a simple message stating the problem that a regular user can understand, and close itself. "Illegal exception" means that the operating system have aborted the program because it tried to perform a forbidden operation. This has to be fixed.

EDIT:
I made a test in the same version, and changing to a non-existant room does not cause "Illegal exception", it makes engine simply tell that such room does not exist. Looking at your code posted above, I don't see any room change command either. There had to be something else having an effect there.

I wish I could be more help- I'm a rank amateur in this world. :/
#2
Quote from: Crimson Wizard on Sat 01/03/2025 09:51:10Please tell what it was, this is very important for me. Any error message with "Illegal exception" means a bad bug in the engine, that I must fix.

Not your issue- I was asking the program to switch to a room that didn't exist yet.
#3
Hello all-

You guys have been great answering my questions on my current game but I also have another idea that's in the planning stages. Where my current game is a first-person Myst style project, this one would be a classic Sierra style point and click with graphics from its early 90's era (think SQ4/LSL5 or 6/KQ5.)

Visual assets for my first game were done with AI (a controversial choice, I know, but it is mainly a learning project) and for the few motion characters I'm creating them with FMV actors on a greenscreen. For the next one I need someone or something to do actual pixel art designs for the characters. I do a little digital airbrushing myself and I've considered trying to hire actual models to act out the character movements for me to then animate over rotoscope style a'la OG Mortal Kombat but that seems like an insane amount of extra work and probably wouldn't have the authentic vintage Sierra VGA look I'm going for.

AI pixel art generators that I've found are limited- they can do great still frame pixel designs but that's about it. I could do backgrounds with MidJourney but I need animation for characters. Is there anyone on these forums that does that? This project would be a year or two away at the earliest.

Also, the idea I have is an adult comedy game in the vein of Leisure Suit Larry so someone willing to animate nudity/adult situations and innuendo would be a must.
#4
Let me pose another question- and I'm quite serious: how much would one of you chaps charge to program the whole puzzle for me?
#5
Quote from: Jordanowen42 on Fri 07/03/2025 06:48:25(Khris already told you about other things you should be doing that would be better than this, but I guess as a novice coder you are confused by his advice, so let's take it one step at a time.)

You are correct that I definitely find a lot of this confusing but I suppose the difficulty I'm having trouble seeing is how these things pertain to my overall problem. It seems like most of what you're telling me are essentially formatting issues that would make the script more succinct but I don't see how they will resolve the issues I described in the video.

Also, while I realize that you probably don't have the time it would help to see your updates inside of the larger whole of my existing script. A lot of what I'm seeing here is very alien to me.
Quote from: Khris on Fri 07/03/2025 10:10:12Made a demo game:

https://drive.google.com/file/d/1Sypp0xs5XjlZUQleTxxjGfJbeQxGkBvB/view?usp=sharing

I implemented the three buttons; they switch hatches and randomly set the temperature and level.

This uses three sprites only, a few more are needed to polish the optics. The colored squares are rectangles drawn to the background, then the panel is drawn on top.

Here's the room script:
Spoiler
Code: ags
// room script file

// for each line, store active column, temp and level
int hatch[3];
int temp[3];
int level[3];

// 6 colors for 6 temperatures
int col[6];

void DrawSquare(DrawingSurface* ds, int line) {
  ds.DrawingColor = col[temp[line]];
  int x = hatch[line] * 220 + 370;
  int y = line * 140 + 180;
  ds.DrawRectangle(x, y + 40 - level[line] * 5, x + 60, y + 60);
}

void UpdateScreen() {
  DrawingSurface* ds = Room.GetDrawingSurfaceForBackground();
  ds.Clear(0);
  // draw squares on background
  for (int line = 0; line < 3; line++) {
    DrawSquare(ds, line);
  }
  // draw panel on top
  ds.DrawImage(286, 135, 3);
  // draw green lights on panel
  for (int line = 0; line < 3; line++) {
    for (int column = 0; column < 3; column++) {
      int slot = 2; // off
      if (hatch[line] == column) slot = 1; // on
      ds.DrawImage(column * 215 + 475, line * 142 + 175, slot);
    }
  }
  ds.Release();
}

function room_Load()
{  
  // grey
  col[0] = Game.GetColorFromRGB(128, 128, 128);
  // light orange
  col[1] = Game.GetColorFromRGB(255, 220,  80);
  // orange
  col[2] = Game.GetColorFromRGB(255, 160,   0);
  // dark orange 
  col[3] = Game.GetColorFromRGB(210, 135,   0);
  // light red
  col[4] = Game.GetColorFromRGB(255, 100, 100);
  // dark red
  col[5] = Game.GetColorFromRGB(170,   0,   0);
  
  UpdateScreen();
}

void HandleLine(int line) {
  hatch[line] = (hatch[line] + 1) % 3; // switch column
  // random values for now
  temp[line] = Random(5);
  level[line] = Random(5);
  UpdateScreen();  
}

function hButton_AnyClick(Hotspot *theHotspot, CursorMode mode)
{
  // hotspots 1-3 => lines 0-2
  HandleLine(theHotspot.ID - 1);
}
[close]

I ran the game you provided and it worked but I'm not sure how to incorporate this into my code. I'm pretty much at the level of copy/pasting and what you see in my original code is the extent of my programming knowledge. I appreciate your help tho.
#6
Quote from: pell on Fri 07/03/2025 08:20:53I think I know what's happening here. You're calling UpdateTwoObjects every game cycle, because you call it from room_RepExec. That means that while object[2] is visible, the calculations to change the values of the counters happen every game cycle. If I'm right about this being the problem, I recommend one of two options:

1. The easiest way is just to call UpdateTwoObjects only when it needs to happen. Am I right in thinking that would be whenever the player clicks on one of the buttons?

2. If you want to call it every game cycle, you could set some kind of TwoObjectsNeedUpdating type of variable, and then set that to true after pressing a button (or whenever the update needs to happen) and then false again after performing the update.

Edit: To be clear, option 2 would normally not be a good idea. But it does illustrate how to selectively control something that would otherwise get changed by a continuous process (like keyboard and  mouse input).

I really loved the Myst games. I played the second, third and fourth games in the series, but not the first or last ones. I'm looking forward to seeing how this comes out.

I think we're on the right track here but can you tell me what a "game cycle" is? I am very much learning as I go.

To answer your questions, the answer to #1 is yes. But how do I make it update the two objects only when I need it to happen? As regards point two, I think you're on the right track but I'm too much of a n00b to know how to implement that.

If you haven't played Myst 1 I recommend trying RealMyst which is on the Apple app store and, I believe, Steam as well. It's an upgraded version that plays in a full motion 3D environment so it's more like the latter period games you're familiar with. Avoid 5.

#7
Quote from: pell on Fri 07/03/2025 07:37:05I've watched the video, and I'm going through the code to try to match these variables names to what they're meant to represent.

In case you're still up, can you tell me if myCounter1 and myCounter3 are supposed to be the six states and myCounter2 and myCounter4 the four temperatures? I ask because myCounter1 and myCounter3 show seven states in the code, 0 through 6.

So the counters represent the temp and height of lava in each segment of the pipe. Each set of two counters is assigned to one segment. Odd counters refer to the temperature on the spreadsheet I showed in the video and even numbers refer to the height. (So vertical and horizontal, respectively.

Objects 1-9 refer to the rectangular lights that indicate which hatch is closed. If a hatch light is on that means that hatch is closed.

Objects 11-19 refer to the square windows that indicate the temp and fluid levels of the lava in that segment of the pipe.

Objects 20-22 refer to the three switches (top to bottom) that are set to the left of each row of windows.
#8
Hey guys-

Improvements implemented and first problem solved but it brings me to my second (and ongoing) problem which I will outline in this video:


So that's where it stands. I know I keep saying this but thanks so much for your help!

Here's the code as it currently stands:

Code: ags


// room script file

// Segment 1
int myCounter1 =0 ;
int myCounter2 =0 ;

// Segment 2
int myCounter3 =0 ;
int myCounter4 =0 ;

// Segment 3
int myCounter5 ;
int myCounter6 ;

// Segment 4
int myCounter7 ;
int myCounter8 ;

// Segment 5
int myCounter9 ;
int myCounter10 ;

// Segment 6
int myCounter11 ;
int myCounter12 ;

// Segment 7
int myCounter13 ;
int myCounter14 ;

// Segment 8
int myCounter15 ;
int myCounter16 ;

// Segment 9
int myCounter17 ;
int myCounter18 ;



function oObject20_AnyClick()
{
if (object[20].Graphic == 410)
{object[20].Graphic = 411;
object[1].Visible = false;
object[2].Visible = true;
object[3].Visible = false;
return;}

if (object[20].Graphic == 411)
{object[20].Graphic = 412;
object[2].Visible = false;
object[3].Visible = true;
return;}

if (object[20].Graphic == 412)
{object[20].Graphic = 410;
object[1].Visible = true;
object[3].Visible = false;
return;}



}

function oObject21_AnyClick()
{
if (object[21].Graphic == 410)
{object[21].Graphic = 411;
object[4].Visible = false;
object[5].Visible = true;
object[6].Visible = false;
return;}

if (object[21].Graphic == 411)
{object[21].Graphic = 412;
object[4].Visible = false;
object[5].Visible = false;
object[6].Visible = true;
return;}

if (object[21].Graphic == 412)
{object[21].Graphic = 410;
object[4].Visible = true;
object[5].Visible = false;
object[6].Visible = false;
return;}

}

function oObject22_AnyClick()
{
if (object[22].Graphic == 410)
{object[22].Graphic = 411;
object[7].Visible = false;
object[8].Visible = true;
object[9].Visible = false;
return;}

if (object[22].Graphic == 411)
{object[22].Graphic = 412;
object[7].Visible = false;
object[8].Visible = false;
object[9].Visible = true;
return;}

if (object[22].Graphic == 412)
{object[22].Graphic = 410;
object[7].Visible = true;
object[8].Visible = false;
object[9].Visible = false;
return;}

}

function room_Load()
{

object[1].Visible = true;
object[4].Visible = true;
object[7].Visible = true;
}
function UpdateTwoObjects()
{
    
    if (object[1].Visible == true) { myCounter1 = 4; myCounter2 = 4;  return;}
    if (object[2].Visible == true) { myCounter3 += 3; myCounter4 += 2; myCounter1 -= 1; myCounter2 -= 1; return;}
}

function UpdateCounters()
{
   

// Segment 1 integers
if (myCounter1 == 0 && myCounter2 == 0) {object[11].Graphic = 376; } 
else if (myCounter1 == 1 && myCounter2 == 1) {object[11].Graphic = 404; } //check
else if (myCounter1 == 1 && myCounter2 == 2) {object[11].Graphic = 398; } //check
else if (myCounter1 == 1 && myCounter2 == 3) {object[11].Graphic = 392; } //check
else if (myCounter1 == 1 && myCounter2 == 4) {object[11].Graphic = 386; } //check
else if (myCounter1 == 2 && myCounter2 == 1) {object[11].Graphic = 407; } //check
else if (myCounter1 == 2 && myCounter2 == 2) {object[11].Graphic = 401; } //check
else if (myCounter1 == 2 && myCounter2 == 3) {object[11].Graphic = 395; } //check
else if (myCounter1 == 2 && myCounter2 == 4) {object[11].Graphic = 389; } //check
else if (myCounter1 == 3 && myCounter2 == 1) {object[11].Graphic = 405; } //check
else if (myCounter1 == 3 && myCounter2 == 2) {object[11].Graphic = 399; } //check
else if (myCounter1 == 3 && myCounter2 == 3) {object[11].Graphic = 393; } //check
else if (myCounter1 == 3 && myCounter2 == 4) {object[11].Graphic = 387; } //check
else if (myCounter1 == 4 && myCounter2 == 1) {object[11].Graphic = 402; } //check
else if (myCounter1 == 4 && myCounter2 == 2) {object[11].Graphic = 396; } //check
else if (myCounter1 == 4 && myCounter2 == 3) {object[11].Graphic = 390; } //check
else if (myCounter1 == 4 && myCounter2 == 4) {object[11].Graphic = 384; } //check
else if (myCounter1 == 5 && myCounter2 == 1) {object[11].Graphic = 406; } //check
else if (myCounter1 == 5 && myCounter2 == 2) {object[11].Graphic = 400; } //check
else if (myCounter1 == 5 && myCounter2 == 3) {object[11].Graphic = 394; } //check
else if (myCounter1 == 5 && myCounter2 == 4) {object[11].Graphic = 388; } //check
else if (myCounter1 == 6 && myCounter2 == 1) {object[11].Graphic = 403; } //check
else if (myCounter1 == 6 && myCounter2 == 2) {object[11].Graphic = 397; } //check
else if (myCounter1 == 6 && myCounter2 == 3) {object[11].Graphic = 391; } //check
else if (myCounter1 == 6 && myCounter2 == 4) {object[11].Graphic = 385; } //check

// Segment 2 integers
if (myCounter3 == 0 && myCounter4 == 0) {object[12].Graphic = 376; } 
else if (myCounter3 == 1 && myCounter4 == 1) {object[12].Graphic = 404; } //check
else if (myCounter3 == 1 && myCounter4 == 2) {object[12].Graphic = 398; } //check
else if (myCounter3 == 1 && myCounter4 == 3) {object[12].Graphic = 392; } //check
else if (myCounter3 == 1 && myCounter4 == 4) {object[12].Graphic = 386; } //check
else if (myCounter3 == 2 && myCounter4 == 1) {object[12].Graphic = 407; } //check
else if (myCounter3 == 2 && myCounter4 == 2) {object[12].Graphic = 401; } //check
else if (myCounter3 == 2 && myCounter4 == 3) {object[12].Graphic = 395; } //check
else if (myCounter3 == 2 && myCounter4 == 4) {object[12].Graphic = 389; } //check
else if (myCounter3 == 3 && myCounter4 == 1) {object[12].Graphic = 405; } //check
else if (myCounter3 == 3 && myCounter4 == 2) {object[12].Graphic = 399; } //check
else if (myCounter3 == 3 && myCounter4 == 3) {object[12].Graphic = 393; } //check
else if (myCounter3 == 3 && myCounter4 == 4) {object[12].Graphic = 387; } //check
else if (myCounter3 == 4 && myCounter4 == 1) {object[12].Graphic = 402; } //check
else if (myCounter3 == 4 && myCounter4 == 2) {object[12].Graphic = 396; } //check
else if (myCounter3 == 4 && myCounter4 == 3) {object[12].Graphic = 390; } //check
else if (myCounter3 == 4 && myCounter4 == 4) {object[12].Graphic = 384; } //check
else if (myCounter3 == 5 && myCounter4 == 1) {object[12].Graphic = 406; } //check
else if (myCounter3 == 5 && myCounter4 == 2) {object[12].Graphic = 400; } //check
else if (myCounter3 == 5 && myCounter4 == 3) {object[12].Graphic = 394; } //check
else if (myCounter3 == 5 && myCounter4 == 4) {object[12].Graphic = 388; } //check
else if (myCounter3 == 6 && myCounter4 == 1) {object[12].Graphic = 403; } //check
else if (myCounter3 == 6 && myCounter4 == 2) {object[12].Graphic = 397; } //check
else if (myCounter3 == 6 && myCounter4 == 3) {object[12].Graphic = 391; } //check
else if (myCounter3 == 6 && myCounter4 == 4) {object[12].Graphic = 385; } //check


}

function room_RepExec()
{
    UpdateTwoObjects();
    UpdateCounters();



}


#9


[/quote]

Did you mean for segment 2 to run if segment 1 does not? Because the way you have it coded, the function will return if any of the if statements in segment 1 fail.
[/quote]

No I mean for segment 1 to run then segment 2 and so on (there will be nine total.).
#10
Some really good stuff here guys- I really appreciate it. Will implement these ideas and get back to you.
#11
Quote from: Khris on Thu 06/03/2025 11:35:17@pell
My point is that in the "all this stuff" part, if any of the lines concerning segment #1 are a match, the code for segment #2 never runs. This is also most likely what caused OP to open this thread.
Because why would they deliberately sabotage their segment2 code, then ask here why it doesn't work?
None of this is intentional, because it's all a hot, flaming mess. Again, sorry. But this needs to be unlearned ASAP.

As an aside: using the object[] array in a room script is possible but less readable than using oButton1 or oSegment2 or whatever.

I changed the segment 2 script so it's myCounter 3 and 4. Still nothing. Going to implement some more ideas.
#12
Hello all-

I'm working on a puzzle where the player is pushing a button to alter the position of a hatch that is blocking the flow of lava. The temperature and height of the lava within the pipe is determined by moving int counters. Each segment of the pipe has an odd number counter (the temp) and an even number counter (the height.) I've put all of this on an X/Y grid which I then transferred into a code, the first two segments of which are below. Right now I'm trying to have the code respond to a simple set of variables: "object 1" (the first hatch blocking flow from segment one to segment two) being visible should cause object 11, the segment, to show the graphic for 4/4 on the X/Y chart. That works. The problem is that I can't get the same response when object 2 is made visible.

Any help would be greatly appreciated.

Code: ags

function room_RepExec()
{
if (object[1].Visible == true) { myCounter1 = 4; myCounter2 = 4; return; }
if (object[2].Visible == true) { myCounter3 = 4; myCounter4 = 4; return; }

// Segment 1 integers
if (myCounter1 == 0 && myCounter2 == 0) {object[11].Graphic = 376; return;} 
else if (myCounter1 == 1 && myCounter2 == 1) {object[11].Graphic = 404; return;}
else if (myCounter1 == 1 && myCounter2 == 2) {object[11].Graphic = 398; return;}
else if (myCounter1 == 1 && myCounter2 == 3) {object[11].Graphic = 392; return;}
else if (myCounter1 == 1 && myCounter2 == 4) {object[11].Graphic = 386; return;}
else if (myCounter1 == 2 && myCounter2 == 1) {object[11].Graphic = 407; return;}
else if (myCounter1 == 2 && myCounter2 == 2) {object[11].Graphic = 401; return;}
else if (myCounter1 == 2 && myCounter2 == 3) {object[11].Graphic = 395; return;}
else if (myCounter1 == 2 && myCounter2 == 4) {object[11].Graphic = 389; return;}
else if (myCounter1 == 3 && myCounter2 == 1) {object[11].Graphic = 405; return;}
else if (myCounter1 == 3 && myCounter2 == 2) {object[11].Graphic = 399; return;}
else if (myCounter1 == 3 && myCounter2 == 3) {object[11].Graphic = 393; return;}
else if (myCounter1 == 3 && myCounter2 == 4) {object[11].Graphic = 387; return;}
else if (myCounter1 == 4 && myCounter2 == 1) {object[11].Graphic = 402; return;}
else if (myCounter1 == 4 && myCounter2 == 2) {object[11].Graphic = 396; return;}
else if (myCounter1 == 4 && myCounter2 == 3) {object[11].Graphic = 390; return;}
else if (myCounter1 == 4 && myCounter2 == 4) {object[11].Graphic = 384; return;}
else if (myCounter1 == 5 && myCounter2 == 1) {object[11].Graphic = 406; return;}
else if (myCounter1 == 5 && myCounter2 == 2) {object[11].Graphic = 400; return;}
else if (myCounter1 == 5 && myCounter2 == 3) {object[11].Graphic = 394; return;}
else if (myCounter1 == 5 && myCounter2 == 4) {object[11].Graphic = 388; return;}
else if (myCounter1 == 6 && myCounter2 == 1) {object[11].Graphic = 403; return;}
else if (myCounter1 == 6 && myCounter2 == 2) {object[11].Graphic = 397; return;}
else if (myCounter1 == 6 && myCounter2 == 3) {object[11].Graphic = 391; return;}
else if (myCounter1 == 6 && myCounter2 == 4) {object[11].Graphic = 385; return;}

// Segment 2 integers
if (myCounter1 == 0 && myCounter2 == 0) {object[12].Graphic = 476; return;}
else if (myCounter1 == 1 && myCounter2 == 1) {object[12].Graphic = 504; return;}
else if (myCounter1 == 1 && myCounter2 == 2) {object[12].Graphic = 498; return;}
else if (myCounter1 == 1 && myCounter2 == 3) {object[12].Graphic = 492; return;}
else if (myCounter1 == 1 && myCounter2 == 4) {object[12].Graphic = 486; return;}
else if (myCounter1 == 2 && myCounter2 == 1) {object[12].Graphic = 507; return;}
else if (myCounter1 == 2 && myCounter2 == 2) {object[12].Graphic = 501; return;}
else if (myCounter1 == 2 && myCounter2 == 3) {object[12].Graphic = 495; return;}
else if (myCounter1 == 2 && myCounter2 == 4) {object[12].Graphic = 489; return;}
else if (myCounter1 == 3 && myCounter2 == 1) {object[12].Graphic = 505; return;}
else if (myCounter1 == 3 && myCounter2 == 2) {object[12].Graphic = 499; return;}
else if (myCounter1 == 3 && myCounter2 == 3) {object[12].Graphic = 493; return;}
else if (myCounter1 == 3 && myCounter2 == 4) {object[12].Graphic = 487; return;}
else if (myCounter1 == 4 && myCounter2 == 1) {object[12].Graphic = 502; return;}
else if (myCounter1 == 4 && myCounter2 == 2) {object[12].Graphic = 496; return;}
else if (myCounter1 == 4 && myCounter2 == 3) {object[12].Graphic = 490; return;}
else if (myCounter1 == 4 && myCounter2 == 4) {object[12].Graphic = 484; return;}
else if (myCounter1 == 5 && myCounter2 == 1) {object[12].Graphic = 506; return;}
else if (myCounter1 == 5 && myCounter2 == 2) {object[12].Graphic = 500; return;}
else if (myCounter1 == 5 && myCounter2 == 3) {object[12].Graphic = 494; return;}
else if (myCounter1 == 5 && myCounter2 == 4) {object[12].Graphic = 488; return;}
else if (myCounter1 == 6 && myCounter2 == 1) {object[12].Graphic = 503; return;}
else if (myCounter1 == 6 && myCounter2 == 2) {object[12].Graphic = 497; return;}
else if (myCounter1 == 6 && myCounter2 == 3) {object[12].Graphic = 491; return;}
else if (myCounter1 == 6 && myCounter2 == 4) {object[12].Graphic = 485; return;}


If it helps, here's the code for the whole room:

Code: ags


// room script file

// Segment 1
int myCounter1 ;
int myCounter2 ;

// Segment 2
int myCounter3 ;
int myCounter4 ;

// Segment 3
int myCounter5 ;
int myCounter6 ;

// Segment 4
int myCounter7 ;
int myCounter8 ;

// Segment 5
int myCounter9 ;
int myCounter10 ;

// Segment 6
int myCounter11 ;
int myCounter12 ;

// Segment 7
int myCounter13 ;
int myCounter14 ;

// Segment 8
int myCounter15 ;
int myCounter16 ;

// Segment 9
int myCounter17 ;
int myCounter18 ;



function oObject20_AnyClick()
{
if (object[20].Graphic == 410)
{object[20].Graphic = 411;
object[1].Visible = false;
object[2].Visible = true;
object[3].Visible = false;
return;}

if (object[20].Graphic == 411)
{object[20].Graphic = 412;
object[2].Visible = false;
object[3].Visible = true;
return;}

if (object[20].Graphic == 412)
{object[20].Graphic = 410;
object[1].Visible = true;
object[3].Visible = false;
return;}



}

function oObject21_AnyClick()
{
if (object[21].Graphic == 410)
{object[21].Graphic = 411;
object[4].Visible = false;
object[5].Visible = true;
object[6].Visible = false;
return;}

if (object[21].Graphic == 411)
{object[21].Graphic = 412;
object[4].Visible = false;
object[5].Visible = false;
object[6].Visible = true;
return;}

if (object[21].Graphic == 412)
{object[21].Graphic = 410;
object[4].Visible = true;
object[5].Visible = false;
object[6].Visible = false;
return;}

}

function oObject22_AnyClick()
{
if (object[22].Graphic == 410)
{object[22].Graphic = 411;
object[7].Visible = false;
object[8].Visible = true;
object[9].Visible = false;
return;}

if (object[22].Graphic == 411)
{object[22].Graphic = 412;
object[7].Visible = false;
object[8].Visible = false;
object[9].Visible = true;
return;}

if (object[22].Graphic == 412)
{object[22].Graphic = 410;
object[7].Visible = true;
object[8].Visible = false;
object[9].Visible = false;
return;}

}

function room_Load()
{


 
}

function room_RepExec()
{
if (object[1].Visible == true) { myCounter1 = 4; myCounter2 = 4; return; }
if (object[2].Visible == true) { myCounter3 = 4; myCounter4 = 4; return; }

// Segment 1 integers
if (myCounter1 == 0 && myCounter2 == 0) {object[11].Graphic = 376; return;} 
else if (myCounter1 == 1 && myCounter2 == 1) {object[11].Graphic = 404; return;}
else if (myCounter1 == 1 && myCounter2 == 2) {object[11].Graphic = 398; return;}
else if (myCounter1 == 1 && myCounter2 == 3) {object[11].Graphic = 392; return;}
else if (myCounter1 == 1 && myCounter2 == 4) {object[11].Graphic = 386; return;}
else if (myCounter1 == 2 && myCounter2 == 1) {object[11].Graphic = 407; return;}
else if (myCounter1 == 2 && myCounter2 == 2) {object[11].Graphic = 401; return;}
else if (myCounter1 == 2 && myCounter2 == 3) {object[11].Graphic = 395; return;}
else if (myCounter1 == 2 && myCounter2 == 4) {object[11].Graphic = 389; return;}
else if (myCounter1 == 3 && myCounter2 == 1) {object[11].Graphic = 405; return;}
else if (myCounter1 == 3 && myCounter2 == 2) {object[11].Graphic = 399; return;}
else if (myCounter1 == 3 && myCounter2 == 3) {object[11].Graphic = 393; return;}
else if (myCounter1 == 3 && myCounter2 == 4) {object[11].Graphic = 387; return;}
else if (myCounter1 == 4 && myCounter2 == 1) {object[11].Graphic = 402; return;}
else if (myCounter1 == 4 && myCounter2 == 2) {object[11].Graphic = 396; return;}
else if (myCounter1 == 4 && myCounter2 == 3) {object[11].Graphic = 390; return;}
else if (myCounter1 == 4 && myCounter2 == 4) {object[11].Graphic = 384; return;}
else if (myCounter1 == 5 && myCounter2 == 1) {object[11].Graphic = 406; return;}
else if (myCounter1 == 5 && myCounter2 == 2) {object[11].Graphic = 400; return;}
else if (myCounter1 == 5 && myCounter2 == 3) {object[11].Graphic = 394; return;}
else if (myCounter1 == 5 && myCounter2 == 4) {object[11].Graphic = 388; return;}
else if (myCounter1 == 6 && myCounter2 == 1) {object[11].Graphic = 403; return;}
else if (myCounter1 == 6 && myCounter2 == 2) {object[11].Graphic = 397; return;}
else if (myCounter1 == 6 && myCounter2 == 3) {object[11].Graphic = 391; return;}
else if (myCounter1 == 6 && myCounter2 == 4) {object[11].Graphic = 385; return;}

// Segment 2 integers
if (myCounter1 == 0 && myCounter2 == 0) {object[12].Graphic = 476; return;}
else if (myCounter1 == 1 && myCounter2 == 1) {object[12].Graphic = 504; return;}
else if (myCounter1 == 1 && myCounter2 == 2) {object[12].Graphic = 498; return;}
else if (myCounter1 == 1 && myCounter2 == 3) {object[12].Graphic = 492; return;}
else if (myCounter1 == 1 && myCounter2 == 4) {object[12].Graphic = 486; return;}
else if (myCounter1 == 2 && myCounter2 == 1) {object[12].Graphic = 507; return;}
else if (myCounter1 == 2 && myCounter2 == 2) {object[12].Graphic = 501; return;}
else if (myCounter1 == 2 && myCounter2 == 3) {object[12].Graphic = 495; return;}
else if (myCounter1 == 2 && myCounter2 == 4) {object[12].Graphic = 489; return;}
else if (myCounter1 == 3 && myCounter2 == 1) {object[12].Graphic = 505; return;}
else if (myCounter1 == 3 && myCounter2 == 2) {object[12].Graphic = 499; return;}
else if (myCounter1 == 3 && myCounter2 == 3) {object[12].Graphic = 493; return;}
else if (myCounter1 == 3 && myCounter2 == 4) {object[12].Graphic = 487; return;}
else if (myCounter1 == 4 && myCounter2 == 1) {object[12].Graphic = 502; return;}
else if (myCounter1 == 4 && myCounter2 == 2) {object[12].Graphic = 496; return;}
else if (myCounter1 == 4 && myCounter2 == 3) {object[12].Graphic = 490; return;}
else if (myCounter1 == 4 && myCounter2 == 4) {object[12].Graphic = 484; return;}
else if (myCounter1 == 5 && myCounter2 == 1) {object[12].Graphic = 506; return;}
else if (myCounter1 == 5 && myCounter2 == 2) {object[12].Graphic = 500; return;}
else if (myCounter1 == 5 && myCounter2 == 3) {object[12].Graphic = 494; return;}
else if (myCounter1 == 5 && myCounter2 == 4) {object[12].Graphic = 488; return;}
else if (myCounter1 == 6 && myCounter2 == 1) {object[12].Graphic = 503; return;}
else if (myCounter1 == 6 && myCounter2 == 2) {object[12].Graphic = 497; return;}
else if (myCounter1 == 6 && myCounter2 == 3) {object[12].Graphic = 491; return;}
else if (myCounter1 == 6 && myCounter2 == 4) {object[12].Graphic = 485; return;}




}



#13
UPDATE: Nevermind. I figured it out. You guys are nice to put up with me.
#14
Hello all-

I'm trying to set up a simple function where the graphic for a button changes every time I click on it. Clicking on the button three times kills the game. Here's the code:

Code: ags


function oObject20_AnyClick()
{
if (object[20].Graphic == 410)
{object[20].Graphic = 411;
return;}

if (object[20].Graphic == 411)
{object[20].Graphic = 412;
return;}

if (object[20].Graphic == 412)
{object[20].Graphic = 413;
return;}

if (object[20].Graphic == 413)
{object[20].Graphic = 410;
return;}
}

function oObject21_AnyClick()
{
if (object[21].Graphic == 410)
{object[21].Graphic = 411;
return;}

if (object[21].Graphic == 411)
{object[21].Graphic = 412;
return;}

if (object[21].Graphic == 412)
{object[21].Graphic = 413;
return;}

if (object[21].Graphic == 413)
{object[21].Graphic = 410;
return;}
}

function oObject22_AnyClick()
{
if (object[22].Graphic == 410)
{object[22].Graphic = 411;
return;}

if (object[22].Graphic == 411)
{object[22].Graphic = 412;
return;}

if (object[22].Graphic == 412)
{object[22].Graphic = 413;
return;}

if (object[22].Graphic == 413)
{object[22].Graphic = 410;
return;}
}


When the game crashes here's what I get:

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x0048A5F7; program pointer is +72, engine version 3.6.0.48, gtags (0,0)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and contact the game author for support or post these details on the AGS Technical Forum.



Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.

An error file CrashInfo.dmp has been created. You may be asked to upload this file when reporting this problem on the AGS Forums. (code 0)
---------------------------
OK   
---------------------------
#15
Hello all-

I have an idea for my next game that would be, fundamentally, a Sierra style point and click adventure but it would involve several arcade sequences. Like so many point and click mini games the arcade sequences would be send ups of established games. For that reason I'm curious what sorts of arcade sequences are possible in AGS and can you provide examples of games that employ them?

Here's some of the types of arcade sequences I want to do:

1. A top-down maze game in the style of Pac Man where the player runs from enemies.

2. Rail shooter sequences where the player moves a targeting reticle with the mouse and shoots at enemies that jump out from behind cover, a'la Lethal Enforcers. (This would actually be an important and recurring element of my idea)

3. A multi-lane anticipation/dodge scenario where the player is on something like a jet ski and has to dodge oncoming debris and other obstructions, a'la the second level of Battletoads.

These are just a few ideas, curious if you think it's doable and any other cool arcade sequences done with AGS.
#16
So my question then is how do I establish the circumference of the circle?
#17
Hello all-

I'm currently working on a Myst style game and I have a puzzle where there's a circular table top with concentric circles carved into it. The player drops marbles into the circular grooves and repositions them to affect the puzzle's outcome. So, my question is this: how do I alter the x,y coordinates of each of the marbles in the grooves so that it appears that each time one is clicked on they're being moved gradually around the groove?

Kind regards,
-Jordan
#18
By golly it worked!

Thanks so much once again. :)
#19
Hi Folks-

Thanks again in advance for helping me with something that is probably second nature to even most beginner programmers. I need help doing booleans and I need it in the simplest possible terms as I am beneath novice level at programming.

Here's the set up: I have a puzzle in one room (room 106) that when solved allows the player to take a blue sphere in another room (room 105) into their inventory. I wanted to accomplish this with a boolean. If the player tries to take the blue sphere without solving the puzzle the sphere swells up and hisses angrily. If the player solves the puzzle the blue sphere allows itself to be taken.

To accomplish this I set up first put this in the global header:
Code: ags
import bool BlueSphereIsTakeable;

Then I put this in the Global Script:
Code: ags
bool BlueSphereIsTakeable = false;

Then I put this in the room 105 code:

Code: ags
function room_Load()
{
 if (BlueSphereIsTakeable)
    {
        object[0].Visible = false;
    }
}

The idea there is that the blue sphere object disappears. Once I can get this to happen I will then have it replace the blue sphere with an identical object that can be taken.

And I put this in the Room 106 code:

Code: ags
function room_Leave()
{
if (object[1].Graphic == 227 && object[2].Graphic == 228 && object[3].Graphic == 229 && object[4].Graphic == 235 && object[5].Graphic == 230 && object[6].Graphic == 231 &&object[7].Graphic == 232 && object[8].Graphic == 233 && object[9].Graphic == 234)
{BlueSphereIsTakeable}
}

I thought I was supposed to specify "BlueSphereisTakeable == true" but ChatGPT disagrees.

Anyway, the game either won't start or starts and then crashes whenever I try to enter either of these two rooms. Pulling my hair out.
#20
Hello all-

Recently I wrote in asking for advice on a 3x3 block puzzle I was making. The question there concerned a set of nine holes in a grid that had to be filled with the appropriate order of boxes. My original question was how to make the nine different blocks appear in all the different holes as the player tries different combinations. The solution was to have an invisible object in each box that would be triggered when the player placed a block object on the corresponding hotspot. The trigger would cause a different image (blocks in this case) to appear as the visual for the object in question.

Below is the code I wrote for each hotspot (copy pasted with the relative numbers update for each hotspot.) Somehow this script works for the first and second block images (graphics 227 and 228) but not the rest. I'm not sure how identical code can only work in two of nine instances.

Thoughts?

Code: ags
function hHotspot1_UseInv()


{
if (player.ActiveInventory == iTomb)
{object[1].Graphic = 227;
player.LoseInventory(iTomb);
return;}

{if (player.ActiveInventory == iHoldingOrb)
object[1].Graphic = 228;
player.LoseInventory(iHoldingOrb);
return;}

{if (player.ActiveInventory == iAngelCity)
object[1].Graphic = 229;
player.LoseInventory(iAngelCity);
return;}

{if (player.ActiveInventory == iGauntlet)
object[1].Graphic = 235;
player.LoseInventory(iGauntlet);
return;}

{if (player.ActiveInventory == iAngelHandshake)
object[1].Graphic = 230;
player.LoseInventory(iAngelHandshake);
return;}

{if (player.ActiveInventory == iCrucifix)
object[1].Graphic = 231;
player.LoseInventory(iCrucifix);
return;}

{if (player.ActiveInventory == iAngelInHead)
object[1].Graphic = 232;
player.LoseInventory(iAngelInHead);
return;}

{if (player.ActiveInventory == iReceivingBlock)
object[1].Graphic = 233;
player.LoseInventory(iReceivingBlock);
return;}


{if (player.ActiveInventory == iDancing)
object[1].Graphic = 234;
player.LoseInventory(iDancing);
return;}
}
SMF spam blocked by CleanTalk