Mirage Source http://web.miragesource.net/forums/ |
|
Quest Editor Problem http://web.miragesource.net/forums/viewtopic.php?f=201&t=4813 |
Page 1 of 2 |
Author: | addy [ Tue Dec 02, 2008 4:12 am ] |
Post subject: | Quest Editor Problem |
Well it feels like ive been posting alot now but im just a newbie Ive been trying to add a quest editor lately. I basically took whatever Item Editor had and duplicated and put in my own variables and changed names. I thought it would work then i test it out and i get this error that says: Code: Compile Error: Sub or Function not defined. Im thinking it cant read that its in a sub or that the spacing is wrong. thats what i THINK at least. heres the code i got for the Quest Editor Packet. It comes up that error. I mean i got no clue it says the sub right at the top. Its in the server side on ModHandleData Everyone is okay in that packet just when it comes to the quest(n).name=Parse(2) it says that error up top. Code: ' ::::::::::::::::::::::
' :: Quest Packet::::::: ' :::::::::::::::::::::: If LCase(Parse(0)) = "savequest" Then ' Prevent hacking If GetPlayerAccess(Index) < ADMIN_DEVELOPER Then Call HackingAttempt(Index, "Admin Cloning") Exit Sub End If n = Val(Parse(1)) If n < 0 Or n > MAX_QUESTS Then Call HackingAttempt(Index, "Invalid Item Index") Exit Sub End If ' Update the item Quest(n).Name = Parse(2) Quest(n).SayStart = Parse(3) Quest(n).NotReady = Parse(4) Quest(n).Completed = Parse(5) Quest(n).AlreadyDone = Parse(6) Quest(n).GiveExp = Val(Parse(7)) Quest(n).GiveItem = Val(Parse(8)) Quest(n).GiveItemVal = Val(Parse(9)) Quest(n).TakeItem = Val(Parse(10)) Quest(n).TakeItemVal = Val(Parse(11)) Quest(n).NpcStart = Val(Parse(12)) Quest(n).ItemStart = Val(Parse(13)) ' Save it Call SendUpdateQuestToAll(n) Call SaveQuest(n) Call AddLog(GetPlayerName(Index) & " saved quest #" & n & ".", ADMIN_LOG) Exit Sub End If |
Author: | addy [ Tue Dec 02, 2008 11:59 pm ] |
Post subject: | Re: Quest Editor Problem |
Nobody knows? |
Author: | Anthony [ Wed Dec 03, 2008 12:27 am ] |
Post subject: | Re: Quest Editor Problem |
Your Sub or Function that you are trying to call is not defined... What does it highlight? |
Author: | addy [ Wed Dec 03, 2008 1:22 am ] |
Post subject: | Re: Quest Editor Problem |
Code: ' Update the item Quest(n).Name = Parse(2) Quest(n).SayStart = Parse(3) Quest(n).NotReady = Parse(4) Quest(n).Completed = Parse(5) Quest(n).AlreadyDone = Parse(6) Quest(n).GiveExp = Val(Parse(7)) Quest(n).GiveItem = Val(Parse(8)) Quest(n).GiveItemVal = Val(Parse(9)) Quest(n).TakeItem = Val(Parse(10)) Quest(n).TakeItemVal = Val(Parse(11)) Quest(n).NpcStart = Val(Parse(12)) Quest(n).ItemStart = Val(Parse(13)) It only highlights the first line about quest but thats because thats the first error it gets. Its pretty much the whole quest thing isnt defined. And it has the Sub thing at the top. |
Author: | Forte [ Wed Dec 03, 2008 11:51 am ] |
Post subject: | Re: Quest Editor Problem |
did you define all of them in QuestRec? |
Author: | addy [ Wed Dec 03, 2008 8:55 pm ] |
Post subject: | Re: Quest Editor Problem |
You shouldnt have to. The variable is defining like a data thing. |
Author: | Rian [ Wed Dec 03, 2008 9:11 pm ] |
Post subject: | Re: Quest Editor Problem |
addy wrote: You shouldnt have to. The variable is defining like a data thing. lolwut. You seem so sure of yourself but your argument makes no sense. This is what Forte was talking about, and I'm willing to bet it's what you're missing: Code: Type QuestRec
Name As String SayStart As String NotReady As Byte Completed As Byte AlreadyDone As Byte GiveExp = As Integer GiveItem As Byte GiveItemVal As Byte TakeItem As Byte TakeItemVal As Byte NpcStart As Byte ItemStart As Byte End Type |
Author: | addy [ Wed Dec 03, 2008 10:38 pm ] |
Post subject: | Re: Quest Editor Problem |
Nope that wasnt it. I tried it and i thought it was going to work but i guess not. Things i guess that MIGHT just help you. The server opens up and it works but that error only pops up when i turn on the game and try logging in. Then it stops the game and the server it just pauses. Then the .thing here at all its just the first part gets highlighted. Its just the Quest part not the (n).sayStart or whatever the case would be. |
Author: | Matt [ Wed Dec 03, 2008 11:43 pm ] |
Post subject: | Re: Quest Editor Problem |
Public Quest as questrec Something like that maybe? |
Author: | addy [ Wed Dec 03, 2008 11:48 pm ] |
Post subject: | Re: Quest Editor Problem |
Nope not it. I dont think its because its not defined so it shouldnt be that Questrec thing. Its because it doesnt think its in a Sub and its all alone. I think its the placing but im not sure. Hopefully someone will figure out or ill have to rewrite and write a thing from scratch |
Author: | Matt [ Thu Dec 04, 2008 1:50 am ] |
Post subject: | Re: Quest Editor Problem |
Public Map As MapRec That right there, is what allows you to do map.name and such. You need one for the questrec, otherwise you'll never get it to work. Your questrec is needed, first off, because you're trying to use a user defined type (UDT) and it has to be defined. Then, you have to define something else, AS that UDT, in order to use the UDT. Without that, it won't work. That's most likely your issue. Other examples: Public TempTile(0 To MAX_MAPX, 0 To MAX_MAPY) As TempTileRec Public Player(1 To MAX_PLAYERS) As PlayerRec Public Class() As ClassRec Public Item(1 To MAX_ITEMS) As ItemRec Public Npc(1 To MAX_NPCS) As NpcRec Public MapItem(1 To MAX_MAP_ITEMS) As MapItemRec Public MapNpc(1 To MAX_MAP_NPCS) As MapNpcRec Public Shop(1 To MAX_SHOPS) As ShopRec Public Spell(1 To MAX_SPELLS) As SpellRec |
Author: | addy [ Thu Dec 04, 2008 2:36 am ] |
Post subject: | Re: Quest Editor Problem |
Perfekt, i dont know how your always right ha. Well you got it thanks for everybody's help. |
Author: | Lea [ Thu Dec 04, 2008 3:24 am ] |
Post subject: | Re: Quest Editor Problem |
addy wrote: Perfekt, i dont know how your always right ha. lol |
Author: | Matt [ Thu Dec 04, 2008 3:34 am ] |
Post subject: | Re: Quest Editor Problem |
I'm hardly always right. Lol. Ask Lea and Robin. They both know. XD I just looked at your problem, looked at Rian's suggestion, and figured it out. |
Page 1 of 2 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |