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

#21
I am not worthy *Repeated Wayne's World Supplication* you understand implicitly! That's exactly it and I can't believe that instead of me catching flack for being crazy, someone else wanted to give it a try. Thanks for that! So it looks like no big slowdown, and that looks like roughly 100 letters or so? Success! 8) 8) 8) :-D :-D :-D Cool to know so many nodes are possible too, I was being really conservative with nodes=radius*letternumber.

The option to switch direction is really cool and left/right arrow keys blows my mind. Mamma likey
#22
[edit] I'm using the newest version [/edit]

Quote from: Khris on Thu 10/01/2013 06:27:47
I'm having a hard time understanding what you were saying about an updating source and stuff.

That blurb was a joke. Snip!

I've never converted between radians and degrees before and I'm confused about the proper method. I get a float error: expected float variable after '=' in my global variables.asc area, which double clicking doesn't access since it throws at compile time.

[edit] I was able to fix the FloatToInt bugs below and I pared it down to: undefined token "Canvas" which is the name of my sprite's draw surface. Am I not allowed to issue draw commands from a custom script to a surface in a room? Code is at line 25 [/edit]

Code: AGS

// in PrepArc.asc, a script which is called upon submitting a letter in the prompt

function PrepArc(){
  // establish desirable number of divisions (nodes for DrawLine curve illusion) based on radius and arc length 
  // CurLetter is an int from 1-26, also represents X/26ths of a full circle which will form that letter's arc
  ArcDivisions=CurRadius*CurLetter; 
  // Divide that number of divisions by the length of the arc to determine Nodes per arc unit
  ArcNodesPerUnit=(FloatToInt((ArcDivisions/CurLetter), eRoundNearest));
  // 13.85 is approximately 1/26 of 360, NewNodeAngleAmt is a float global variable along with NewNodeAngleSum
  // trying get these two floats to contain a number of degrees, Amt is amount of degrees between nodes in the 13.85 degree unit
  NewNodeAngleAmt=(13.85/ArcNodesPerUnit);
  // add the in-between-nodes angle to the angle of the x/y at the end of the previous arc (where the new arc starts)
  NewNodeAngleSum=(NewNodeAngleAmt+CurAngleEnd);
  // ArcReady observed by room's repexec
  ArcReady=1;
}

  //Now in WriteArc.asc, a script for doing the actual drawing of the line from one node to the next

function WriteArc(){
  ArcReady=2;
  NewStartX=(FloatToInt((CurRadius*cos(Maths.DegreesToRadians(CurAngleEnd))), eRoundNearest));
  NewStartY=(FloatToInt((CurRadius*sin(Maths.DegreesToRadians(CurAngleEnd))), eRoundNearest));
  // the following two lines appear as one in editor
  Canvas.DrawLine(NewStartX, NewStartY, (FloatToInt((CurRadius*cos(Maths.DegreesToRadians(NewNodeAngleSum))), eRoundNearest)), (FloatToInt((CurRadius*sin(Maths.DegreesToRadians(NewNodeAngleSum))), eRoundNearest));
  CurAngleEnd=NewNodeAngleSum;
  ArcNodesDone+=1;
  if (ArcNodesDone==ArcDivisions){
    gPrompt.Visible=true;
    BtnClr.Visible=true;
    ArcReady=0;
  }
}
      


I haven't solved the issue of what happens when 360 degrees turns over to 1 degree , but right now I can't even add smaller angles properly. Bear with me here I know I'm bad at this

I have to convert my angle-storing float variables into radians, do the cosine and sine operations, then convert those answers into integers for use as x/y coordinates, right? 


#23
Quote from: Khris on Wed 09/01/2013 13:25:42
Generating the final image is a one-time process, so even if it takes half a minute, that shouldn't be a problem, right?

In a really basic way, reading Arc cypher is conceptually similar to reading information on a compact disc or a record--by starting at a central point and looking for anomalies in successive circles. ATM I'm just making a converter that goes from text to Arc and potentially back (speed is not a porb), but if I wanted to make a reader that went from Arc x/y data to say, a constantly updating source (animation?) I would worry about speed. If I could do that, I could (with a hefty 3rd-party program) convert image data for a GIF, "Back to the Future" or even a live webcam feed into a Mega-Arc and then read it. If speed weren't an issue I could watch laser discs in AGS (may not be true).

Quote from: Khris on Wed 09/01/2013 13:25:42
...draw the curves to a quadratic DynamicSprite and save the result to the hard drive

You're my new hero. I'm starting to probe beyond my scripting comfort zone, and it's probing back. I'm still wrapping my brain around an undo button (backspace) based on storing x,y values for the end of each arc in an (dynamic?) array. Speaking of which:

(1.) Dynamic Arrays can only be declared one time after which any adjustment to the number of variables in the array wipes the contents of the array? Is that correct?

   I'm trying to establish undo levels by storing one x and y value for each arc (not each Draw equation), where the function that renders each arc only needs to know where the last arc ended in order to adjust radius and starting x/y. Of course, I also need to store a 1-26 number value for each arc to denote it's letter, so should I/can I run three Dynamic arrays (x, y, and alpha #) or should I use a struct and regular array and thus cap the max number of arcs from the start? I want to store three int's per arc and leave the limit open to test how many arcs I can play with at once.

[Edit] Doh--limit still 500 globalInts?
#25
     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
#26
Hey guys! Sorry I took a day off-- Actually I ended up switching to my laptop which is still Windows Vista, but not that 64 bit business. It works! I think the issue may be isolated to Windows Vista 64? Thanks for all the help guys
#27
I think one of the changes that came with the new one was that he disallowed accented letters because they don't compile. As for Pumaman, many years ago I had the good fortune of watching Mystery Science Theater 3,000 have a great time with the movie, Pumaman!
#28
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.
#29
I've been looking through the forums for some time now trying to solve this problem for myself. I'm using Vista 64 and I downloaded the newest AGS editor last night. Everything seemed alright, I was able to edit and build and all of that, but every time I wanted to run my work from the editor with or without debug mode enabled, my 320x200 gets the small window of course, but Vista 64 displays a black screen in the window and it does the ghost mouse thing where the cursor won't draw inside the window. When I click on the window's top bar thingy, the window suddenly displays my game complete with a cursor, except I can't manipulate anything in the game or move the game's cursor and clicking the tab in the windows bottom of the screen bar doesn't help. Sorry for layman's description of events. I don't think its a UAC issue, and I read all about the 320x200 res troubles in vista, but I can't even run in a window. I switched the game to 640x480 to test that out (I changed the res and all the backgrounds in the game through the editor,  not winsetup) and no dice! Maybe this issue is unresolved? Or is there somewhere in the forums or elsewhere that has the fix? This thread is 120 days stale or something, so any help would be appreciated!

;D

Joelcbarker@yahoo.com
SMF spam blocked by CleanTalk