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

Topics - JoelCBarker

#1
Hey gang,

    Here's something I can't solve that you've probably seen a million times before. First the code:

Code: ags

    iteration = 0;
    Verb_Data_Unit = 1;
    while(bKeep_Loading_Verbs)
    {
      if(Verb_Data_Unit == 4)
      {
        Verb_Data_Unit = 1;
      }
      if(iteration > nSegments)
      {
        bKeep_Loading_Verbs = false;
      }
      if(Verb_Data_Unit == 1)
      {
        conversion_buffer_1 = Segments[iteration].Substring(0, 1);
        Verb[iteration].tense = conversion_buffer_1.AsInt;
        conversion_buffer_1 = Segments[iteration].Substring(1, 1); //  This line is highlighted when I get my error
        Verb[iteration].known_Subject = conversion_buffer_1.AsInt;
        conversion_buffer_1 = Segments[iteration].Substring(2, 1);
        Verb[iteration].abbey_capable = conversion_buffer_1.AsInt;
        conversion_buffer_1 = Segments[iteration].Substring(3, 1);
        Verb[iteration].user_capable = conversion_buffer_1.AsInt;
      }
      if(Verb_Data_Unit == 2)
      {
        Verb[iteration].Word_Text = Segments[iteration];
      }
      if(Verb_Data_Unit == 3)
      {
        Verb[iteration].Sound_File = Segments[iteration].AsInt;
      }
      iteration++;
      Verb_Data_Unit++;
    }
  }
}


    The code works pefectly fine until a specific iteration, maybe 19th? when I get the null index at that line. I can't figure out why it would be inside that if statement at that iteration. I'm wondering if my math is such that since 21 (counting iteration 0) is a multiple of three, my little Verb_Data_Unit ticker with three modes is getting out of sync? The strange part to me is that it gets each variable correct until finally Verb[iteration].Sound_File = 6, then it throws the error. Is the answer obvious?

This is the same number and arrangement of characters in each segment it could view, I already proved to myself that they each are intact:

0011 <--segment 0
accept <--segment 1
0    <--segment 2

0001 <--segment 3
allow <--segment 4
1    <--segment 5        ...and so on...

    I have all of these segments, read from a .dat via ReadBackRawLine(), segmented with great thanks going to JSH, but I want the sorting process to put three different types of segments in their homes, where the first section is four numbers with four different homes. Blah. Is it something to do with .AsInt?

    the null index is probably referring to one of the single-character segments, but I can't wrap my brain around how my system ends up trying to index one of those with substring, when it should be messing with the Sound_File variable?

Sorry to keep bothering everyone... I know this isn't really an adventure game

-Joel 
#2
Can't find the solution around the place

I have a string which contains multiple words separated by spaces, and I want to format it into a separate string for each word. It could be this sentence!

Code: ags

String user_text_input;    //    this is the raw string input from a text box prompt, "It could be this sentence!"

String first_word;
String second_word;    //    and so on...

