aeronx Posted August 26, 2015 Author Share Posted August 26, 2015 Hello everybody! Over the last month i've been working on a project, alone, which is quitetime consuming.After a month, using Skywyre engine and the help from many from this community I havean engine nearly good to start a game.The only thing missing is a combat change. Now, the combat system is pretty basic. You getclose or run(if you use ranged), cast spells and press CTRL. If you have enough dmg and defenseyou 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 needto 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 youhave 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 attacksbut 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 willhelp many people and it would be a perfect addition to any game. I'll gladly accept any help! If someonewants a part in my game, im more than happy to have your help, and i'll share the engine with the changesonce its done, since im not looking to make cash, i just want to people enjoy my work. And after all, this is acommunity 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 More sharing options...
aeronx Posted August 26, 2015 Author Share Posted August 26, 2015 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 LongDim 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 = iEnd Function``` Link to comment Share on other sites More sharing options...
Abyss Posted August 26, 2015 Share Posted August 26, 2015 If I were you, I would look into the parts where Npc's move to the player and check if they can attack and the movement sub's when an NPC is hostile Link to comment Share on other sites More sharing options...
aeronx Posted August 26, 2015 Author Share Posted August 26, 2015 I've tried that already, but so far no luck. Link to comment Share on other sites More sharing options...
aeronx Posted August 27, 2015 Author Share Posted August 27, 2015 bump!Anyone that is able to help me on this? really thanks. Link to comment Share on other sites More sharing options...
Joyce Posted August 27, 2015 Share Posted August 27, 2015 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now