Guest Posted March 26, 2011 Share Posted March 26, 2011 At the end of this tutorial your players will be able to walk through each other but ONLY on Safe maps.First, in Function CheckDirection find this:```' Check to see if a npc is already on that tile```And move that whole chunk of code (up to 'Next) above:```' Check to see if a player is already on that tile For i = 1 To Player_HighIndex If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then If GetPlayerX(i) = x Then If GetPlayerY(i) = Y Then CheckDirection = True Exit Function End If End If End If Next i```What this has done has allowed us to not let players walk through NPCs (you'll see why later).Next, add this:```If Map.Moral = MAP_MORAL_SAFE Then Exit Function```Above:```' Check to see if a player is already on that tile```Now that line of code tells the game to ignore the check that checks whether another player is already on the tile IF the map is a safe map. Now you can see why we put the NPC on the same tile check above that line, so it doesn't also exit out.And thats it, goodluck! Link to comment Share on other sites More sharing options...
EclipseCommunity Posted March 26, 2011 Share Posted March 26, 2011 Nice, thank you. Link to comment Share on other sites More sharing options...
iSKweek Posted March 26, 2011 Share Posted March 26, 2011 Wouldn't it be only on safe maps?```If Map.Moral = MAP_MORAL_SAFE Then Exit Function```I could just be reading into it wrong though, it is late at night :P Link to comment Share on other sites More sharing options...
Guest Posted March 26, 2011 Share Posted March 26, 2011 Yeah.. too early for me too xD. Meant safe maps. Link to comment Share on other sites More sharing options...
Grimnnak Posted March 26, 2011 Share Posted March 26, 2011 I can't find Sub CheckDirection, Is this for EO 2.0? Link to comment Share on other sites More sharing options...
Ruins of Hell Posted March 26, 2011 Share Posted March 26, 2011 @Grimnnak:> I can't find Sub CheckDirection, Is this for EO 2.0?Yes. Make sure you hit the Entire Project radio button with CTRL+F. Link to comment Share on other sites More sharing options...
Guest Posted March 26, 2011 Share Posted March 26, 2011 My bad again, its Function CheckDirection. Link to comment Share on other sites More sharing options...
Grimnnak Posted March 26, 2011 Share Posted March 26, 2011 Still cannot find it. Link to comment Share on other sites More sharing options...
Grimnnak Posted March 26, 2011 Share Posted March 26, 2011 is it in Server or Client, because im looking in Server. Link to comment Share on other sites More sharing options...
Guest Posted March 26, 2011 Share Posted March 26, 2011 Its in modGameLogic, just do ctrl f and click "Search whole project". Its client side. Link to comment Share on other sites More sharing options...
Grimnnak Posted March 26, 2011 Share Posted March 26, 2011 Oh Doi to me, I thought all Moving functions would be handled in Server, Thanks. Link to comment Share on other sites More sharing options...
Grimnnak Posted March 26, 2011 Share Posted March 26, 2011 Okay, now i have a problem, I am able to walk over NPC's, and They don't attack back. What do i do? Link to comment Share on other sites More sharing options...
Guest Posted March 26, 2011 Share Posted March 26, 2011 …. The first step in the tutorial is done to avoid that happening... Link to comment Share on other sites More sharing options...
Grimnnak Posted March 26, 2011 Share Posted March 26, 2011 Ok,I can't walk thru NPC's, But they don't attack back now Link to comment Share on other sites More sharing options...
Grimnnak Posted March 26, 2011 Share Posted March 26, 2011 Heres what the codes looks like…http://i55.tinypic.com/r2l3t4.png Link to comment Share on other sites More sharing options...
Guest Posted March 26, 2011 Share Posted March 26, 2011 Them not attacking back has nothing to do with my code, you've bugged up your own source. Link to comment Share on other sites More sharing options...
Grimnnak Posted March 26, 2011 Share Posted March 26, 2011 Never mind they attack back, Thanks… Link to comment Share on other sites More sharing options...
crzyone9584 Posted March 27, 2011 Share Posted March 27, 2011 Thanks sekaru. You saved me a lot of work. I was going to eventually get to this for kins game. Link to comment Share on other sites More sharing options...
Guest Posted March 27, 2011 Share Posted March 27, 2011 S'alright mate. Link to comment Share on other sites More sharing options...
Whackeddie99 Posted March 28, 2011 Share Posted March 28, 2011 doesnt work for me it says Compile error: for control variable already in useHelp! Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2011 Share Posted March 29, 2011 Then you're not doing it right. Link to comment Share on other sites More sharing options...
Whackeddie99 Posted March 29, 2011 Share Posted March 29, 2011 i did it exactly as it said. Maybe its interfering with other coding from other things added into it? Link to comment Share on other sites More sharing options...
Gwen Posted March 29, 2011 Share Posted March 29, 2011 eddie… why dont you post your code so we can make sure you have everything correct.did you change anything else in that section of code? Try commenting out this section of code and see if you still get the error.that error is due to one of your for loops not terminating correctly. Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2011 Share Posted March 29, 2011 @Whackeddie99:> i did it exactly as it said. Maybe its interfering with other coding from other things added into it?It has nothing to do with any other line of code in EO. It's simply moving a block of code above another block of code and adding a line under that.And yeah, try what Gwen said. Link to comment Share on other sites More sharing options...
Whackeddie99 Posted March 29, 2011 Share Posted March 29, 2011 I got it to work im just a freaking retard and i messed up somewhere, thanks :) 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