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: A.I. Touble [gm6.1]  (Read 1137 times)

0 Members and 1 Guest are viewing this topic.

PoeFacedKilla

Prussian Killer Bee
A.I. Touble [gm6.1]
« on: August 24, 2006, 03:21:10 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
I am trying to make a NPC, and when i try (using this code) it says Line 3 Create Even Symbol '{' Expected:
Code: [Select]
{
if(distance_to_object(obj_normal_link)>0) {
   if(keyboard_check(ord('A')) {
     alarm[0] =60
   } else {
     alarm[0] =0
      }
       } else {
        if(distance_to_object(obj_normal_link)<0) {
         alarm[0] =0
         }
         }

« Last Edit: March 01, 2007, 01:08:40 am by 4Sword »
Logged
the Indyboard - User Generated Social Forum | Now With Even More Discussion!
Poe, The Independent Programmer
  • Zelda Shrine
Re: A.I. Touble [gm6.1]
« Reply #1 on: August 24, 2006, 12:10:09 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Well I don't use GM but from what I have picked up you've forgot to add the end-of-script closing brace in. Also for future reference its a good idea to indent your code better, it makes it easier to spot errors, and it looks cleaner :P

Code: [Select]
{

if(distance_to_object(obj_normal_link) > 0)
{
if(keyboard_check(ord('A')))
{
alarm[0] = 60
}
else
{
alarm[0] = 0
}

}
else
{
if(distance_to_object(obj_normal_link) < 0)
{
alarm[0] = 0
}
}

}

« Last Edit: August 24, 2006, 02:00:16 pm by Helios »
Logged
Re: A.I. Touble [gm6.1]
« Reply #2 on: August 24, 2006, 12:17:13 pm »
  • Txet Lanosrep
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 700
Lets see, I am tired at the moment so I may be making some mistakes but try this:

Code: [Select]
{
if(distance_to_object(obj_normal_link)>0) && (keyboard_check(ord('A')))
{
alarm[0] =60
}
if(distance_to_object(obj_normal_link)<0)
{
alarm[0] =0
}
}
Logged

Retro
  • TITANIC
Re: A.I. Touble [gm6.1]
« Reply #3 on: August 24, 2006, 01:58:04 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
if(keyboard_check(ord('A')))
Logged
Re: A.I. Touble [gm6.1]
« Reply #4 on: August 27, 2006, 04:31:07 am »
  • 笑い男
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 2124
what the error says and what is the actual error may be different sometimes because of missing/wrongly placed {'s,''s,"',s etc
but just check through the whole code, or if its too big, just the part you know effects that bit of code and make sure all the {}'s are in the right place

and im guessing its impossible for something to be closer then 0 (distance_to_object()<0) lol
so thats not really needed
also, making alarm[0]=0 should activate the code in alarm[0], if you dont want that, set it to -1
and if you tap a, then alarm[0] will be set to 60 and never go off, so you could check to see if alarm[0]<0, and if so set it to 60
same with point_distance()<0 setting the alarm to 0, which will constantly set off the alarm code i think. but that shouldnt matter as like i said, distance_to_object()<0 is impossible (isnt it? :S)

edit:it does seem to be that you missed off the end ) like bongo bob said.
so like i said, what it may say the error is may not always be the case :P
Logged

この世に悪があるとすれば、それは人の心だ
  • .hack//The World

PoeFacedKilla

Prussian Killer Bee
Re: A.I. Touble [gm6.1]
« Reply #5 on: August 28, 2006, 01:40:04 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
but see once i do that, it says there is an error with the farie script, it says that there is no variable x?
Logged
the Indyboard - User Generated Social Forum | Now With Even More Discussion!
Poe, The Independent Programmer
  • Zelda Shrine
Re: A.I. Touble [gm6.1]
« Reply #6 on: August 28, 2006, 06:42:23 pm »
  • 笑い男
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 2124
may be the same kind of thing again (a typo kinda thing)
Logged

この世に悪があるとすれば、それは人の心だ
  • .hack//The World
Pages: [1]   Go Up

 


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



Page created in 0.037 seconds with 51 queries.

anything