Need help with error (FollowingCharacter error - FIXED)

Started by silverwolfpet, Sat 18/09/2010 20:46:28

Previous topic - Next topic

silverwolfpet

Hello,

I spent one hour on this forum and looking through the help files and everything... basically, I've got all the information necessary to fix my error, but nobody says where or how should I use it.

Basically... I have a character John and a character Billy. John needs to follow Billy throughout the entire game, since the first room until the end.

I have only one room... I wrote  

cJohn.FollowCharacter(cBilly, 6, 9);

in the RoomScript.

It keeps giving me the error:

Parse error: unexpected 'cJohn'

The characters are named right. They both have walking animations, I just don't get it... why doesn't it work? Where do I have to write this? Or how?

GarageGothic

A wild guess - you didn't actually put the script line inside a function, did you? You need to create a room event by clicking the "Events" icon (lightning bolt) in the room editor, then select the "First time enters room" event and click the "..." icon to open up the script editor. There you can then put your script line inside the newly created  room_FirstLoad() function.

cianty

Hm... where exactly did you put the line?

Is it in the OnLoad function (that's why I would probably put as it is meant to be done as part of the initialization, isn't it)?

Is the line outside of any function? If so, put it in one of the room function and see if that works.

EDIT: Damn you, GarageGothic! ;)
ca. 70% completed

silverwolfpet

I put the line in the "Room Script".

I am using the latest version of AGS, so I can't find the lightning bolt... maybe that was in the old version, as I remember the "events" tab. The new version doesn't have it.

It is not written in any function... that's all there is to it, what I wrote in my previous post is exactly what is in the script. One single line.

What function do I have to use to get it to work? i want the character to follow the player every time he enters this room, not just on first load.

GarageGothic

Quote from: silverwolfpet on Sat 18/09/2010 21:34:07I am using the latest version of AGS, so I can't find the lightning bolt... maybe that was in the old version, as I remember the "events" tab. The new version doesn't have it.


silverwolfpet

Thank you :) works fine now.

SMF spam blocked by CleanTalk