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

Octohunter

Members
  • Posts

    307
  • Joined

  • Last visited

    Never

Everything posted by Octohunter

  1. The select case part is supposed to be in there too, it's just that I didn't add it. Also, what do you mean by unclear?
  2. Use a loop. ``` For i = 1 to 5 Case DIR_UP NpcX = MapNpc(mapNum).Npc(mapNpcNum).x NpcY = MapNpc(mapNum).Npc(mapNpcNum).y + i Next ```
  3. The check used when spellcasting is based off Eclipse's targeting function. My ranged system works in much the same way as the one in Eclipse Evolution did; you aim manually by lining yourself up with your target, then press Control to shoot them. It's a simple modification to the CanPlayerAttackNpc sub, replacing one of the checks with a loop. I was thinking of a function that could determine whether an NPC was at the coordinates x, y, and if so, assign a variable that NPC's value and have it execute the remainder of the code with the variable replacing mapNpcNum. Unfortunately, I can't seem to find the necessary function to detect a NPC at a certain point.
  4. OK, so I've been trying to code a ranged weapon system into my game, Alliance. However, it's not working very well; whenever I aim at an NPC with another NPC behind it, the code compares the listings of the two NPCs in the map editor and executes the PlayerAttackNpc sub depending on which one comes first (e.g. Npc1 is the first NPC listed in the map editor and Npc2 is the second; when both of them are lined up and Npc2 is in front of Npc1, the attack gives priority to Npc1 instead of Npc2.) I happen to be sure of this because when the higher listed NPC steps out of the firing line, the target immediately becomes the other NPC. Any ideas? Also, another question: Can you write a loop within another loop, such as… For... For... insert code here Next Next because when I do this, VB gives me a compilation error saying "Next without For". Help would be appreciated, as I'm relatively new to the VB6 language.
  5. Are you planning on adding scripted spells anytime soon? ;)
  6. Octohunter

    Ranged

    Make a variable called Range, then put a loop somewhere in the CanPlayerAttackNpc sub (which is found in the server). Namely, in this part. ``` Select Case GetPlayerDir(attacker) Case DIR_UP NpcX = MapNpc(mapNum).Npc(mapNpcNum).x NpcY = MapNpc(mapNum).Npc(mapNpcNum).y + 1 Case DIR_DOWN NpcX = MapNpc(mapNum).Npc(mapNpcNum).x NpcY = MapNpc(mapNum).Npc(mapNpcNum).y - 1 Case DIR_LEFT NpcX = MapNpc(mapNum).Npc(mapNpcNum).x + 1 NpcY = MapNpc(mapNum).Npc(mapNpcNum).y Case DIR_RIGHT NpcX = MapNpc(mapNum).Npc(mapNpcNum).x - 1 NpcY = MapNpc(mapNum).Npc(mapNpcNum).y End Select If NpcX = GetPlayerX(attacker) Then If NpcY = GetPlayerY(attacker) Then If Npc(npcNum).Behaviour NPC_BEHAVIOUR_FRIENDLY And Npc(npcNum).Behaviour NPC_BEHAVIOUR_SHOPKEEPER Then CanPlayerAttackNpc = True Exit Function Else If Len(Trim$(Npc(npcNum).AttackSay)) > 0 Then PlayerMsg attacker, Trim$(Npc(npcNum).Name) & ": " & Trim$(Npc(npcNum).AttackSay), White End If End If End If End If ```That's about it. If you don't know how to use a loop or implement a variable, I suggest you study the engine more. If you do all this properly, you should achieve something close to the desired result. There's a little bug in it, though; if you try to shoot and there are 2 NPCS in the same direction that are both within range, it'll pick the NPC that is first listed in the map editor and shoot it as opposed to the one that is closer. I'm really not sure how to fix that yet, but I'm working on it. There's also a somewhat more complicated ranged system I wrote before stealing Rose's idea, which was click once to target, press control to shoot. But this is by far the simplest way to do it. Or, you could just wait for the next version of EG, which is what I'm doing due to me still having no idea whatsoever about fixing the bug. :)
  7. Sounds great! Just a few questions, though; if NPCs are equipped with ranged weapons, will you be including a recoded AI that allows them to line themselves up with their respective targets, then shoot? Also, will you have to make a new NPC for each equipment set? Sorry if my questions are annoying, I'm just curious about how that's going to work :)
  8. So, do we have an expected release date?
  9. I "borrowed" (and by borrowed, I mean stole) your idea for ranged combat and implemented it. It works like a charm. I'll definitely be keeping an eye on this, if only to "borrow" more ideas.
  10. @Rose: > Since this is code to be built off of, I'm keeping things simple. You face a direction, press attack, the timing is determined by the weapon speed, and if there is an NPC within your range in that direction, wait a second, then do the damage as well as remove an arrow type item from the equip menu. Arrows will go in the shield slot. If you have no arrows and action message will come above your head saying 'No Projectiles!' It's relatively simplistic. That's actually much better than what I was using. Do you mind if I borrow your idea for my own game? :)
  11. @Rose: > EDIT** I'm adding ranged weaponry in the next release. I'm probably the only person who's mildly upset about this, as it means that there will inevitably be a lot of games with ranged weapons now and, since I've already coded a working system into my own project, it will make mine less unique. That aside, how are you planning to accomplish this? Is it a click-once-to target, press control to attack? Or is it a press-control-and-shoot-in-a-straight-line? Also, are you planning on having sprites for the arrow? I'd be interested to see how you get around Eclipse's current 32*32 collision detection. Nevertheless, good luck!
  12. That's not how my ranged system works, though. Basically, you target an NPC and press the attack button. If you have a ranged weapon equipped, it will hit the NPC if it is in range. What I want is to program a function that will allow the game to detect whether there is a solid between the x and y coordinates of the player and the x and y coordinates of the npc. Thanks, anyway.
  13. Hey all, I was just wondering if there was an existing function that would allow the game to detect whether there was a solid object between two points. I'm in the process of coding a ranged weapon system, and I'm just about done except for the actual bullet and this. Any help would be appreciated :)
  14. Hi! I saw that you seem to be working with Breeze sprites, and I would like to offer my services as a weapon paperdoll spriter. Unfortunately, I do not dedicate my life to Eclipse (I have school :P), so I may not be able to fulfill all your requests. I may just submit a few pieces now and then, so I would highly recommend, if you accept me, to get an additional spriter :cheesy:. Nevertheless, here is an example of my work. ![](http://img863.imageshack.us/i/71183813.png/)http://img863.imageshack.us/i/71183813.png/ (if the embedded image does not show) Please PM me if you're interested. Thanks!
  15. Tried that, but didn't know what to look for :) I ended up editing the damage display function instead of the actual damage.
  16. Nice job, I spent about an hour looking for the piece of code in modCombat that allowed me to change spell damage :)
  17. So, when can we expect the addition of projectiles? :)
  18. I just made a new paperdoll item set. For some reason, though, whenever I equip an armor, it's displayed in the layer above the weapon. This results in the weapon being partially obscured by the armor, which makes it look weird. Help is appreciated.
×
×
  • Create New...