EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Quests (https://www.eqemulator.org/forums/forumdisplay.php?f=624)
-   -   Cant get setguild to work (https://www.eqemulator.org/forums/showthread.php?t=11030)

Bearik 12-26-2003 01:42 PM

Cant get setguild to work
 
I'm trying to get it so this NPC puts the player into a guild after you say a few things. Heres the error i'm getting

Code:

Line: 10,File: quests/load2/170467.qst | error C0002: 'if' :syntax error : '(' 0
 '('s still not closed.
Line: 10,File: quests/load2/170467.qst | error C0007: 'setguild' : Unknown funct
ion
Line: 10,File: quests/load2/170466.qst | error C0002: 'if' :syntax error : '(' 0
 '('s still not closed.
Line: 10,File: quests/load2/170466.qst | error C0007: 'setguild' : Unknown funct
ion

It looks as if it doesn't even recognize it as a function. Heres the quest file.

Code:

  EVENT_ITEM{ 
    if($item1 == "6"); 
    setguild("6","5");     
    castspell("$userid","4498");} 
  }


Rogean 12-26-2003 04:21 PM

EVENT_ITEM{
if($item1 == "6"){
setguild("6","5");
castspell("$userid","4498");
}
}

Bearik 12-26-2003 04:40 PM

Well that fixed one of the errors, but i'm still getting
Quote:

Line: 0,File: none | error C0007: 'setguild' : Unknown function
No guild invite is being sent. :/ The part in red is what I really dont get, Line 0 file none?

Lurker_005 12-26-2003 05:49 PM

I see your using the qst format...

http://www.everquestserver.com/forum...pic.php?t=5719 is still the best referance as far as I know. I do not see a setguild command listed.

Hmm surch turns up http://www.everquestserver.com/forum...pic.php?t=8653 but I'm not sure what was ever actually put in. Glancing thru parser.cpp for 5.3 dr2 It looks like several of the commands that were discussed on the boards didn't make it in the code, or got lost. setguild seems to be one of them, although it looks like at least killspree had code with it in there.

Oh and the qst format does not use ; I also prefer $itemcount, since it dosen't chare what slot the item gets put in
Code:

  EVENT_ITEM{ 
    if($itemcount("6") == 1)
    setguild("6","5")
    castspell("$userid","4498")} 
  }


Bearik 12-26-2003 06:00 PM

Alright thanks. Starting to sound kind of hopeless :(

I do however remember the Scorpious2k server having a NPC that offered you to join a guild. It didn't work in 5.x though I think :(

Eglin 12-26-2003 07:06 PM

IIRC, the #command interface maintains a big mapping of function names to function pointers. An enterprising coder could extend the quest parser to hook that table in reverse to export a buttload of new functionality in one simple swoop. That may be better than adding all the setfaction(), setguild(), etc, commands one at a time, since most of them already have #cmd interfaces.

Alternatively, you could just add the command you need. I have described the way to do it elsewhere.

If you can't compile your own binaries/modify the code, then you could just connect directly to mysql and mess w/ the guild stuff directly from the quest code. The connection details can be read from the eqemu config files. Make your db connection on event_spawn and cache it so that you aren't making a new connection everytime the quest fires. Should perform adequately.

Bearik 12-26-2003 08:21 PM

Quote:

Alternatively, you could just add the command you need. I have described the way to do it elsewhere.
Where do you decribe how to do this? I cant compile but I have little coding experience.

Lurker_005 12-27-2003 03:09 PM

eglin posted it in this post: http://www.everquestserver.com/forum...ic.php?p=61069

I would love to see someone make all the EQEmu commands avaliable to the quests (qst and pl) I asume that is what you meant eglin. I wish I had the motivation to learn the skill to do it... oh well :/

Scorpious2k 12-27-2003 04:15 PM

The case of the missing setguild command for the qst format quest files seems to just be an oversight. The code is in the program, but the table of commands it uses to identify the command and number of parameters doesn't have it.


in parser.cpp

Code:

string cmds("if 0|break 1|spawn 6|settimer 2|stoptimer 1|dbspawnadd 2|echo 1|summonitem 1|castspell 2|say 1|emote 1|shout 1|depop 1|cumflag 1|flagclient 2|exp 1|level 1|safemove 1|rain 1|snow 1|givecash 4|pvp 1|doanim 1|addskill 2|flagcheck 1|me 1|write 2|settarget 2|follow 1|sfollow 1|save 1|setallskill 1|");
needs to have setguild added like this

Code:

string cmds("if 0|break 1|spawn 6|settimer 2|stoptimer 1|dbspawnadd 2|echo 1|summonitem 1|castspell 2|say 1|emote 1|shout 1|depop 1|cumflag 1|flagclient 2|exp 1|level 1|safemove 1|rain 1|snow 1|givecash 4|pvp 1|doanim 1|addskill 2|flagcheck 1|me 1|write 2|settarget 2|follow 1|sfollow 1|save 1|setallskill 1|setguild 2|");
I haven't had a chance to test it, but this appears to be the problem and if so, a fairly simple solution.

Bearik 12-27-2003 06:48 PM

Confirming that that fix does infact work!

I cant thank you enough Scorpious, you're the man.

Scorpious2k 12-28-2003 09:25 AM

Glad to help out :-)

