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

So basically im trying to make a command


killerminx
 Share

Recommended Posts

Im trying to make a command custommenuspellanime i thought basically i could just copy a custom menu thing and plug the spell information in ther and it did not work

```
Sub CustomMenuanime(ByVal SpellNum As Long, ByVal picture_index As Long, ByVal Left As Long, ByVal top As Long)
    Dim packet As String

    If alignment < 0 Or alignment > 2  Or picture_index < 0 Or player_index <= 0 Or player_index > MAX_PLAYERS Then
        Exit Sub
    End If

    packet = "scriptspellanim" & SEP_CHAR & picture_index & SEP_CHAR & Left & SEP_CHAR & top & END_CHAR
    Call SendDataTo(player_index, packet)

End Sub
```
could anyone help me?
Link to comment
Share on other sites

First thing you need to do is examine the code you have and pick out the variables:

> Dim packet As String
>
>     If alignment < 0 Or alignment > 2  Or picture_index < 0 Or player_index <= 0 Or player_index > MAX_PLAYERS Then
>         Exit Sub
>     End If
>
>     packet = "scriptspellanim" & SEP_CHAR & picture_index & SEP_CHAR & Left & SEP_CHAR & top & END_CHAR
>     Call SendDataTo(player_index, packet)

Every variable has to get its value from somewhere. That is, with this command, you'd need 6 sources for those variables.

The packet is dimmed within the source code, so that's 1\. That still leaves 5 variables. These 5, then, would be the parameters of your sub. However, I don't believe what you have done here will accomplish what you need. For example purposes, I will write the sub you'd use.

```
Sub custommenuanime(ByVal player_index As Long, ByVal picture_index As Long, ByVal Left As Long, ByVal top As Long, ByVal alignment as Long)
```
This would successfully execute what you've got. However, half of these parameters aren't really doing much. Brush up on some commands and add to this.
Link to comment
Share on other sites

ok yea i really don't need the alignment all i really need is the anim,ation num and the coordinates so when i post it on a custom menu its where you want it, i don't think i need alignment or picture_index, but let me post the two commands im working with.

This is call custom menu picture
```
Sub CustomMenuPicture(ByVal player_index As Long, ByVal picture_index As Long, ByVal FileName As String, ByVal Left As Long, ByVal top As Long)
    Dim packet As String

    If picture_index < 0 Or player_index <= 0 Or player_index > MAX_PLAYERS Then
        Exit Sub
    End If

    packet = "loadpiccustommenu" & SEP_CHAR & picture_index & SEP_CHAR & FileName & SEP_CHAR & Left & SEP_CHAR & top & END_CHAR
    Call SendDataTo(player_index, packet)

End Sub
```
this is too call spellanim

```
Sub SpellAnim(ByVal SpellNum As Long, ByVal mapper As Long, ByVal X As Long, ByVal Y As Long)
    Call SendDataToMap(mapper, "scriptspellanim" & SEP_CHAR & SpellNum & SEP_CHAR & Spell(SpellNum).SpellAnim & SEP_CHAR & Spell(SpellNum).SpellTime & SEP_CHAR & Spell(SpellNum).SpellDone & SEP_CHAR & X & SEP_CHAR & Y & SEP_CHAR & Spell(SpellNum).Big & END_CHAR)
End Sub
```
So i tried to combine the 2

```
Sub CustomMenuanime(ByVal SpellNum As Long, ByVal Left As Long, ByVal top As Long)
    Dim packet As String

    packet = "scriptspellanim" & SEP_CHAR Left & SEP_CHAR & top & END_CHAR
    Call SendDataTo(player_index, packet)

End Sub
```
Link to comment
Share on other sites

Well, first of all, look at BltSpell (or something like that). That shows all the steps that a spell animation goes through. That'd be a good place to start. Then, take a look at how Custom Menus load the images in. You'd have to combine the two and add in a new object that will be used to display the animation on the menu.
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...