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

Elenfir

Members
  • Posts

    63
  • Joined

  • Last visited

    Never

Everything posted by Elenfir

  1. Put it in the recruitment thread. And generally if you want anyone to help you develop a game you need more (ALOT more) of an idea. "Making a game like runescape" is generally not enough. Try to think of a great story that captures someones interest. Just my 2 cents…
  2. I don't have the source code in front of me. Haven't been working on any Eclipse projects or VB6 for that matter. But if my memory serves me well I think that particular calculation is in the DamagePlayer/Npc Sub
  3. Well I'm guessing you saved his skill level serverside and that skillbox is clientside. Which means you need to send the data from server to client. First of you need to tell the server that you need the specific variable. Go to the modGameLogic And add a new sub ``` Public Sub GetPlayerSkills(ByVal Index As Long) Call SendData("getplayerskills" & END_CHAR) End Sub ``` This sends a string to the server requesting the variable. You also need something to get the answer and assign it to your caption once the server replies. So in modHandledata client side you need a new case: ``` If casestring = "setplayerskills" Then NAMEOFTHELABEL.Caption = Val(parse(1)) Exit Sub End If ``` NAMEOFLABEL is the name of the label you wanna rename. And server side you need to obtain the value from the playerfile and send it back to client. Plus you need something that receives the command to send it. So go to modHandleData in the server and add a new case ``` Case "getplayerskills" Dim File As String Dim Skill As String File = App.Path & "\playerfiles\" & GetPlayerName(Index) & ".ini" Skill = GetVar(File, "SKILLS", "skill") Call SendDataTo(Index, "setresistances" & SEP_CHAR & skill & END_CHAR) Exit Sub ``` When you click to open your skills tab you can call the GetPlayerSkill sub. Or better yet is to create a variable that you load when you start your game so it only loads once and not everytime you open your skilltab. But then you also need to add a sub that sends the skill variable to the client each time you level up so it doesn't require a restart. Works but not perfect. You need to edit some values so that it fits your project but this should give you a general idea on how server/client works.
  4. The code in the first post works excellent. I've just had alot to do at work lately so the additions to the NPC editor and sourced spellcasting aren't implemented yet. But works well in scriptform. The only thing that this lacks is a range calculator but that is quite an easy fix. If you can't solve the range calc then PM me and I can guide you through it.
  5. Are you using Trim(parse(1)) or Val(Parse(1)) and try switching them :)
  6. Mismatch is often an error you get when trying to assign a value to a variable that cannot hold that type of value. If you've set the variable as long you should have no problem with assigning 5 to it. But if you've set it as string try doing this: Call OnShowLabel(Index, "5"). that should do it :)
  7. What type of value would you like to display I wonder? But none the less. Add this to the server code ``` Sub ShowOnLabel(Index As Long, ByVal valueOfItemInventory As Long) Call SendDataTo(Index, "showonlabel" & SEP_CHAR & valueOfItemInventory & END_CHAR) End Sub ``` In client source modHandleData, add a new case ``` Case "showonlabel" frmMirage.LABELNAME.Caption = Val(Parse(1)) Exit Sub ``` Replace "LABELNAME" with the name of the label you want to show. Also, if you want it to send text instead change the ByVal valueOfItemInventory As Long, to: ByVal valueOfItemInventory As String. And change Val(Parse(1)) to Trim(Parse(1)). Now you can call the sub from sadscript by typing Call ShowOnLabel(Index, VALUE), where value is the thing the label will display. Hop this helps you
  8. Not sure I understand what you want to do? Could you elaborate?
  9. Elenfir

    Mac?

    I run Eclipse and vb6 on a intel mac OSX10.6\. Try downloading winebottler and make it to an .app
  10. Just remembered btw, if you use Eclipse Stable I think the file you want to edit is named OnAttack.ess.
  11. Elenfir

    On NPC death

    Open the server, press ctrl+F, and enter You've killed and you'll find it.
  12. Elenfir

    Few Questions….

    And dpon't forget that they need to download the libraryfiles.
  13. There is a tutorial on a actionbar. And I might post mine as which can hold macros, items and spells. Still need to fix some stuff with it tho…
  14. Thanks! Gotten abit further, still some loose ends. Going away for 2 weeks starting monday, but after that it shouldn't be long before I can post a full source. Also new Feature added. You can Now choose Ranged, MeleeBrave, MeleeWimp, Wimp and MeleeCaster as AI setting for the NPCs. What the different additions do: Ranged: Tries to keep the player at a range of X when combat is initiated. MeleeBrave: Act as the normal NPCs do, try to get close and attack MeleeWimp: Act as MeleeBrave except that the npc will switch behavior after reaching a certain % of their hitpoints. So let's say you set the wimpy at 10% and the NPC has 1000 HP. Once it reaches 100 or less in HP it will try to flee. Wimp: Might not be useful but since I made the MeleeWimp it was a quite small edit. Once combat is initiated the Wimp NPC will try to flee no matter his condition. MeleeCaster: Is a sort of mage and uses a mix of the ranged, MeleeBrave and MeleeWimp setting. They have 2 modifiers that controls their actions, Mana and HP. If the mana goes below X% he will switch to melee. But he also has the wimpy setting. So if he reaches X% Hp he will try to flee. And I've also made a conditioner so that if the NPC is fleeing when he gets low on mana he will not switch behavior but keep fleeing. I want to add RangedWimpy, working on that now and also adding the mana condition to the Ranged AI. Still abit unsure on how to handle it tho. Still need to solve arrows for NPCs. But since I still haven't dared to dig into the blt commands I'm afraid this will take awhile. All of the above is tested and work quite good. Still some minorbugs when they switch behavior and when they are resetting their targets. And I still need to add a setting for NPC movementspeed. But hopefully I'll have all of this fully working and bugfree in a month or so :) Glad that you liked it. :)
  15. Hmm sounds weird if he has DirectX installed. Installed the Library files aswell (Altho I have a hard time believing that they could cause a DirectDraw error)
  16. added, send your Main.txt through MSN and I'll add it. But make sure to read the tutorials about scripting, that way you can easily read out what this code actually does and insert it correctly into the scripting file. Goes for all scripts ofc. Not just this one.
  17. > uh.. for arrows.. try making a weapon.. and checking the "bow" button… then select an arrow... > and for melee attacks just call an animation in "on attack" like mentioned above. Making a weapon with the bow type isn't really the same as the script above. The bow type only makes the weapon fire ranged and thus blting an arrow travelling in the direction the player is facing (until hit or max range). The above code plays an animation on the target when the arrow hits, and if the arrow deals less then 1 dmg it plays another "miss" animation. Also it randomizes the animation played on hit. I have all custom animations in my game but if I remember it correctly there are like 3-5 different "slash" animations in Eclipse. To make this script even cooler (once again in my opinion) I'd make a sourceedit adding a scrollbar to the itemeditor making a new type called like proficiency and make some types named like axe, sword etc etc, then edit the OnAttack to send that data to the script. Then you could have different animations depending on what type of weapon you are wielding.
  18. I'd recommend reading this (Credits to Marsh for making it): [http://www.touchofdeathforums.com/smf/index.php/topic,1947.0.html](http://www.touchofdeathforums.com/smf/index.php/topic,1947.0.html) Cause, once again, like Kreator said, it sounds like you don't really know how the layers work. And tbh if you don't know how they work, your maps will be plain. And I'm not talking badly made, I'm talking soccerfield plain.
  19. No .ini data needed Open your Main.txt and look for the code at the top of my post and then replace it with anyone of my 3 code boxes. Log in to your game as an administrator. Type /editspells (or /editspell can't remeber). Choose spell 1 (The one that says 1: ). Here you don't need to enter anything, skip to the animation part. Here you will select the first slash animation (What you want it to show when you hit with melee). Do the same for 2: and 3: and here enter different animations for a slash. I think there is like 3-4 different slash animations in the basic animationdb that comes with eclipse. Do the same with 4: - 6: but here you choose the animations you want to play when an arrow hits. Then you choose 7: here you wil enter a miss animation for melee. And at 8: enter a miss animation for arrow miss. You can name them "Slashanim1", "Slashanim2" and so on, the name doesn't really matter. Then copy/paste the code below into your Main.txt (located in server\Scripts). Use the search function and find Sub OnAttack and select it all down to the place (like 10 lines down) where it says End Sub. Replace that code with the code below ``` ' Executes when a player presses the CONTROL key. Sub OnAttack(Index, Damage) Dim Target Dim RndRoll If Int(Damage) > 0 Then RndRoll = rand(1,3) If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call SpellAnim(RndRoll, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call SpellAnim(RndRoll, GetPlayerMap(Index), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If Else If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Damage = 0 Call SpellAnim(7, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Damage = 0 Call SpellAnim(7, GetPlayerMap(Index), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If End If End Sub ``` Then do the same but instead search for Sub OnArrowHit (should be directly below). And replace that whole thing to End Sub with the code below: ``` Sub OnArrowHit(Index, Damage) Dim Target Dim RndRoll If Int(Damage) > 0 Then RndRoll = rand(4,6) If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call SpellAnim(RndRoll, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call SpellAnim(RndRoll, GetPlayerMap(Target), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If Else If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Damage = 0 Call SpellAnim(8, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Damage = 0 Call SpellAnim(8, GetPlayerMap(Index), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If End If End Sub ``` I donno how to explain it any easier. If you still have trouble installing this with these guidelines I'd recommend you to read some very very basic scripting tutorials since this code is very easy to install. Feel free to ask any questions you have but please try this first before asking. If you can't get it to work I'll be happy to try and answer your questions to the best of my ability :) EDIT: I'd recommend this tutorial (Credits to Squiddle for making it ;)) [http://www.touchofdeathforums.com/smf/index.php/topic,39867.0.html](http://www.touchofdeathforums.com/smf/index.php/topic,39867.0.html) There is a Chapter 2 aswell. Might get you to learn the basics of scripting. Even when adding scripts you need to have at least a basic knowledge of how the Main.txt is built. My guess is that it will take you 10-20 mins to understand the structure. And after that you'll find it easy to add new scripts here from the forums.
  20. You get 1 point, to change Find: ``` Sub PlayerLevelUp(Index) Dim TotalExp Do While GetPlayerExp(Index) >= GetPlayerNextLevel(Index) TotalExp = GetPlayerExp(Index) - GetPlayerNextLevel(Index) Call SetPlayerLevel(Index, GetPlayerLevel(Index) + 1) Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + 1) Call SetPlayerExp(Index, TotalExp) Loop Call BattleMsg(Index, "You have " & GetPlayerPOINTS(Index) & " stat points.", BRIGHTBLUE, 0) End Sub ``` This line….. ``` Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + 1) ```…. Tells how many points the player gets at levelup. Change the "+ 1" to the amount you want the player to get, let's say you want them to have 5 points then you type it like this: ``` Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + 5) ``` Hope this helps you
  21. You need to access your firewall(or router) and add a rule that says basically: Traffic adressing IP X.X.X.X on port 4001 should be directed to the computer with LAN IP X.X.X.X and port 4001. It's very easy. Usually you access your router typing 10.0.0.1 OR 192.168.0.1 OR 192.168.1.1 OR 192.168.0.254 OR 192.168.1.254 in the Firefox/Internet Explorer/Chrome/Safari adress field :)
  22. It's a shame to be honest. I got my degree in sweden a couple of years ago and here it's learn or get kicked out. I like that better. I would have commit Harakiri on the spot if my courses were made for the slow student to follow.
  23. Well you should read alittle about spellanimation (think there is an excellent tutorial for that somewhere here) if you want them to work. But let's assume that you use Spell 1 as animation for slash and spell 2 as animation for Arrowhit. Find: ``` ' Executes when a player presses the CONTROL key. Sub OnAttack(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call DamageNPC(Index, Target, Damage) End If End If End Sub Sub OnArrowHit(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call DamageNPC(Index, Target, Damage) End If End If End Sub ``` And replace the entire sub with: With the entire sub I mean everything you see in the box above (tbh it's even 2 subs and not one ;)). ``` ' Executes when a player presses the CONTROL key. Sub OnAttack(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call SpellAnim(1, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call SpellAnim(1, GetPlayerMap(Index), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If End If End Sub Sub OnArrowHit(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call SpellAnim(2, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call SpellAnim(2, GetPlayerMap(Target), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If End If End Sub ``` And if you want a miss animation or rather an animation that plays if you do 0 or less damage add the code below. NOTES: Threw in alittle edit aswell where all damage below 0 will display 0 instead of -14, -10 etc etc…. The below script assumes that you use spell 3 as miss for melee, and spell 4 as miss for arrows. ``` ' Executes when a player presses the CONTROL key. Sub OnAttack(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call SpellAnim(1, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call SpellAnim(1, GetPlayerMap(Index), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If Else If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Damage = 0 Call SpellAnim(3, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Damage = 0 Call SpellAnim(3, GetPlayerMap(Index), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If End If End Sub Sub OnArrowHit(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call SpellAnim(2, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call SpellAnim(2, GetPlayerMap(Target), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If Else If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Damage = 0 Call SpellAnim(4, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Damage = 0 Call SpellAnim(4, GetPlayerMap(Index), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If End If End Sub ``` Hope that this helps you. EDIT: Just to make this script alittle bit cooler (or atleast in my opinion) you could do a randomized slash animation aswell. Let's say you make 3 different slash animation (1-3 in the spelleditor) and 3 different arrowhot animations (4-6 in the spelleditor) Misses in the below code will be 7 for melee and 8 for arrows. ``` ' Executes when a player presses the CONTROL key. Sub OnAttack(Index, Damage) Dim Target Dim RndRoll If Int(Damage) > 0 Then RndRoll = rand(1,3) If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call SpellAnim(RndRoll, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call SpellAnim(RndRoll, GetPlayerMap(Index), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If Else If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Damage = 0 Call SpellAnim(7, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Damage = 0 Call SpellAnim(7, GetPlayerMap(Index), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If End If End Sub Sub OnArrowHit(Index, Damage) Dim Target Dim RndRoll If Int(Damage) > 0 Then RndRoll = rand(4,6) If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call SpellAnim(RndRoll, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call SpellAnim(RndRoll, GetPlayerMap(Target), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If Else If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Damage = 0 Call SpellAnim(8, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target)) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Damage = 0 Call SpellAnim(8, GetPlayerMap(Index), GetNPCX(GetPlayerMap(Index), Target), GetNPCY(GetPlayerMap(Index), Target)) Call DamageNPC(Index, Target, Damage) End If End If End Sub ``` This will display a random spellanimation between 1-3 when you hit melee and 4-6 when you hit with arrows. Sorry if I spam code, but takes alot of place when pasting full subs. And once again hope that this solves your problem and that you find it useful.
  24. Not exactly sure what you want but if you want an animation that plays each time you hit an NPC or player with a sword or arrow you could do it like this: Find: ``` Sub OnAttack(Index, Damage) ``` Find the snippet below and add the call spellanim line and exchagne SpellNo with the spellnumber that holds the slash animation. And do the same for the OnArrowHit sub. Don't have the scripting file infront of me so don't remeber exactly what it looks like. ``` If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call SpellAnim(SpellNo, GetPlayerMap(Target), GetPlayerX(Target), GetPlayerY(Target) Call DamagePlayer(Index, Target, Damage) Else ``` This will add an animation that plays each time your damage is above 0\. If you want a "miss" or equal add an Else Case to the "If Int(Damage) > 0" condition and do another Call SpellAnim but with the spellnumber of a missanimation. Donno if it was this you were looking for, if it was you can post here and I can post the entire attacksub with the changes when I get home.
×
×
  • Create New...