This Quest Error Makes No Sense? My Code Is Fine But Not Working

Post your quests here!
Garsor
Junior
Junior
Posts: 24
Joined: Thu Oct 10, 2013 12:03 pm

This Quest Error Makes No Sense? My Code Is Fine But Not Working

Postby Garsor » Sat Aug 08, 2015 12:43 pm

state Sheep
{
desc "Butchering Sheep"
if GotItems(502, 1) goto Sheep1
else if GotItems(502,10) goto Sheep2
else if GotItems(502,20) goto Sheep3
else if GotItems(502,30) goto Sheep4
else if GotItems(502,40) goto Sheep5
else if GotItems(502,50) goto Sheep6

else goto MainMenu
}

and the error is:
> Syntax Error: Expected '(' after function-name. Got: identifier 'gotitems' (Line 72)

Line 72 starts at else if GotItems(502,10) goto Sheep2

What's wrong?

Here's the full quest:

http://pastebin.com/Muy2W1hp

The quest works if I use IF instead of else if, but then the quest doesnt continue and it stays on the same state.
Last edited by Garsor on Sat Aug 08, 2015 12:45 pm, edited 1 time in total.
User avatar
Deaven
Legend
Legend
Posts: 570
Joined: Fri Jul 20, 2012 7:08 am
Location: United States

RE: This Quest Error Makes No Sense? My Code Is Fine But Not Working

Postby Deaven » Sat Aug 08, 2015 2:09 pm

Not sure whats causing the error but there are a few things I noticed

  • You don't need to use a back slash when you use apostrophes now ( this may be messing up the parser )
  • You need to reverse the order it checks ( so start from highest to lowest amount ). Let's say a player has 60 sheep carcasses. The server will check the first statement, does the player have 1 sheep carcass? Yes so it will always go to Sheep1. None of the other statements will be evaluated.

Return to “Quests”

Who is online

Users browsing this forum: No registered users and 2 guests