Mistlight
-
Posts
11 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Calendar
Posts posted by Mistlight
-
-
i tried again with this but it highlights .cloth and says subscript out of range.
```
Function SetPlayerSkill(ByVal Index As Long, ByVal SkillNum As Long, zx)
' If debug mode, handle error then exit out
'If Options.Debug = 1 Then On Error GoTo errorhandler
If Index > MAX_PLAYERS Then Exit Function
Select Case SkillNum
Case 1
zx = Player(Index).Cloth
Case 2
zx = Player(Index).Leather
Case 3
zx = Player(Index).Plate
Case 4
zx = Player(Index).Dagger
Case 5
zx = Player(Index).OneSword
Case 6
zx = Player(Index).TwoSword
Case 7
zx = Player(Index).OneAxe
Case 8
zx = Player(Index).TwoAxe
Case 9
zx = Player(Index).Wand
Case 10
zx = Player(Index).Staff
Case 11
zx = Player(Index).Shortbow
Case 12
zx = Player(Index).Crossbow
Case 13
zx = Player(Index).Shield
Case 14
zx = Player(Index).Polearm
End Select
' Error handler
Exit Function
errorhandler:
HandleError "SetPlayerSkill", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Function
End Function
```
can anyone help me? -
Because i have multiple weapon proficiency, i wanted to simplify some of the functions. Unfortunately, they did not work. Can anyone help me?
This is an example of the GetPlayerSwords function that i did.
```
Function GetPlayerProficiencyLvl(ByVal Index As Long, ByVal EqType As Long) As Long
If Index > MAX_PLAYERS Then Exit Function
GetPlayerProficiencyLvl = Player(Index).EqType
End Function
``` -
i've edited it ;)
-
As some of you might know, if a resource is being destroyed but there is no image for the exhausted resource, it will still block you from moving over it. I tried to solve this problem by changing the "Get the Resource state" part in CheckDirection to this :
```
' Get the Resource state
Resource_state = MapResource(Resource_num).ResourceState
If Resource_state = 0 Then ' normal
CheckDirection = True
Exit Function
ElseIf Resource_state = 1 Then ' used
If Len(Trim$(Resource(Resource_Index).ExhaustedImage)) > 0 Then
CheckDirection = True
Exit Function
End If
End If
End If
```
However, when i try to destory a resource, it gives me run time error 9, subscript out of range. It also highlights "If DDS_Resource(Resource_sprite) Is Nothing Then" in BltMapResource.
What am i doing wrong? -
oh ok. I didnt really know what I was trying to do too :x Thanks for the help!
-
This is regarding the events system. I'm trying to make a custom code to get the event's name, how do i do that? Could anyone help me?
I tried doing it myself but it highlighted "Public Sub CustomScript(index As Long, caseID As Long)" and said "Compile error: ByRef argument type mismatch. What does that mean?
This is how my CustomScript looks like.
```
Public Sub CustomScript(index As Long, caseID As Long)
Select Case caseID
Case 0
mapnum = GetPlayerMap(index)
filename = App.Path & "\data\maps\map" & mapnum & "_eventdata.dat"
GetVar filename, "Events", "EventCount", Val(Map(mapnum).EventCount)
If Map(mapnum).EventCount > 0 Then
For i = 1 To Map(mapnum).EventCount
With Map(mapnum).Events(i)
GetVar filename, "Event" & i, "Name", .Name
Case Else
PlayerMsg index, "You just activated custom script " & caseID & ". This script is not yet programmed.", BrightRed
End Select
End Sub
``` -
If i want to make a custom code to get the event's name, how do i do that? Could anyone help me?
I tried doing this but it highlighted "Public Sub CustomScript(index As Long, caseID As Long)" and said "Compile error: ByRef argument type mismatch. What does that mean?
This is how my CustomScript looks like.
```
Public Sub CustomScript(index As Long, caseID As Long)
Select Case caseID
Case 0
mapnum = GetPlayerMap(index)
filename = App.Path & "\data\maps\map" & mapnum & "_eventdata.dat"
GetVar filename, "Events", "EventCount", Val(Map(mapnum).EventCount)
If Map(mapnum).EventCount > 0 Then
For i = 1 To Map(mapnum).EventCount
With Map(mapnum).Events(i)
GetVar filename, "Event" & i, "Name", .Name
Case Else
PlayerMsg index, "You just activated custom script " & caseID & ". This script is not yet programmed.", BrightRed
End Select
End Sub
``` -
Could anyone provide links or teach me on how to add a new tabs for adding my own events as the current 2 tabs isnt enough for me.
I've tried adding a new tab in the property page of tabCommands. I then edit tabCommands_Click by "changing For i = 1 To 2" to "For i = 1 To 3". However, when i open the events editor in-game and try to add an event, it says :"run time error 340 : control array element '3' doesnt exist.
Can anyone help me? -
Its fine on mine. Maybe its just your computer :P
-
why do i have this error?
>! ![](http://i.imgur.com/nx1tw.png)
[EO] Weapon Proficiencies/Skill Level
in Source
Posted
@general pony : i found out that i had a error due to me not editing setplayerskill client side. thank you anyway :D