Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Olden Help  (Read 1383 times)

0 Members and 1 Guest are viewing this topic.
Olden Help
« on: November 18, 2006, 08:06:50 pm »
  • Lionfish App dev
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3456
Heylo. I found this text engine on the old invision free ZFGC, and I need a bit of help. When I go up to the sign and press A, I get an error that says "unknown variable: global.firsttimedrawbox" Here's the script with the problem. One more thing. The error is on Line 53 where it says if(global.firsttimedrawbox = 0)...

Code: [Select]
//argument0 = the text
//argument1 = whether or not to draw the box at the end
//argument2 = whether or not to initiate the text
//argument3 = whether or not to draw the text box
//argument4 = the picture to use
//` = white text
//^ = red text
//{ = blue text
//} = green text
//[ = yellow text
global.drawingtext = true //the game is drawing text
if argument2 = true //if it is the first time through
 {
  self.position = 1//set the position as 1
  self.done = false //the text isn't done
 }
global.text = argument0
global.more = argument1
global.font = sprLettersWhite //set the font at the beggining of the script
//sets the postion of the pointer, so it knows how much text should be drawn
if keyboard_check(vk_enter) = true //if enter is pushed
 {
  self.done = true //you are done
  self.position = string_length(global.text) //end the text
  self.curstring = global.text //set the string to the text
  keyboard_clear(vk_enter) //stop generating events
 }
if self.done = false //if the text line isn't done
 {
  self.curstring = string_copy(global.text, 1, self.position) //the first line is a part of the actual first line
  if string_length(self.curstring) = string_length(global.text) //if the text is done
   {
    self.done = true //this line is done
    self.position = 1  //reset the start point
   }
 }
if self.done = false //if not all text is done
 {
  self.position += 1 //add one to the position
 }

//draws the important stuff
if argument4 <> 0 //if a picture was selected
 {
   if (global.firsttimedrawboxpic=0) {
  draw_sprite(sprPhotoBox, 0, view_x[0] + 16, view_y[0] + 108) //draw the box
  draw_sprite(argument4, 0, view_x[0] + 22, view_y[0] + 114) //draw the picture
    global.firsttimedrawboxpic=1;
 }
 }
if argument3 = true //if you should draw the text box
 {
  if (global.firsttimedrawbox=0) {
  draw_sprite(sprTextBox, 0, view_x[0] + 16, view_y[0] + 160) //draw the text box
  global.firsttimedrawbox=1;
  }
 }
self.pointx = 22 //a little to the right...
self.pointy = 166 //a little down...
for(i = 1; i < string_length(self.curstring) + 1; i += 1) //once for every character
 {
  self.lettertemp = string_copy(self.curstring, i, 1) //get the letter
  if self.pointx >= 270 //if it is too far over
   {
    self.pointx = 22 //go back a bit
    self.pointy += 16 //go down a line
   }
  if self.lettertemp <> " " and self.lettertemp <> "~" and self.lettertemp <> "|"//if it isn't a space or a tilde
   {
    if self.lettertemp <> "`" and self.lettertemp <> "^" and self.lettertemp <> "{" and self.lettertemp <> "}" and self.lettertemp <> "["//if it's not changing the font
     {
      self.todraw = get_letter(self.lettertemp) //get the imagesingle of the value
      draw_sprite(global.font, self.todraw, view_x[0] + self.pointx, view_y[0] + self.pointy)
      self.pointx += 8//move over for the next letter
     }
    else //if it is changing the font
     {
      if self.lettertemp = "`" //set it white
       {
        global.font = sprLettersWhite //sets it
       }
      if self.lettertemp = "^" //the caret
       {
        global.font = sprLettersRed //sets it
       }
      if self.lettertemp = "{" //blue
       {
        global.font = sprLettersBlue //sets it
       }
      if self.lettertemp = "}" //green
       {
        global.font = sprLettersGreen //sets it
       }
       if self.lettertemp = "[" //yellow
       {
        global.font = sprLettersYellow //sets it
       }
     }
   }
  if self.lettertemp = " " //if it is a space
   {
    self.pointx += 8 //move over for the next letter
   }
  if self.lettertemp = "~" //if it is a tilde
   {
    self.pointy += 16 //move down for the next letter
    self.pointx = 22 //reset to the start of the line
   }
 }
 if self.lettertemp = "|" //if it is a pipe
   {
    sleep(100) //sleep a while
   }
