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

[EO2.0]Ranged Projectiles(Arrows, Bullets and more)[RELEASE]


evilbunnie
 Share

Recommended Posts

  • Replies 232
  • Created
  • Last Reply

Top Posters In This Topic

This is a great mod, thank you for sharing.  I plan to use this in my game, however, I noticed that if you fire a projectile and quickly move to a different map … it continues onto the new map. 

Am I missing something?

Does anyone have a fix for this?

Thanks,
~Radagast
Link to comment
Share on other sites

Hey sorry to be a pain but I'm getting "Run Time Error 9" on both Client and Server when trying to "Run" after adding your tutorial. Debug points to:

HandleDataSub(SHandleProjectile) = GetAddress(AddressOf HandleProjectile)

I'm not sure where ive mocked up but sure I followed instructions correctly.

This is happening on both Client and Server. Could you guide me to where I'm going wrong as I know it will be me :P

Thanks and Sorry again, still learning VB.
Link to comment
Share on other sites

  • 2 weeks later...
@crilleaz:

> I also have problems with Run-time 9, when trading the server crashes sometimes, and when being in party.
> Is there any fix for this?
>
> I've wrote a thread saying im willing to pay for this to work, really desperate!

I will program for you for free, my friend.
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
Hello everybody, I writing here asking for help. I got EO 2.0, and de VB6 to edit it.
Okay, I followed every step correctly, saved the changes and when gone to compile I got an error, "Compile error: Variable not defined" and the program selected this "scrlProjectileDamage" in the frmEditor_Item (Code).
I need help to solve this problem and that may appear after this.
I still need help to create the projectiles stuff in the Item Editor Object, I know how to make labels and scrolls but still don't know how to connect the "pic" scroll to change pictures, or the speed scroll for the projectile speed [….]

Thanks for help, and sorry for my bad english ;)

ps: I couldn't finish the Item Editor Object cuz I don't know how to connect the scrolls to properties, this might be the main problem at all, I think if this problem is solved everything gonna works fine, or not :p
Link to comment
Share on other sites

If you didnt do any edits, you can just download Item editor attached to main post.
Also, you said you dont know how to code scrolling stuff properly right? There is code right under the picture of how it should look :)
You need to name that scrolls scrlProjectileDamage, scrlProjectilePic, scrlProjectileRange and so on.

>! In frmEditor_Item's source code insert:
>! ```
' projectile
Private Sub scrlProjectileDamage_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
    lblProjectileDamage.Caption = "Damage: " & scrlProjectileDamage.Value
    Item(EditorIndex).ProjecTile.Damage = scrlProjectileDamage.Value

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "scrlProjectilePic_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
>! ' projectile
Private Sub scrlProjectilePic_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
    lblProjectilePiC.Caption = "Pic: " & scrlProjectilePic.Value
    Item(EditorIndex).ProjecTile.Pic = scrlProjectilePic.Value

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "scrlProjectilePic_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
>! ' ProjecTile
Private Sub scrlProjectileRange_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
    lblProjectileRange.Caption = "Range: " & scrlProjectileRange.Value
    Item(EditorIndex).ProjecTile.Range = scrlProjectileRange.Value

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "scrlProjectileRange_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
>! ' projectile
Private Sub scrlProjectileSpeed_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
    lblProjectilesSpeed.Caption = "Speed: " & scrlProjectileSpeed.Value
    Item(EditorIndex).ProjecTile.Speed = scrlProjectileSpeed.Value

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "scrlRarity_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
>! ```
Then replace
```
>! Private Sub cmbType_Click()
>! ```With:
```
>! Private Sub cmbType_Click()
    ' 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 (cmbType.ListIndex >= ITEM_TYPE_WEAPON) And (cmbType.ListIndex <= ITEM_TYPE_SHIELD) Then
        fraEquipment.Visible = True
        'scrlDamage_Change
        If cmbType.ListIndex = ITEM_TYPE_WEAPON Then
            frame4.Visible = True
        End If
    Else
        fraEquipment.Visible = False
        frame4.Visible = False
    End If
>!     If cmbType.ListIndex = ITEM_TYPE_CONSUME Then
        fraVitals.Visible = True
        'scrlVitalMod_Change
    Else
        fraVitals.Visible = False
    End If
>!     If (cmbType.ListIndex = ITEM_TYPE_SPELL) Then
        fraSpell.Visible = True
    Else
        fraSpell.Visible = False
    End If

    Item(EditorIndex).Type = cmbType.ListIndex
>!     ' Error handler
    Exit Sub
errorhandler:
    HandleError "cmbType_Click", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
>! ```

Hope I helped :)
Link to comment
Share on other sites

Thanks for your fast reply and help Vus, it worked! ;)

Now I'm just having a little problem with the arrow, it doesn't appear when I shot (even with slow speed projectile). I made a picture, 32x32, .bmp and named it as "1.bmp"
One more simple question, how does the ammunition work? I mean, you need ammo for bows? If yes, you need to create arrows too? How I create them? if no, so each bow has it own infinite arrow type?

Once again, thanks for help and sorry for my bad english :)

The PS isn't part of help i'm asking, just an idea I want to share with you, read if you have curiosity.

