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

tehl33tjim

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Everything posted by tehl33tjim

  1. This could be an interesting addition to my game. I wouldn't want to use it as descriptions, but maybe for small random bits of info. Like the known minerals in the area, or something. Hmmm…this definitely has potential.
  2. Sorry for not clearing this up earlier. I did get it to work, the major problem being a stupid one (forgetting to specify the form at one end.) Thank you guys for your help regardless. :)
  3. I do have SAnnouncements under the ModEunumerators ServerPackets list (on both Client and Server) At the bottom of Server's modPlayer I have: ``` Public Sub sendAnnouncements(ByVal text As String) Dim buffer As clsBuffer Set buffer = New clsBuffer buffer.WriteLong SAnnouncements buffer.WriteString frmServer.txtAnnouncements.text SendDataToAll buffer.ToArray() Set buffer = Nothing End Sub ``` On frmServer I have a new tab for announcements, with txtAnnouncements and cmdSendAnnouncements. When I went to compile I would get the "Argument not Optional" error, highlighting "Call sendAnnouncements" until I changed it to what I have below: ``` Public Sub cmdSendAnnouncement_Click() Call sendAnnouncements(frmServer.txtAnnouncements.text) End Sub ``` Now it works perfectly. But I agree that it should not require that argument.
  4. I think I have the logic down, but I'm terrible at figuring out the correct syntax for this stuff. What I want to accomplish: Have a simple label on the Client (maybe even a picture box in the future) - normally this will have a (lblAnnouncement.caption = "No Announcements"), but I want to make a txtAnnounce text box and button (on the server form) that upon pressing will change the lblAnnouncement.caption.Client = txtAnnounce.text.Server for all players. I understand the basics of putting the actual pieces onto the windows (the txtBox and labels, etc). But I have no idea how the whole sending packets works. I assume I would also need something on form_load for the client's frmMain, but again - I don't know how to send stuff from the server to the clients. Can anybody point me in the right direction for that? I would appreciate it greatly, and it would be great to learn.
  5. No I don't, and at the moment have no interest in it. I appreciate the help, but I'd rather not somebody else just fix my code. I want to learn why it's acting the way it is, otherwise I won't get any better. I just want to know why that variable keeps getting flooded as it is. There has to be some reason. The NPC version has an almost identical structure (sans replacing Item with NPC), and it works perfectly. It can't be that the scroll-bar's maximum value is set to 1, why would that overflow the variable? That doesn't make sense - mostly because it should only go up to 1 - but also because I have another scroll-bar with a maximum value set to 1, and that works. [Edit]I figured it out. Everything is working now, and I'm pretty sure I understand why too.[/edit]
  6. But that makes no sense, because I have another scrlbar for NPC's Armor, and that works perfectly with the max value set to 1. And I'd like to learn this stuff myself, instead of having somebody do it for me.
  7. I have since changed the Pierce and Armor variables to Long, and now to Byte. My Armor works on NPCs, not errors at all. But my variables for Pierce always give me an error. Now I get one constantly. I get error 380: ``` frmEditor_Item.scrlPierce.Value = .Pierce ```is highlighted within ModGameEditors Mouseover the first half gives me: ``` frmEditor_Item.scrlPierce.Value = 0 ``` Mouseover .Pierce gives me: ``` .Pierce = 255 ``` When it was a Long variable, it gave me an overflow with .Pierce = 66555 or whichever specific number it was. So what is causing this to happen? I now have a scrlPierce, min = 0, max = 1 ``` Private Sub scrlPierce_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub If scrlPierce.Value = 0 Then lblPierce.Caption = "Pierce: No" ElseIf scrlPierce.Value = 1 Then lblPierce.Caption = "Pierce: Yes" End If Item(EditorIndex).Pierce = scrlPierce.Value ' Error handler Exit Sub errorhandler: HandleError "scrlPierce_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub ``` Anything look suspicious to anyone?
  8. Well in [at least the early] final fantasy games, there were usually certain weapons that dealt more damage to certain types of monsters, without specifically stating it. Silver weapons could do extra damage to undead, or werewolf types. Stuff like that. It's not difficult at all to add resistance values as well, or even absorb so that when you cast Fire on that FlameTurtle it will get healed instead. ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons//wink.png)
  9. See, if 0 = unchecked/false, and 1 = checked/true, there shouldn't be any error, right? The checkbox value is never set to 2/grayed by the user. This also only happened AFTER I had checked an item with the .armor (piercing) attribute. After that, upon selecting it from the list it gives me the error. I can still select and view the info/change the info for all other items. I can even change the state of the checkbox. But if it is checked, and I go back to check it, I get the 380. I wonder if order I place the code in, under the ModGameEditor module, is the issue?
  10. > Yea that will work. > > Checkboxes have 3 values. 0 = grayed, 1 = unchecked, 2 = checked. So setting a value of greater than 1 to a boolean value will generate an error. You can use a select case and check if the value of the checkbox is 1 or 2 and subtract the value with 1 and save it as a boolean (since false = 0 and true = 1) Or you can just change the boolean to a byte and the rest will be done for you. I thought that grayed=2\. So that's why. Gonna try it out in a bit. Well wait, that can't be. Because I did the same thing for NpcRec, added as a Boolean. I did everything the same, and there are no errors for that…hmmm....
  11. Should I just swap out the chkbox for a scrlbar? .Min = 0 and .Max=1? That should still work with a boolean, right?
  12. I get a Runtime Error 380, and it highlights this in ModGameEditors: ``` frmEditor_Item.chkPierce.Value = .Armor ``` I have that declared in ModTypes, under the ItemRec as a Boolean on both the client and the server. This happens when I am in game when I access the item editor for the one item that I had checked (true'd) the chkbox for. And the code for that chkbox is as follows: ``` Private Sub chkPierce_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If chkPierce.Value = 0 Then chkPierce.Caption = "Pierce: No" ElseIf chkPierce.Value = 1 Then chkPierce.Caption = "Pierce: Yes" End If Item(EditorIndex).Armor = chkPierce.Value errorhandler: HandleError "chkPierce_Click", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub ``` Although I can't see that being the problem - it does only happen when this chkbox and it's _Click code is present on the form. What am I missing?
  13. ~~How, uh…do I do that?~~ Nevermind. Didn't realize I had to pop into full editor.
  14. I was going to work on that this morning, actually. Theoretically, it should be very similar. Add a new variable to SpellRec, and then add the appropriate code under SpellEditInit in the ModGameEditors module. Add a scrollbar/label to the spell editor, set it up like we did for items and npcs. If the ModCombat sub is similar to regular combat, it should just require that last if-statement [ if spell(player).element = npc(npcnum).element then damage = damage * 2 ] If I get time to mess around with it, I'll update the main post.
  15. Hey guys, this is my first tutorial, and getting everything down pat with much help from Abhi, I present to you: **Adding Elemental Properties to Weapons, and NPCs that are Weak to those Elements.** We will be editing both the Client and the Server in this tutorial. It is not all that difficult, but I was surprised that there wasn't a tutorial of this nature to be found on here. What this will ultimately do is add a new variable to items, and to NPCs. Then we will have the server check to see if the weapon you are using and the NPC you are fighting both have the same value for this variable. If they do in fact both match, extra stuff will happen (in this tutorial I use a simple 2x damage modifier). With that being said… **[Updated marsh 30th, 2013]** ~Fixed a simple bug in ModCombat, where if neither the currently equipped weapon nor the victim have no element, they do not take elemental damage. Open up your **Client** in VB6- In the **_ModTypes_** Module; In:``` Private Type ItemRec ``` At the bottom after the last variable (usually ToolReq), add: ``` Element as Long ``` In:``` Private Type NPCRec ``` At the bottom after the last variable (usually Level), add: ``` Element as Long ``` In the _**ModGameEditors**_ Module; In``` ItemEditorInit ``` Near the bottom, you will want to add: ``` frmEditor_item.scrlElement.value = .element ``` And then in [codeNpcEditorInit[/code] Directly after: ``` .txtDamage.text = Npc(EditorIndex).Damage ``` Put: ``` .scrlElement.Value = Npc(EditorIndex).Element ``` In the _**FrmEditor_Item**_ Form; Create a new _scrollbar_ with the following properties: * (Name): scrlElement * Max: 5 * Min: 0 Create a label nearby, with the following properties: * (Name): lblElement * Caption: E: None Double click on the scrlElement and add this to the scrlElement_Change sub: ``` ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub If scrlElement.Value = 0 Then lblElement.Caption = "E: None" ElseIf scrlElement.Value = 1 Then lblElement.Caption = "E: Fire" ElseIf scrlElement.Value = 2 Then lblElement.Caption = "E: Ice" ElseIf scrlElement.Value = 3 Then lblElement.Caption = "E: Bolt" ElseIf scrlElement.Value = 4 Then lblElement.Caption = "E: Holy" ElseIf scrlElement.Value = 5 Then lblElement.Caption = "E: Dark" End If Item(EditorIndex).Element = scrlElement.Value ' Error handler Exit Sub errorhandler: HandleError "scrlElement_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub ``` Do the exact same thing in **_frmEditor_NPC_** form. (add the scrollbar, label, and change the subroutine). Next, we're going to want to open up the **Server** to make some changes. In the **_ModTypes_** Module; In:``` Private Type ItemRec ``` At the bottom after the last variable (usually ToolReq), add: ``` Element as Long ``` In:``` Private Type NPCRec ``` At the bottom after the last variable (usually Level), add: ``` Element as Long ``` (this is exactly the same as you did in the Client, nothing difficult here). In _**ModCombat**_; Look for the sub: ``` Public Sub TryPlayerAttackNpc(ByVal index As Long, ByVal mapNpcNum As Long) ``` Shortly underneath that you will find a snippet: ``` Damage = GetPlayerDamage(index) ``` Underneath that, paste this: ``` ' Double the damage if npc's element matches our weapon's element (i.e., the npc is weak to our weapon) If GetPlayerEquipment(index, weapon) 0 Then If Item(Player(index).Equipment(Equipment.weapon)).Element 0 Then If Item(Player(index).Equipment(Equipment.weapon)).Element = Npc(npcNum).Element Then SendActionMsg mapNum, "Super Effective!", BrightCyan, 1, (GetPlayerX(index) * 32), (GetPlayerY(index) * 32) Damage = Damage * 2 End If End If End If ``` What that does is: first it checks to make sure we have a weapon equipped, then it runs the check - to see if the weapon's element matches the enemy's weakness element. And if so, damage is doubled. And I added an annoying SendActionMsg popup - which you should definitely not keep. Just there so you can make sure you did this correctly. **_-Save_** **_-Compile_** **_-Run_** And that should be it. You can always change the Max limit on both of the scrollbars to however high you want. It doesn't have to be actual elements, you can make them specific weapon types (make an Armored Mob who is weak against piercing spears, or something). If you guys have any questions, or bugs, please let me know. Good luck!
  16. For some reason when I go to compile the Client, after adding the frmEditor_item.scrlElement.value = .element to the ItemEditorInit, and adding the frmEditor_NPC.scrlElement.value = .element to the NPCEditorInit, VB highlights the .Element part of the NPCInit code, and gives me an "invalid or unqualified reference". I do have a scrlElement scrollbar present on frmEditor_NPC, so wtf? [Edit]SO, I got it to work. Client compiled![/edit] –In the PlayerAttackNpc Sub (in ModCombat) - how exactly am I supposed to pull the data from the attacking Npc? In the sub, from what I understand, is pulling the variables from MapNpc. On a side note, not important to what I want to do, but where does "attacker" get defined? Throughout this entire module, it is only ever referenced, never created. [Final Edit] Figured it out. Now to make a tutorial.[/Final Edit]
  17. Hey guys, so I'm having a bit of trouble with the syntax of putting this code together. Or perhaps my logic is not the most efficient way of doing this. The concept is simple: Add a new attribute for weapons that would be considered an "element". Add those same attributes to NPCs. During combat, it would check to see if player(index).weapon.element.fire (or whatever) is true, then damage = damage x 2, else damage = damage. First off, I went Server Side: ModTypes - under ItemRec, below "ToolReq as Long" I added "Element as Long". From my understanding, this will store data as Item(index).Element, correct? -under NpcRec, below "Level as Long", I added "Element as Long" again. I repeated this in the Client's ModTypes as well. Now is where I'm lost with syntax. In FrmEditor_Item, I added a scrollbar (scrlElement), min=0, max=5 (for starters, maybe I'll add more elements later), I set up a label next to it so it will display the scrollbar value. I did the same thing in FrmEditor_NPC with a scrollbar and label. ``` Private Sub scrlElement_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub If scrlElement.Value = 0 Then lblElement.Caption = "E: None" ElseIf scrlElement.Value = 1 Then lblElement.Caption = "E: Fire" ElseIf scrlElement.Value = 2 Then lblElement.Caption = "E: Ice" ElseIf scrlElement.Value = 3 Then lblElement.Caption = "E: Bolt" ElseIf scrlElement.Value = 4 Then lblElement.Caption = "E: Holy" ElseIf scrlElement.Value = 5 Then lblElement.Caption = "E: Dark" End If ' Error handler Exit Sub errorhandler: HandleError "scrlElement_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub ``` From what I can tell, this doesn't change anything in the ItemRec's Element - so how can I do that? AND, what would be the proper syntax of calling that variable again ServerSide under the ModCombat module? Would it just be GetItem(index).Element? I think I'm going in the right direction, but a little foggy. I have added Item(EditorIndex).Element = scrlElement.Value - and it compiled with no errors. I'm still having trouble figuring out how exactly do I call that data in ModCombat. ``` GetPlayerEquipment(index, equipment).element = 3 ``` I think that is correct - but I am having difficulty with grabbing the NPC(index).Element…do I need to add an Element long variable under the MapNpcRec as well?
×
×
  • Create New...