Scorpious2k 12-28-2003 12:55 PM

I'm doing the code changes to bring the S2K server up to 5.3DR2, and noticed that there are other quest commands missing from that list...

rebind,faction,settime,setguild,setsky,flagnpc,mov epc,gmmove,movegrp and attack are all missing. In addition dbspawnadd and flagclient are in the list but I don't see anywhere that they are executed...

so if you want to avoid any more missing quest commands try replacing the line discussed above with:

Code:

string cmds("if 0|break 1|spawn 6|settimer 2|stoptimer 1|rebind 4|echo 1|summonitem 1|castspell 2|say 1|emote 1|shout 1|depop 1|cumflag 1|flagnpc 1|exp 1|level 1|safemove 1|rain 1|snow 1|givecash 4|pvp 1|doanim 1|addskill 2|flagcheck 1|me 1|write 2|settarget 2|follow 1|sfollow 1|save 1|setallskill 1|faction 2|settime 2|setguild 2|setsky 1|movepc 4|gmmove 3|movegrp 4|attack 1|");

Scorpious2k 12-28-2003 01:23 PM

While you're adding things... here are all the ones missing from the perl version (including faction and setguild that have already been posted elsewhere)

Code:

"sub faction{push(@cmd_queue,{func=>'faction',args=>join(',',@_)});}"
"sub setguild{push(@cmd_queue,{func=>'setguild',args=>join(',',@_)});}"
"sub rebind{push(@cmd_queue,{func=>'rebind',args=>join(',',@_)});}"
"sub flagcheck{push(@cmd_queue,{func=>'flagcheck',args=>join(',',@_)});}"
"sub write{push(@cmd_queue,{func=>'write',args=>join(',',@_)});}"
"sub settime{push(@cmd_queue,{func=>'settime',args=>join(',',@_)});}"
"sub setsky{push(@cmd_queue,{func=>'setsky',args=>join(',',@_)});}"
"sub settimer{push(@cmd_queue,{func=>'settimer',args=>join(',',@_)});}"
"sub stoptimer{push(@cmd_queue,{func=>'stoptimer',args=>join(',',@_)});}"
"sub settarget{push(@cmd_queue,{func=>'settarget',args=>join(',',@_)});}"
"sub follow{push(@cmd_queue,{func=>'follow',args=>join(',',@_)});}"
"sub sfollow{push(@cmd_queue,{func=>'sfollow',args=>join(',',@_)});}"
"sub movepc{push(@cmd_queue,{func=>'movepc',args=>join(',',@_)});}"
"sub gmmove{push(@cmd_queue,{func=>'gmmove',args=>join(',',@_)});}"
"sub movegrp{push(@cmd_queue,{func=>'movegrp',args=>join(',',@_)});}"
"sub setallskill{push(@cmd_queue,{func=>'setallskill',args=>join(',',@_)});}"
"sub attack{push(@cmd_queue,{func=>'attack',args=>join(',',@_)});}"
"sub save{push(@cmd_queue,{func=>'save',args=>join(',',@_)});}"


Lurker_005 12-28-2003 01:27 PM

LOL I was JUST thinking about that!

Do the commands have to be in the regular parser for those lines to activate the perl counterparts? Or is the perl parser tieing into something else. Sorry I know just enough C to cut and paste my way into trouble :twisted:

And I'll get all this into the perl quest guide shortly

Scorpious2k 12-28-2003 01:38 PM

In the case of Quest::xxxx commands, the Perl interface seems to grab the command, do some preprocessing and then passes it off to Parser::ExCommands in parser.cpp for the actual execution of it.

I haven't delved deeply into it.


All times are GMT -4. The time now is 08:34 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.