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

Combat behaviour change


aeronx
 Share

Recommended Posts

Hello everybody! Over the last month i've been working on a project, alone, which is quite
time consuming.

After a month, using Skywyre engine and the help from many from this community I have
an engine nearly good to start a game.

The only thing missing is a combat change. Now, the combat system is pretty basic. You get
close or run(if you use ranged), cast spells and press CTRL. If you have enough dmg and defense
you survive, otherwise, you dont. Easy.

The last things im looking for are:
#Diagonal attacks for players and npcs.
 -Why this? Because with the linear spells, you can stay diagonal to dodge their spells and you need
to pay more attention, becoming more challenging.

#NPC_BEHAVIOUR_RUN
 -For exemple, if you have a NPC that uses arrows or spells, i want them to run from the player, so you
have to chase them and you will probably run into more npcs, becoming harder.

I've been trying to mess with pathfinding, adding a new behaviour, changing the X Y for diagonal attacks
but nothing seems to work.

So, im looking for some help here in the community, and to point me out a way, because i think this will
help many people and it would be a perfect addition to any game. I'll gladly accept any help! If someone
wants a part in my game, im more than happy to have your help, and i'll share the engine with the changes
once its done, since im not looking to make cash, i just want to people enjoy my work. And after all, this is a
community to share and show your work!

Thanks for reading and expecting the best of you all! Thanks for your time!
Link to comment
Share on other sites

I've found this on the code..

Is there anyway to work something like this for NPCs?
```
Function GetDirAwayFromPlayer(playerID As Long, mapnum As Long, eventID As Long) As Long
Dim i As Long, x As Long, y As Long, x1 As Long, y1 As Long, didwalk As Boolean, WalkThrough As Long, distance As Long
'This does not work for global events so this MUST be a player one....
'This Event returns a direction, 5 is not a valid direction so we assume fail unless otherwise told.
If playerID <= 0 Or playerID > Player_HighIndex Then Exit Function
If mapnum <= 0 Or mapnum > MAX_MAPS Then Exit Function
If eventID <= 0 Or eventID > TempPlayer(playerID).EventMap.CurrentEvents Then Exit Function

x = GetPlayerX(playerID)
y = GetPlayerY(playerID)
x1 = TempPlayer(playerID).EventMap.EventPages(eventID).x
y1 = TempPlayer(playerID).EventMap.EventPages(eventID).y

i = DIR_RIGHT

If x - x1 > 0 Then
If x - x1 > distance Then
i = DIR_LEFT
distance = x - x1
End If
ElseIf x - x1 < 0 Then
If ((x - x1) * -1) > distance Then
i = DIR_RIGHT
distance = ((x - x1) * -1)
End If
End If

If y - y1 > 0 Then
If y - y1 > distance Then
i = DIR_UP
distance = y - y1
End If
ElseIf y - y1 < 0 Then
If ((y - y1) * -1) > distance Then
i = DIR_DOWN
distance = ((y - y1) * -1)
End If
End If

GetDirAwayFromPlayer = i
End Function

```
Link to comment
Share on other sites

If this were simple, it would have been done before.. But it's quite a large part of the engine that would need a fairly significant overhaul to go well with this. (Not to mention because VB6 is singlethreaded you'll lose a ton of performance by speeding things up)
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...