Thread: AllaClone 2.0
View Single Post
  #37  
Old 03-16-2012, 10:21 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by initium View Post
I've been working on the quests a little bit. In particular parse_quests scripts. I know that's still on the to-do list, so I figured I'd post what I've run into so far. (When I mention changes I've made, these are just on my server of course)

These subroutines have no entry in the relevant pm files:
quest::npcsize
quest:npcrace
quest::buryplayercorpse
quest::npctexture
quest::SetRunning

(I just made empy subroutines for all those for now, but I wasn't sure if that was the best way to do it)

In file parse_quest.inc - old form item turn ins have a bug. Here's the relevant section:
Code:
  # Now, we give the npc some items
  # Old form, item1 to item4, starting at the if and ending at the {
  for (my $i=0; $i<$#content; $i++) {
    if ($content[$i]=~/item[1234]\s*==/) {
      EvalItemOld($content[$i]);
      do {
        $i++;
        if ($content[$i]=~/item[1234] ==/) { EvalItemOld($content[$i]); }
      } while (!($content[$i]=~/{/));
      give_old();
    }
  }
I actually had a few issues with this section. The first was the most important:
1) There are a few quests that cause the "do" loop to never end. This happens when there's no "{" after the line with item[1234]. This happens with several quests in qeynos:
Mespha_Tevalian
Renic_Losaren
Gahlith_Wrannstad
Kinloc_Flamepaw

I wasn't sure about the intent of the "do" loop, so I wasn't sure how best to fix it. My suspicion is that this could be fixed by changing '{' to '}', but again I wasn't sure, so I just made an innocuous change to the quests. I've just added an:
else {} after the appropriate "If" in the quest files for now

2) in the "do" loop the space in the regex should probably be replaced with \s*

3) item[1234]\s*== seems like too blunt of a check. I don't know the quest system well enough to be certain, but as far as I can tell ParseFile hasn't even checked to see if it's in an EVENT_ITEM (at the very least I'd think it would make sense to check for \$item[1234]\s*

Thanks again for working on this
That'd be sweet if you could get quest dialogues working. Trevius and I are working on a big web project that we'll also reveal in due time
Reply With Quote