Captain Jonesy
04-10-10, 05:17 PM
Hi
This is the code I've written so far for my level
func OpenRoom_2_0()
{
idx = ObjFind(1000);
if(ObjGet(idx,O_STATUS)==0)
ScrRequest(gs_fid("PlayCutscene"));
}
func PlayCutscene()
{
// position player and avoid eventual jump entries
PlayerSetPos(580,114);
PlayerEnterIdle();
Message0(3,4,"Dizzy has taken\nDaisy on a date");
Message0(4,5,"to a beautiful place\nwith views of a castle");
Message0(5,6,"to ask her\na special question"); MessagePop();
Message2(5,6,"This is wonderful!\nyou are so romantic");
MessagePop();
Message1(4,5,"I want to ask\nyou something\nDaisy. Would you...");
MessagePop();
Message2 (5,6,"Ouch"); MessagePop();
idx = ObjFind(1000);
rand = gs_rand(1);
if(rand==0)
ObjSet(idx,O_COLOR,COLOR_GREEN);
ObjSet(idx,O_TILE,464);
Message1 (4,5,"Are you ok?\nYou suddenly look\nquite ill"); MessagePop();
Message2 (5,6,"I think I must have\neaten something bad"); MessagePop();
Message1 (4,5,"Oh no, I'll go and find\nyou some meds"); MessagePop();
ObjSet(idx,O_STATUS,1);
}
///////////// Daisy
func ActionObject_1000()
{
if(ObjGet(ObjFind(100),O_STATUS)==0)//first time talk
{
Message1(4,5,"I be back soon \n with some meds I promise");
Message2(5,6,"Please be quick \n Ouch!"); MessagePop();
}
///////////// Bob
func ActionObject_1001()
{
coins = PlayerGet(P_COINS);
if(coins==0)
{
Message2(4,2, "Alright mate!\nGive me 10 coins\n and we can talk business"); MessagePop();
}
else
if(coins==MAXCOINS)
{
Message2(10,7,"THANKS, Mate!\nLet's do business!");
Message2(10,7,"You have problems\n with the missus\n you say?");
Message2(10,7,"Try this potion\nThis should do the trick!");
MessagePop();
PlayerSet(P_COINS,0); // remove them
ObjSet(ObjFind(100),O_DISABLE,0); // enable item
}
}
on line 186 - func ActionObject_1001() - I'm getting error saying
PARSER, 0,0 "Parse error"
- next window says
EXCEPTION
gserrorexit < GSErrHandler < ga_parse <gs_compile buffer
I don't understand why I'm getting such error as this code/command worked fine before and I've copyed and pasted all my code into a new script because the script files get become corrupted sometimes. Can someone explain please? Thanks in advance.
Jonesy
This is the code I've written so far for my level
func OpenRoom_2_0()
{
idx = ObjFind(1000);
if(ObjGet(idx,O_STATUS)==0)
ScrRequest(gs_fid("PlayCutscene"));
}
func PlayCutscene()
{
// position player and avoid eventual jump entries
PlayerSetPos(580,114);
PlayerEnterIdle();
Message0(3,4,"Dizzy has taken\nDaisy on a date");
Message0(4,5,"to a beautiful place\nwith views of a castle");
Message0(5,6,"to ask her\na special question"); MessagePop();
Message2(5,6,"This is wonderful!\nyou are so romantic");
MessagePop();
Message1(4,5,"I want to ask\nyou something\nDaisy. Would you...");
MessagePop();
Message2 (5,6,"Ouch"); MessagePop();
idx = ObjFind(1000);
rand = gs_rand(1);
if(rand==0)
ObjSet(idx,O_COLOR,COLOR_GREEN);
ObjSet(idx,O_TILE,464);
Message1 (4,5,"Are you ok?\nYou suddenly look\nquite ill"); MessagePop();
Message2 (5,6,"I think I must have\neaten something bad"); MessagePop();
Message1 (4,5,"Oh no, I'll go and find\nyou some meds"); MessagePop();
ObjSet(idx,O_STATUS,1);
}
///////////// Daisy
func ActionObject_1000()
{
if(ObjGet(ObjFind(100),O_STATUS)==0)//first time talk
{
Message1(4,5,"I be back soon \n with some meds I promise");
Message2(5,6,"Please be quick \n Ouch!"); MessagePop();
}
///////////// Bob
func ActionObject_1001()
{
coins = PlayerGet(P_COINS);
if(coins==0)
{
Message2(4,2, "Alright mate!\nGive me 10 coins\n and we can talk business"); MessagePop();
}
else
if(coins==MAXCOINS)
{
Message2(10,7,"THANKS, Mate!\nLet's do business!");
Message2(10,7,"You have problems\n with the missus\n you say?");
Message2(10,7,"Try this potion\nThis should do the trick!");
MessagePop();
PlayerSet(P_COINS,0); // remove them
ObjSet(ObjFind(100),O_DISABLE,0); // enable item
}
}
on line 186 - func ActionObject_1001() - I'm getting error saying
PARSER, 0,0 "Parse error"
- next window says
EXCEPTION
gserrorexit < GSErrHandler < ga_parse <gs_compile buffer
I don't understand why I'm getting such error as this code/command worked fine before and I've copyed and pasted all my code into a new script because the script files get become corrupted sometimes. Can someone explain please? Thanks in advance.
Jonesy