Dawntide Posted August 12, 2012 Author Share Posted August 12, 2012 Hey,I got a challenge for all the good coders in this community.I tried it, but i'm a noob and fucked up my files, luckily i create a backup after nearly every small change :DI want to create a "grappling hook".You throw/shoot the projectile and it pulls/warps you to the place where the projectile hits, whether it is a tile or a npc/player.that's it. Link to comment Share on other sites More sharing options...
Likestodraw Posted August 12, 2012 Share Posted August 12, 2012 Nice way to get support there xD Link to comment Share on other sites More sharing options...
DarkOne5890 Posted August 12, 2012 Share Posted August 12, 2012 LOL Link to comment Share on other sites More sharing options...
abhi2011 Posted August 12, 2012 Share Posted August 12, 2012 I might not make it but it might be simple. Good challenge though. Link to comment Share on other sites More sharing options...
erkro1 Posted August 12, 2012 Share Posted August 12, 2012 Haha, very sneaky way of asking it. :PAnyway, like Abhi2011 said its not that hard, if you have Wabbits projectile system it can be easily implemented, just add a warp that warps you 1 tile away from the thing your grappling hook is attached to, in front of the ClearProjectile's. Link to comment Share on other sites More sharing options...
Guest Posted August 12, 2012 Share Posted August 12, 2012 Even if someone accept this challenge doesn't mean it would have to give the modified engine or the system to him Link to comment Share on other sites More sharing options...
Joyce Posted August 12, 2012 Share Posted August 12, 2012 Hardly an expert challenge, just cast a loop call from current position into the direction you're facing, and teleport to the first blocked tile you can -1. Link to comment Share on other sites More sharing options...
Dawntide Posted August 12, 2012 Author Share Posted August 12, 2012 When it is not hard enough for you, then add an animation to it and make it possible to create more projectile weapons of this type in the item editor, so its a new item type Link to comment Share on other sites More sharing options...
erkro1 Posted August 12, 2012 Share Posted August 12, 2012 @Lumiere:> Even if someone accept this challenge doesn't mean it would have to give the modified engine or the system to himI actually just sended him the code.@Joyce:> Hardly an expert challenge, just cast a loop call from current position into the direction you're facing, and teleport to the first blocked tile you can -1.Thats exactly what I thought, this is the code I came up with:```' check if left map If x > Map.MaxX Or y > Map.MaxY Or x < 0 Or y < 0 Then ClearProjectile Index, PlayerProjectile Exit Sub End If ' check if we hit a block If Map.Tile(x, y).Type = TILE_TYPE_BLOCKED Then If getplayerequipment(Index, Weapon) = 7 Then Select Case TempPlayer(Index).ProjecTile(PlayerProjectile).Direction Case DIR_DOWN Call playerwarp(Index, GetPlayerMap(Index), TempPlayer(Index).ProjecTile(PlayerProjectile).x, TempPlayer(Index).ProjecTile(PlayerProjectile).y - 1) Case DIR_UP Call playerwarp(Index, GetPlayerMap(Index), TempPlayer(Index).ProjecTile(PlayerProjectile).x, TempPlayer(Index).ProjecTile(PlayerProjectile).y + 1) Case DIR_RIGHT Call playerwarp(Index, GetPlayerMap(Index), TempPlayer(Index).ProjecTile(PlayerProjectile).x - 1, TempPlayer(Index).ProjecTile(PlayerProjectile).y) Case DIR_LEFT Call playerwarp(Index, GetPlayerMap(Index), TempPlayer(Index).ProjecTile(PlayerProjectile).x + 1, TempPlayer(Index).ProjecTile(PlayerProjectile).y) End Select End If ClearProjectile Index, PlayerProjectile Exit Sub End If ' check for player hit For i = 1 To Player_HighIndex If x = GetPlayerX(i) And y = GetPlayerY(i) Then ' they're hit, remove it If Not x = Player(MyIndex).x Or Not y = GetPlayerY(MyIndex) Then If getplayerequipment(Index, Weapon) = 7 Then Select Case TempPlayer(Index).ProjecTile(PlayerProjectile).Direction Case DIR_DOWN Call playerwarp(Index, GetPlayerMap(Index), TempPlayer(Index).ProjecTile(PlayerProjectile).x, TempPlayer(Index).ProjecTile(PlayerProjectile).y - 1) Case DIR_UP Call playerwarp(Index, GetPlayerMap(Index), TempPlayer(Index).ProjecTile(PlayerProjectile).x, TempPlayer(Index).ProjecTile(PlayerProjectile).y + 1) Case DIR_RIGHT Call playerwarp(Index, GetPlayerMap(Index), TempPlayer(Index).ProjecTile(PlayerProjectile).x - 1, TempPlayer(Index).ProjecTile(PlayerProjectile).y) Case DIR_LEFT Call playerwarp(Index, GetPlayerMap(Index), TempPlayer(Index).ProjecTile(PlayerProjectile).x + 1, TempPlayer(Index).ProjecTile(PlayerProjectile).y) End Select End If ClearProjectile Index, PlayerProjectile Exit Sub End If End If Next ' check for npc hit For i = 1 To MAX_MAP_NPCS If x = MapNpc(i).x And y = MapNpc(i).y Then If getplayerequipment(Index, Weapon) = 7 Then Select Case TempPlayer(Index).ProjecTile(PlayerProjectile).Direction Case DIR_DOWN Call playerwarp(Index, GetPlayerMap(Index), TempPlayer(Index).ProjecTile(PlayerProjectile).x, TempPlayer(Index).ProjecTile(PlayerProjectile).y - 1) Case DIR_UP Call playerwarp(Index, GetPlayerMap(Index), TempPlayer(Index).ProjecTile(PlayerProjectile).x, TempPlayer(Index).ProjecTile(PlayerProjectile).y + 1) Case DIR_RIGHT Call playerwarp(Index, GetPlayerMap(Index), TempPlayer(Index).ProjecTile(PlayerProjectile).x - 1, TempPlayer(Index).ProjecTile(PlayerProjectile).y) Case DIR_LEFT Call playerwarp(Index, GetPlayerMap(Index), TempPlayer(Index).ProjecTile(PlayerProjectile).x + 1, TempPlayer(Index).ProjecTile(PlayerProjectile).y) End Select End If ' they're hit, remove it ClearProjectile Index, PlayerProjectile Exit Sub End If Next```Not sure if it works, I just typed it real quick in Notepad. 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