function Input_Formatting() {
    if (user_text_input.Chars[1] == ?)    //    and I'm stumped. I want '?' to be the symbol for a space. How do I refer to a space here?


    If that isn't clear, I'm trying to go character by character through the input string to find a space, then I can store the preceding characters in my first_word string. I bet I can use variables to keep track of which Chars[] I've checked and need to ignore to keep moving through the string to find the next space and save the next word and on and on, through a long if (user_text_input.Chars[]==?) gauntlet to cover all of the characters allowed in my simple text box.

    This way I can know the order of the words, parse them for a word group and then have some clue what the user meant in a more thorough way.

    How do I look for a space in a string? Are there spaces in strings? Are there strings in space? :~(

-Joel
#3
Hey folks,

     I'm Joel, 28, I've been playing with AGS scripting and popping in and out of the forums for years now--if you wrote something about code I may have read it. I rarely post. Anyway, I didn't really know where to stick this so feel free to move it or chuck it.

     A long time ago I made this short game for my little niece Ezzy. I thought someone(?) might be interested in it because I tried to feign the appearance of scrolling by rolling in hills and enemies from off screen, then recycling them and so on, which I'm sure has been done before. One room, a handful of objects and no real ending, just kinda survival mode goblin-poking unicorn-riding toddler fun.

     I had advance notice that I was going to babysit her so I made this game the day before--the graphics and effort kinda reflect that, but for what it is it came out great. Not really looking for criticism since I already know whats up with it. Enjoy!


         


     Download link: (19.4 MB)

     http://www.filedropper.com/castle

Think of it as endless mode, since there isn't an end :P

Right arrow to go! Space to poke with the unicorn. Collect the coins for personal satisfaction!

If you run out of goblins to poke, just come to a stop by letting up on the arrow, then resume.

Cheers
#4
I'm stumped again! I found some other posts that helped me narrow the field, but I can't figure this out...

The game is 320x240 32-bit, newest AGS, my computer is Vista

I'm trying to use a 320x240 GUI (the size of the room) with 9 buttons and no other features. The buttons are small sprites, the majority of the GUI is transparent. I'm doing this because I already have around twelve animating objects in this room and it seemed like a good idea to throw nine into one GUI (which I may want to use elsewhere anyway). My GUI flickers!

The only code remotely related to the GUI is a simple "gMyGUI.Visible=true;" in the Room_Load department. I had lots of code related to it earlier, but after reading posts related to what I was trying to do with no luck, I decided to remove all of the code that uses the GUI just to see if simply displaying it would work, and I can't get it to behave. I was very thorough in making sure no code related to my GUI still exists, I just want to display it properly at this point.

It displays for about four seconds and then shuts off, then about half a second later it displays again (over and over).

When player interface is disabled, GUI's should "be hidden"

is that what's happening? No code disables the GUI, so I'm wondering if slow-down from lots of alpha'd .png animations is disabling player interface? When I switch to "...should Display Normally" it doesn't flicker, but I'm not able to manipulate it with code, it still seems to hang every four seconds or so.

Thanks! 

*Not using any blocking scripts etc*
#5
     Hi, I've been secretly using AGS for years and I love being a ghost in the forums from time to time, but now I'm really stumped. I called this a Beginner's Question because I'm hoping a whiz can think of a clever work-around. This is going to sound very pathetic and probably for good reason, but here goes:

    SKIP IF IN HURRY {

    I like to do this thing (on paper using a compass) where I assign each of the 26 letters in the alphabet a number, where that number is an amount of degrees (as in a circle). That way each letter can be represented by a geometric arc (an incomplete circle). Then I take a bit of text--I like to use classical Chinese poetry--and translate it into a single image by beginning at a central point and drawing each arc (letter) in succession so that the final product looks like a bunch of concentric circles, like a record. Then I hang it on my wall and cry. Actually it's neater than it sounds and I never cry.

    } 

     I thought it would be easy to make a program in AGS where I could perhaps Text Parser a single letter at a time, where submitting the letter resulted in a function which would visually adjust the Room or perhaps the Raw Draw Room Background surface using high-res coordinates, or something! I hit the forums to find out about Raw Draw and maths.sin/cos and I have one three questions:

  (1.)   How can I draw just one line segment on the draw surface with a curvature (not a real circle) based on a truncated three or four-digit pi? Another forum post about a clock program hinted that sin/cos might be used instead of DrawCircle to achieve just an outline or a close facsimile, but it did not address that process and I need remedial math...

  (2.)   If I can, how many curves can I draw at once without slowing too much? 100 would probably get me a haiku but I'd be really excited about thousands in higher resolution

  (3.)   Would saving the game save the raw draw display state?

  I'm not sure I can use methods involving pre-rendered sprites since each arc (letter) needs to have a higher radius depending on where it exists in a sequence (text). I thought of using room scaling...but I'm not sure I can have that many areas and baselines in a room at once, since that would probably have to be characters huh... 

  I have no code to share because I can't determine a single method to achieve this. If I just had an example of how to draw function one curved line I could take it from there. If anyone wants to check it out, I did make a sweet AGS game that functions like a running flash scroller (burrito bison, toss the turtle etc). Thanks geniuses!

JB
#6
Using Vista 64, I can't run my work through the editor in or out of debug mode, full screen or in a window at 640x480 or of course 320x200. I can build the .exe, but I can't run that either. Winsetup hasn't helped so far but I may be missing something! Searched the forums, but can't solve it except to see that this has been a problem for other folks in the past, so feel free to delete this post-- but not before redirecting me to a fix! Thanks a billion

Joelcbarker@yahoo.com ;D

Nor can I run the demo game in any way shape or form <-- I can run the demo game and I assume others in those windowed resolutions, but not in fullscreen, and not completely. I have to click and hold the window (as if to move it around) and then when I do move it around, the animated background runs, sound works great, but I still can't "enter" the game or otherwise manipulate anything in the screen since the cursor doesn't draw within the window. Any attempt to run in full screen gets a mostly black screen with a pixel cancer red-blue-cup and some actually blue pencil borders around the sides. Is this a Gfx card thing?

Okay update, I downloaded a 640x480 game and I can run it in a window only, and I can manipulate things in the game but I can never see the mouse cursor so I have to guess what I'm doing blindly, and I have to click and hold the window and shake it around to see the result of my attempts with the mouse. When the window sits still, the gamestate won't update.
SMF spam blocked by CleanTalk