Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Snoozey

Members
  • Posts

    75
  • Joined

  • Last visited

    Never

Everything posted by Snoozey

  1. @Joost: > I dont think you quite understand all the code. > > PS: For clarities sake, I changed Byval Index into Byval Guildname, this is because Index usually refers to the player's number, and in this case you want to use SaveGuild("GuildName"), so guildname is a more logical name. It doesnt change anything, just makes more sense. > > Oh, and yes, name should be index, but now that index = guildname it should be guildname > > ``` > Sub SaveGuild(ByVal Guildname As Long) > Dim F As Long > Dim n As Long > F = FreeFile > Open App.Path & "\data\guilds\Guildlist.txt" For Append As #F 'this opens the file > > Print #F, GuildName 'this adds the guild name to the file > Close #F 'this closes and saves the file (100% done) > 'Call SavePlayer(Index) this is pointless > End Sub > ``` > For your error, > > ``` > Function FindGuild(ByVal Name As String) As Boolean > ```Stare at that line until you see why what's below doesnt work > ``` > If FindGuild = True Then > ``` You are correct, I did not understand the code fully. It does exactly what I wanted without adding anything. Is it because it is byval name as **String?** Should it be ``` Function FindGuild(ByVal Name As Boolean) ``` I don't really understand why it is name as string) as boolean. So here is my guess. The findguild is saving it as a string The if statement is looking for a boolean. So i need to convert string into boolean? I still have no idea what the bolded part is doing Function FindGuild(ByVal Name As String) **As Boolean** Changed it to ``` If FindGuild(True) Then ```Works then compile error on ``` Call SaveGuild ```Argument not optional. Looking into it now. Changed and compile worked. testing now ``` Call SaveGuild(Guildname) ```
  2. @Joost: > ``` > Sub SaveGuild(ByVal Index As Long) > Dim F As Long > Dim n As Long > F = FreeFile > Open App.Path & "\data\guilds\Guildlist.txt" For Append As #F > Print #F, Name > Close #F > 'Call SavePlayer(Index) > End Sub > ``` I don't want to save the player. I need the file to save. I don't want someone to make a guild called guildx and then the server restart. The server restarts and comes back up. The file won't be saved meaning guildx name would be available even though guildx would exist. Unless that is not how EO works? is the problem "name"? should it be index?
  3. @Joost: > I'm not sure why you need that there? Why is it important to save the player after you've added the guild name to the guildlist? I need to replace the player part, and have it save the file. I guess is what I am getting at. Also still looking for the error, am I reading it wrong? Should my if be " If false"?
  4. @Joost: > Check out your FindGuild sub and see if you can spot the mistake yourself. Let's just say you forgot to do one small thing, you'll have to check out the FindGuild sub to find out what it is, but the mistake is not actually in the FindGuild sub but instead in the part that errored. (obviously) Looking in to it now. Also new save ``` Sub SaveGuild(ByVal Index As Long) Dim F As Long Dim n As Long F = FreeFile Open App.Path & "\data\guilds\Guildlist.txt" For Append As #F Print #F, Name Close #F Call SavePlayer(Index) End Sub ``` Still not sure what to replace saveplayer(index) with.
  5. @Joost: > I think you're copying the wrong sub, you got the sub that saves player account data to their own data file instead of the sub that saves all char names in 1 big text file. > > Actually, it's not a seperate sub, it's a little piece of code that is ran just before sub SavePlayer(). So you got pretty damn close : P. > > ``` > ' Append name to file > F = FreeFile > Open App.Path & "\data\accounts\charlist.txt" For Append As #F > Print #F, Name > Close #F > ``` Bah you are right. It is the .bin file also Compile error Highlights Find Guild and says " Argument not optional. ``` 'Check to see if guild name exists. If not Write to file If FindGuild = True Then PlayerMsg Founder_Index, "That Guild name already exists!", BrightRed Exit Sub End If ```
  6. @Joost: > You dont have to do the write to list at the Else statement. You can just do that in the final step of guild creation, when you're sure everything else is in order. For the writing part, just check the examples already in the source code for charnames. There should be a sub for it you can almost copy. Ok i moved the code down below ``` If Name = "" Then PlayerMsg Founder_Index, "Your guild needs a name!", BrightRed Exit Sub End If ```Which is the final check it seems. I figured this way it will check to make sure they actually entered a name first. Using this sub ``` Sub SavePlayer(ByVal Index As Long) Dim filename As String Dim F As Long filename = App.Path & "\data\accounts\" & Trim$(Player(Index).Login) & ".bin" F = FreeFile Open filename For Binary As #F Put #F, , Player(Index) Close #F End Sub ``` Changed it to ``` Sub SaveGuild(ByVal Index As Long) Dim filename As String Dim F As Long filename = App.Path & "\data\guilds\Guildslist.txt" F = FreeFile Open filename For Binary As #F Put #F, , Player(Index) Close #F End Sub ```Not sure on this part though. ``` Put #F, , Player(Index) ```Instead of player(Index) do I put GuildData(GuildSlot).Guild_Name = Name
  7. @Joost: > It would be the first thing I'd check when starting the process of guild creation, I wouldn't do stuff like finding GuildSlots or GuildFileID's first. > > (But Im not too familiar with the actual guild code) That makes sense actually, moved the coding to the first thing. How about the rest of it? Also Could I just make it ``` If FindGuild = True Then PlayerMsg Founder_Index, "That Guild name already exists!", BrightRed Exit Sub Else (write to list) End If ``` The problem i think with that is that If the player is already in a guild it will write to make a new guild, and then see he is in a guild and end it. Not quite sure what to do about the writing part of it.
  8. @Joost: > Yep My check in Public Sub MakeGuild. Ok looked at the wrong code. I think Founder_Index is wrong, but I am not sure what I need to replace it with to send a message back to the player. ``` If FindGuild = True Then PlayerMsg Founder_Index, "That Guild name already exists!", BrightRed Exit Sub End If ``` It is just below ``` GuildFileId = Find_Guild_Save GuildSlot = FindOpenGuildSlot ``` How does it look?
  9. @Joost: > that part of the code just compares lower case S string to lower case Name string (aka, compares namelist to new name) Ok so this function is now correct? This means I now need to Place the locations to call it If value is true end sub If value is false write to file and continue on guild making?
  10. @Joost: > Whenever someone makes a guild, you need to call that sub, if it returns True a guild with that name already exists, so send error message and cancel making the guild. If it returns true, the guild name is free. In that case you still need to add a sub to add the new guild name to the list, and then create the guild. I think that's all that needs to be done. So this part of the code is correct? ``` If Trim$(LCase$(s)) = Trim$(LCase$(Name)) Then ```
  11. This is what I have currently. I have only two problems I think. ``` Function FindGuild(ByVal Name As String) As Boolean Dim F As Long Dim s As String F = FreeFile Open App.Path & "\data\guilds\Guildlist.txt" For Input As #F Do While Not EOF(F) Input #F, s If Trim$(LCase$(s)) = Trim$(LCase$(Name)) Then FindGuild = True Close #F Exit Function End If Loop Close #F End Function ``` 1st I don't know what the guild names are. So I don't know what to have to check ``` If Trim$(LCase$(s)) = Trim$(LCase$(Name)) Then ``` I am also not quite sure where to put the call functions.
  12. @Joost: > Look at > > ``` > Function FindChar > Sub AddChar > > ``` > EO saves all the in-game names in a big text and uses that to make sure there are no 2 people named the same. Read the code and try to figure it out I guess. Well this is the guild names, not player names. looking in the guild.dats they are all exactly the same. just the owners and stuff are different. I am guessing I broke my check functions for guilds.
  13. @Joost: > ``` > Guild_Name As String * 20 > ```You tell VB its a 20 character string (text) so I would imagine the extra spaces you see are 20 - guildname. Makes sense, while testing with this I found a bug I think. not sure if it is with only my game but, I can make the same guild name multiple times. They all act independent of each other, but they all can be exactly the same. Looking for a fix right now, but I am pretty new for coding.
  14. joost you said there was a threat tutorial? Search is not coming up with anything for me. Can you post a link?
  15. Snoozey

    BOE+BOP

    @Erwin: > Bind on Equip and Bind on Pickup are still coded in but I'm not sure if they do work. They do not appear to. You can drop an items to trade it, and just straight up trade BOP items. I will fiddle with them tomorrow. Too tired to mess with it tonight. Was just gathering some info while I sleep. Will update this thread with my findings tomorrow.
  16. Snoozey

    BOE+BOP

    Been searching around, and it seems it has not been added in yet, but these posts are anywhere from 1-2 years ago. I can't find anything semi recent using the search. Are these still not coded in, or do I need to code it myself or is there a tutorial?
  17. @Sigridunset: > Thats what i posted ^^^ Ah I thought you were just talking about "some random noob" I was specifically talking about it with the party system.
  18. Another issue with this code is it will only show the loot to the last hit. Meaning if you are in a party, only the player who got the last hit can see the loot.
  19. Looking to modify spawn item sub. I would like it to check the players level. If the player is 5 levels over the monster level, it will not drop an item. I am assuming this is the code I will need to change ``` Sub SpawnItem(ByVal itemnum As Long, ByVal ItemVal As Long, ByVal mapNum As Long, ByVal x As Long, ByVal y As Long, Optional ByVal playerName As String = vbNullString) Dim i As Long ' Check for subscript out of range If itemnum < 1 Or itemnum > MAX_ITEMS Or mapNum MAX_MAPS Then Exit Sub End If ' Find open map item slot i = FindOpenMapItemSlot(mapNum) Call SpawnItemSlot(i, itemnum, ItemVal, mapNum, x, y, playerName) End Sub ``` I think this is the code I need to add for it to check, but I get an error " expected then or goto" and then it highlights NPC ``` if player(index).Level =< 5 npc(index).Level then "Spawn code" else exit sub endif ``` Any ideas? Still learning how to do this.
  20. @Soul: > Looking at the code, it looks like it does. Bug fix time! Try it out and tell me if it works. > > * * * > > At the time of posting, I do not have access to Eclipse Origins. Please make a backup before continuing! (I'm pretty sure it will work, though.) > > **Server-side**: > > First find: > ``` > Call SpawnItem(Npc(npcNum).DropItem, Npc(npcNum).DropItemValue, mapNum, MapNpc(mapNum).Npc(mapNpcNum).x, MapNpc(mapNum).Npc(mapNpcNum).y) > > ``` > and change it to: > ``` > Call SpawnItem(Npc(npcNum).DropItem, Npc(npcNum).DropItemValue, mapNum, MapNpc(mapNum).Npc(mapNpcNum).x, MapNpc(mapNum).Npc(mapNpcNum).y, GetPlayerName(attacker)) > > ``` This is working correctly for me currently. I am hoping I just derped and forgot to compile when I said it did not.
  21. When I send a message the guild chat looks like this [Guild name here ] Snoozey: Hello Any ideas?
  22. @Soul: > Hmm, that's weird. I was almost sure that would work. > > The SpawnItem function is a wrapper function for SpawnItemSlot. There's a really important line in SpawnItemSlot: > ``` > MapItem(mapNum, i).playerName = playerName > > ``` > as you can see, that influences your pickup code: > ``` > ' no lock or locked to player? > If MapItem(mapNum, mapItemNum).playerName = vbNullString Or MapItem(mapNum, mapItemNum).playerName = Trim$(GetPlayerName(index)) Then > CanPlayerPickupItem = True > Exit Function > End If > > ``` > So it sets the "lock", so to speak. It certainly reserves the item. I'll test it when I get the chance, but make sure that you've compiled it and all that. Hm, When I did full run compile it did not appear to work. Now I actually compiled it worked. I think I am loosing my mind haha. Anyways the original code appears to be working now. Will post if it stops working. I could of swore I compiled it the first timeā€¦ Thanks for the help!
  23. No dice sadly, but if I am not mistaken won't that new code just send a request for the player who killed it. Not reserve the item. hm, I am going to have a look at the drop item coding. It seems that is working properly. I will post what I can find, but I am very new at this. I think this is the code I need to duplicate. I am assuming "locked" means reserved for the player. A lot of jibberish to me, not quit sure how to go about this. ``` Function CanPlayerPickupItem(ByVal index As Long, ByVal mapItemNum As Long) Dim mapNum As Long mapNum = GetPlayerMap(index) ' no lock or locked to player? If MapItem(mapNum, mapItemNum).playerName = vbNullString Or MapItem(mapNum, mapItemNum).playerName = Trim$(GetPlayerName(index)) Then CanPlayerPickupItem = True Exit Function End If CanPlayerPickupItem = False End Function ```
  24. @Soul: > What's the expected behavior and what's the actual behavior?` From searching Loot stealing I found topics about items dropping Example Expected Player A kills monster Monster drops swords Player A sees sword Player B sees nothing Actual Player A kills monsters Monster drops sword Player A sees sword Player B sees sword. This allows play b to steal the item from Player A
  25. Been using the search and it seems there already is a feature in game for this, but it is not working on my game. (tried a fresh install too) When you kill a monster it drops an item. It seems everyone on the map can see the item instantly. Now, that I think of it. I am testing it with my self. Is this based of IP so the same IP can see the drops?
×
×
  • Create New...