Oldskool
#31

My favourite way is the way that gets the job done!

Also, recently I've been writing code as if it was for someone else, always making things flexible. For instance I've made all my recent minigame scripts almost completely stand-alone (the only dependency is the player's current minigame ID which is declared in the master script, it's used to enter/exit the game or restrict certain freeroam commands)

I do this mainly so if someone requests it, I can just post it and it should be easy to "install" onto their gamemode, the only errors should just be "undefined symbol" for the things that belong to my main script (current minigame, admin level etc) things that should be easy to substitute.

Another thing is, static globals! I have recently copied a minigame code as I designed another game that was very similar, the issue was, I forgot to substitute some of the function/variable name prefixes so one script was editing or reading values from another! Static variables eliminate this as they aren't recognised outside of the include they are created in.


I have mainly been "copying" the way Object Oriented languages like Java with the Public/Private variables or functions and having "Interface" functions for altering variables from scripts (Even if it's just to do something simple like set it's value).
Reply


Messages In This Thread
Oldskool - by Mike_Peterson - 17.08.2012, 10:03
Re: Oldskool - by Mike_Peterson - 17.08.2012, 10:06
Re: Oldskool - by playbox12 - 17.08.2012, 12:34
Re: Oldskool - by steki. - 17.08.2012, 13:07
Re: Oldskool - by AndreT - 17.08.2012, 13:15
Re: Oldskool - by Universal - 17.08.2012, 13:23
Re: Oldskool - by Mike_Peterson - 17.08.2012, 18:33
Re: Oldskool - by playbox12 - 17.08.2012, 19:11
Re: Oldskool - by Calgon - 17.08.2012, 19:56
Re: Oldskool - by FireCat - 17.08.2012, 20:31
Re: Oldskool - by [ABK]Antonio - 17.08.2012, 22:56
Re: Oldskool - by Y_Less - 18.08.2012, 06:09
Re: Oldskool - by [HLF]Southclaw - 25.08.2012, 22:40
Re: Oldskool - by Guitar - 26.08.2012, 08:01
Re: Oldskool - by DRIFT_HUNTER - 23.09.2012, 01:14
Re: Oldskool - by xDeadlyBoy - 17.10.2012, 23:41
Re: Oldskool - by [FSaF]Jarno - 19.10.2012, 13:29
Re: Oldskool - by Snipa - 21.10.2012, 03:16
Re: Oldskool - by playbox12 - 22.10.2012, 08:26
Re: Oldskool - by AndreT - 22.10.2012, 08:48
Re: Oldskool - by [HLF]Southclaw - 22.10.2012, 13:57
Re: Oldskool - by Y_Less - 22.10.2012, 14:05
Re: Oldskool - by Extremo - 23.10.2012, 09:37
Re: Oldskool - by Slice - 23.10.2012, 10:29
Re: Oldskool - by Y_Less - 23.10.2012, 10:38
Re: Oldskool - by Extremo - 23.10.2012, 16:07
Re: Oldskool - by SchurmanCQC - 11.12.2012, 21:22
Re: Oldskool - by Mike_Peterson - 12.12.2012, 16:43
Re: Oldskool - by Y_Less - 12.12.2012, 16:54
Re: Oldskool - by Mike_Peterson - 12.12.2012, 17:07
Re: Oldskool - by [HLF]Southclaw - 12.12.2012, 18:05
Re: Oldskool - by Mike_Peterson - 12.12.2012, 18:16
Re: Oldskool - by mastermax7777 - 13.12.2012, 20:41
Re: Oldskool - by RebeloX - 13.12.2012, 20:54

Forum Jump:


Users browsing this thread: 3 Guest(s)