screen_refresh() //refreshes the screen so you can actually see it

if self.done = true and global.more = true //if we need to draw an arrow
 {
  draw_sprite(sprTextMore, 0, view_x[0] + 155, view_y[0] + 216) //draw the arrow
 }

if self.done = false //if the text isn't done
 {
   sleep(30) //pretty fast
   dialog_box(argument0, argument1, false, argument3, argument4) //do it all again
 }
else //yer done!
 {
  screen_refresh() //refresh the screen
  keyboard_wait() //wait for the keyboard
  sleep(30)
  global.drawingtext = false //get on with your regular life
  global.firsttimedrawbox=0;
  global.firsttimedrawboxpic=0;
  screen_redraw() //redraw the screen

Thanks people!
Logged
  • Lionfish Apps

Goodnight

Once and future Captain
Re: Olden Help
« Reply #1 on: November 18, 2006, 09:00:42 pm »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
I remember that script... it requires you to use the "Treat uninitialized variables as 0" option...

Which is not really a good idea. It allows for sloppy coding and causes more problems than it solves.

I found a way around this problem a couple years ago but don't remember how, just that it wasn't easy. :-\
Logged
Re: Olden Help
« Reply #2 on: November 18, 2006, 09:05:28 pm »
  • Lionfish App dev
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3456
Oh... :( I really need a text engine for GM 5 though. What should I use?
Logged
  • Lionfish Apps
Re: Olden Help
« Reply #3 on: November 18, 2006, 09:10:25 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 413
...Couldn't you just throw
Code: [Select]
global.firsttimedrawbox = 0 Into some object's create event?
Also, I think Scrappersa or Dragon made a really good text engine, though I'm not sure if they released it.
Logged

Goodnight

Once and future Captain
Re: Olden Help
« Reply #4 on: November 18, 2006, 10:15:51 pm »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
...Couldn't you just throw
Code: [Select]
global.firsttimedrawbox = 0 Into some object's create event?

Ha, of course. That seems to work. I remember it being more complicated than that.. oh well. :P
Logged
Re: Olden Help
« Reply #5 on: November 18, 2006, 10:17:47 pm »
  • Lionfish App dev
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3456
Yeah, that worked great. but as you can see from exhibit A I has bigger fish to fry. >_<

Exhibit A:
Logged
  • Lionfish Apps
Re: Olden Help
« Reply #6 on: November 18, 2006, 10:20:13 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Female
  • Posts: 2374
You need to call the script, and refit the text. I don't think the engine doesn't do that for you.
Logged
Re: Olden Help
« Reply #7 on: November 18, 2006, 10:23:48 pm »
  • Lionfish App dev
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3456
I know, but I'm not smart enough to do that. :P
Logged
  • Lionfish Apps
Re: Olden Help
« Reply #8 on: November 19, 2006, 12:53:49 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Female
  • Posts: 2374
Well then too bad.
Logged
Re: Olden Help
« Reply #9 on: November 19, 2006, 01:38:09 am »
  • Lionfish App dev
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3456
Wow. You've gotton mean over the years. :P Anyways... >_> I'm looking for a way to run Gm6...
Logged
  • Lionfish Apps
Re: Olden Help
« Reply #10 on: November 19, 2006, 02:34:41 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Female
  • Posts: 2374
Well, there's nothing you can do. And about GM6,  you need a good graphics card, and Direct X 9+. Or is it 8+?
Logged

Goodnight

Once and future Captain
Re: Olden Help
« Reply #11 on: November 19, 2006, 07:57:31 am »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
What I can tell from my copy of the file is, you need to format them yourself. Well, that's a drag.

Use ~ in a string to make a new line, and make sure it doesn't go over 3 lines. So you're on your own. :P

Speaking of movement, I just made an update to that engine, only released HERE so far.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.18 seconds with 47 queries.

anything