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

Ranged


Soaps
 Share

Recommended Posts

Hey all, ive been looking at adding Ranged weapons in EO. Such as a Bow or gun. turns out its alot of work lol, i can do the paperdolls and such its just the coding. ive gone thought the search and i havn't realy found anything usefull as far as adding them.

Im still new to VB6, and this is probably alot more then i can do myself, and i can't buy it. it be a huge help if some one could help me with this or point me to a post that dosn't end with buy it here.

thanks for the help, if i missed somthing when i searched im sorry,
Link to comment
Share on other sites

@Soaps:

> Hey all, ive been looking at adding Ranged weapons in EO. Such as a Bow or gun. turns out its alot of work lol, i can do the paperdolls and such its just the coding. ive gone thought the search and i havn't realy found anything usefull as far as adding them.
>
> Im still new to VB6, and this is probably alot more then i can do myself, and i can't buy it. it be a huge help if some one could help me with this or point me to a post that dosn't end with buy it here.
>
> thanks for the help, if i missed somthing when i searched im sorry,

Wait. For. Eclipse. Galaxy. v0.0.9.
Link to comment
Share on other sites

i don't want to swich over to another engine, so i guess ill keep working on learning VB6, see if i can't figure it out. if any one knows how to do this in EO or if ts going to be added in the future let me know.

thanks everyone.
Link to comment
Share on other sites

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. :)
Link to comment
Share on other sites

Yeah, now that I'm home again I'll release a demo version of my combat simulator and get to work finishing v9 The Ranged weaponry will hopefully be a synch. I usually pump out my planned additions quite rapidly given the time. Hell, I released v1 - v8 in about a week.

Nonetheles, the ranged system will be easy to manipulate.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...