PS: I realized that with this mechanic built here, you can make mages more interesting once you can put each spell in a wand or scroll (for example) and you just shot like a bow (but the spirit sistem for those spells is lacking, I thought something like "spirit cost to hit"), and then create spells that work in squaremeters (I think it's called tiles here) (one animation in each tile/sqm, allowing you to cast spells in form of wave [further the waves travel, higher is its width]), so  the gameplay will be funnier once you'ill have to get the best position to damage more enemies, and not just stand still, click and press f1…f12.  Of course, other modifications in game are gonna be necessary. It's only an idea, thanks for read. ;)
Link to comment
Share on other sites

Partner, I was only doing this tutorial one of these days. But I "redid" the tutorial but since Spell Arrow and not per item. But I noticed a little problem, I do not know if it was because I swapped to Spell. But I guess not, so to posting here.

For example, if I set the damage to the arrow 10\. It always takes 10 damage from the NPC, regardless of agility of it, or critical.

So if you want the fix:

**Server**

Find :

```
' check for npc hit
    For i = 1 To MAX_MAP_NPCS
        If x = MapNpc(GetPlayerMap(Index)).Npc(i).x And y = MapNpc(GetPlayerMap(Index)).Npc(i).y Then
            ' they're hit, remove it and deal that damage ;)
            If CanPlayerAttackNpc(Index, i, True) Then
                PlayerAttackNpc Index, i, TempPlayer(Index).ProjecTile(PlayerProjectile).damage
                ClearProjectile Index, PlayerProjectile
                Exit Sub
            Else
                ClearProjectile Index, PlayerProjectile
                Exit Sub
            End If
        End If
    Next
```
Replace With :

```
' check for npc hit
    For i = 1 To MAX_MAP_NPCS
        If x = MapNpc(GetPlayerMap(Index)).Npc(i).x And y = MapNpc(GetPlayerMap(Index)).Npc(i).y Then
            ' they're hit, remove it and deal that damage ;)
            If CanPlayerAttackNpc(Index, i, True) Then
            damage = TempPlayer(Index).ProjecTile(PlayerProjectile).damage - CanNpcBlock(i)
            ' take away armour
        damage = damage - RAND(1, (Npc(i).stat(Stats.Agility) * 2))
        ' randomise from 1 to max hit
        damage = RAND(1, damage)

        ' * 1.5 if it's a crit!
        If CanPlayerCrit(Index) Then
            damage = damage * 1.5
            SendActionMsg GetPlayerMap(Index), "Critical!", BrightCyan, 1, (GetPlayerX(Index) * 32), (GetPlayerY(Index) * 32)
        End If
                PlayerAttackNpc Index, i, damage
                ClearProjectile Index, PlayerProjectile
                Exit Sub
            Else
                ClearProjectile Index, PlayerProjectile
                Exit Sub
            End If
        End If
    Next
```
Find :

```
' check if hit player
    For i = 1 To Player_HighIndex
        ' make sure they're actually playing
        If IsPlaying(i) Then
            ' check coordinates
            If x = Player(i).x And y = GetPlayerY(i) Then
                ' make sure it's not the attacker
                If Not x = Player(Index).x Or Not y = GetPlayerY(Index) Then
                    ' check if player can attack
                    If CanPlayerAttackPlayer(Index, i, False, True) = True Then
                        ' attack the player and kill the project tile
                        PlayerAttackPlayer Index, i, TempPlayer(Index).ProjecTile(PlayerProjectile).damage
                        ClearProjectile Index, PlayerProjectile
                        Exit Sub
                    Else
                        ClearProjectile Index, PlayerProjectile
                        Exit Sub
                    End If
                End If
            End If
        End If
    Next
```
Replace with :

```
' check if hit player
    For i = 1 To Player_HighIndex
        ' make sure they're actually playing
        If IsPlaying(i) Then
            ' check coordinates
            If x = Player(i).x And y = GetPlayerY(i) Then
                ' make sure it's not the attacker
                If Not x = Player(Index).x Or Not y = GetPlayerY(Index) Then
                    ' check if player can attack
                    If CanPlayerAttackPlayer(Index, i, False, True) = True Then
' Get the damage we can do
        damage = TempPlayer(Index).ProjecTile(PlayerProjectile).damage

        ' if the npc blocks, take away the block amount
        damage = (damage - CanPlayerBlock(i))

        ' take away armour
        damage = damage - RAND(1, (GetPlayerStat(i, Agility) * 2))

        ' randomise for up to 10% lower than max hit
        damage = RAND(1, damage)

        ' * 1.5 if can crit
        If CanPlayerCrit(index) Then
            damage = damage * 1.5
            SendActionMsg getplayermap(Index), "Critical!", BrightCyan, 1, (GetPlayerX(index) * 32), (GetPlayerY(index) * 32)
End If
                        ' attack the player and kill the project tile
                        PlayerAttackPlayer Index, i, Damage
                        ClearProjectile Index, PlayerProjectile
                        Exit Sub
                    Else
                        ClearProjectile Index, PlayerProjectile
                        Exit Sub
                    End If
                End If
            End If
        End If
    Next
```
I did it fast, is to use the TryPlayerAttackNpc or TryPlayerAttackPlayer. But something is already better than ever cause the same damage. xD If item does not occur with this error, I'm sorry. But tests ae by guarantee. Oh, and good tutorial.
Link to comment
Share on other sites

"runtime error 380 invalid property value" when i open the item editor. I deleted my current items and now the error is gone, but the half of the item editor frame is missing. Even the combobox is bugged, there is no item type in there anymore.

help please
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
> In **Sub PlayerAttackNpc** _before:_
>
> ```
> Name = Trim$(Npc(npcNum).Name)
> ```
> _Insert:_
>
> ```
> If npcNum < 1 Then Exit Sub
> ```

```
If npcNum < 1 then exit
```

Should be AFTER

```
npcNum = MapNpc(mapnum).Npc(mapNpcNum).Num
```

To avoid confusion

Like this:

```
mapnum = GetPlayerMap(attacker)

npcNum = MapNpc(mapnum).Npc(mapNpcNum).Num

Name = Trim$(Npc(npcNum).Name)

If npcNum < 1 Then Exit Sub
```

![:lol:](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/laugh.png)
Link to comment
Share on other sites

  • 3 weeks later...

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...