![]() |
Hardcoded 'Scripted' Tiles - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51) +----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44) +------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13) +------ Thread: Hardcoded 'Scripted' Tiles (/showthread.php?tid=2524) |
Hardcoded 'Scripted' Tiles - Nean - 25-01-2009 If you're planning on doing a game right, you're most likely going to need some customizable tile attributes. This is where this comes handy... If you find any errors any code that would be a good addition, feel free to post them. I'm always up for some constructive criticism. Download the form here: http://www.mediafire.com/file/ylgkhmzgy2g/frmScript.frm once the download is done, add it to your source. [spoiler]Server Side Find: Code: Public Const TILE_TYPE_KEYOPEN As Byte = 6 Under it add: Code: Public Const TILE_TYPE_SCRIPTED As Byte = 7 Then find: Code: Sub LeftGame(ByVal Index As Long) Under it add: Code: Sub Scripted(ByVal scriptnum As Long, _ Then find: Code: Sub PlayerMove(ByVal Index As Long, _ DIRECTLY under that add: Code: If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_SCRIPTED Then [spoiler]Client Side Find: Code: If frmMirage.optKeyOpen.Value Then Under it add: Code: If frmMirage.optscripted.Value Then Then find: Code: Case TILE_TYPE_KEYOPEN Under it add: Code: Case TILE_TYPE_SCRIPTED Then find: Code: Public Const TILE_TYPE_KEYOPEN As Byte = 6 Under it add: Code: Public Const TILE_TYPE_SCRIPTED As Byte = 7 Now make an option button under the other tile attributes in the map editor, name it optscripted Double click it, and add this code in: Code: frmScript.Show vbModal Re: Hardcoded 'Scripted' Tiles - timster0 - 25-01-2009 Looks good, though I don't have the time to try it out ATM. Gonna have to do it tomorrow. Re: Hardcoded 'Scripted' Tiles - Nean - 25-01-2009 Lea Wrote:not really a scripted tile It's server side, so all you have to do is pause the server, and add one to the select case. Re: Hardcoded 'Scripted' Tiles - Nean - 25-01-2009 Lea Wrote:Because a live game will be run from inside the IDE. Yeah, I didn't take into account, that you might compile your server. xDD I might improve upon this, to make it editable from within the game itself. Re: Hardcoded 'Scripted' Tiles - Nean - 01-03-2009 Thinking of turning this system into scriptable items/npcs Re: Hardcoded 'Scripted' Tiles - Robin - 01-03-2009 All been done before on the old Essence site. Do something original and actually make them scriptable ;D Re: Hardcoded 'Scripted' Tiles - Nean - 01-03-2009 Robin Wrote:All been done before on the old Essence site. Haha. I can give it a try. Re: Hardcoded 'Scripted' Tiles - Fontor - 24-07-2009 link dead ![]() Re: Hardcoded 'Scripted' Tiles - Joost - 24-07-2009 Pff, I even had scriptable items. Always fun to actually get cursed when using a cursed blade, rite? Re: Hardcoded 'Scripted' Tiles - Nean - 24-07-2009 Fontor Wrote:link dead If you look at the code, it shouldn't be THAT hard to construct your own form based off of it. It's quite simple really. However, if you TRY and still fail I'll go ahead and remake the form (I lost it as well) |