Whitepinkbun Posted December 31, 2011 Author Share Posted December 31, 2011 I think this would be helpful for many different games I imagine playing as a fire character and being able to walk on lava rocks only as that class.I first tried to create a water tile for my Pokemon game that only water Pokemon can use - and a stat to define a character as water.Adding the Public Const tile type for the water and the type constants for the Pokemon I then added a check if the tile type is water and if Pokemon is a water type to see if the tile is walkable but it didn't work.I have custom tiles enabled on my game and am wondering if it would be better to create a custom tile and have it blocked for all but my water type Pokemon seams easier and it means I can add custom tiles for other classes but I'm at a loss on how to do the custom tiles….I looked for ages and found nothing in the way of custom tiles to block certain levels or classes. So if anyone can point me to a tutorial or give me some code similar to what im looking for you'd be my legend!I'm sorry im new to vb6 and have to much crap from GML stuck in my bloody head and for the record I didn't just go straight her first bit of trouble i have had and beg for help I tried many different things first >.< Link to comment Share on other sites More sharing options...
Scott Posted December 31, 2011 Share Posted December 31, 2011 1.Make a new tile type(this includes client side mapeditor so you can place it) data1 should be script number2.In Sub PlayerMove server side add a new statement (search TILE_TYPE_TRAP for an example)Ex:``` If .Type = TILE_TYPE_NEWTYPE Then Dim Scriptnum As Integer Scriptnum = .Data1 Select Case Scriptnum Case 1: If GetPlayerClass(index) = 1 Then Moved = YES End If Case 2: Case 3: End Select End If```Pretty simple, on your own as far as adding a new tile goes it's easy though. Link to comment Share on other sites More sharing options...
Whitepinkbun Posted December 31, 2011 Author Share Posted December 31, 2011 Thanks so much!, I know im new but i can't believe I didn't think of that … I think i was trying to make it to complicated... Some of the people here would shoot me if they looked at my source code... so messy lol Link to comment Share on other sites More sharing options...
Whitepinkbun Posted December 31, 2011 Author Share Posted December 31, 2011 I used this just under ' Check to see if the map tile is blocked``` ' Check to see if the map tile is Water and class is water type or not If Map.Tile(x, y).Type = TILE_TYPE_WATER Then If GetPlayerClass(index) = 7 Or 8 then CheckDirection = True Exit Function End If End If```kinda working but now its just blocking for all classes any ideas?Ive now tried a bunch of different things no clue why its not working```' Check to see if the map tile is blocked or not If Map.Tile(x, y).Type = TILE_TYPE_WATER Then If GetPlayerClass(MyIndex) = 1 or 2 Then CheckDirection = True Exit Function End If End If``` ``` Select Case GetPlayerClass(MyIndex) Case 1 If Map.Tile(x, y).Type = TILE_TYPE_WATER Then CheckDirection = True End If Exit Function Case 2 If Map.Tile(x, y).Type = TILE_TYPE_WATER Then CheckDirection = True End If Exit Function Case Else If Map.Tile(x, y).Type = TILE_TYPE_WATER Then CheckDirection = False End If Exit Function End Select``````' Check to see if the map tile is blocked or notIf Map.Tile(x, y).Type = TILE_TYPE_WATER Then Select Case GetPlayerClass(MyIndex) Case 1 CheckDirection = False Exit Function Case 2 CheckDirection = False Exit Function Case Else CheckDirection = True Exit Function End SelectEnd If```I'm not getting errors but they just don't block any classes at all >.<got all excited when i seenIf Map.Moral = MAP_MORAL_SAFE Then Exit Functionabove my code…. but still doesnt work when i move it above this :(Well have to go to work 4 hours on this and I'm still at a loss >,< edit - o crud didn't mean to double post my bad >.<I did the following to check where its going to and it always goes to class else no mater what class im using so i guess somethings wrong with my GetPlayerClass(MyIndex)?``` Select Case GetPlayerClass(MyIndex) Case 1 If Map.Tile(x, y).Type = TILE_TYPE_WATER Then CheckDirection = True MsgBox "Your geting here1" End If Exit Function Case 2 If Map.Tile(x, y).Type = TILE_TYPE_WATER Then CheckDirection = True MsgBox "Your geting here2" End If Exit Function Case Else If Map.Tile(x, y).Type = TILE_TYPE_WATER Then CheckDirection = False MsgBox "Your geting here3" End If Exit Function End Select```sigh used MsgBox "Your class is " & GetPlayerClass(MyIndex) and it kept saying Your Class is 0 no matter what class i used a nudge in right direction anyone?Thought might be ClassNum instead of Class but then i actually get a error message >.< Link to comment Share on other sites More sharing options...
Whitepinkbun Posted January 2, 2012 Author Share Posted January 2, 2012 So im wondering if no one knows whats wrong with it. XD 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