SS13 for experienced programmers: Difference between revisions

Jump to navigation Jump to search
imported>Errorage
(1 revision)
imported>LiamLime
(10 intermediate revisions by 3 users not shown)
Line 12: Line 12:
       i2
       i2
       i3
       i3
is the same as (Strongly recommended you use this layout to make searching for variable and proc definitions easier.)
is the same as  
   /obj
   /obj
     var/i1
     var/i1
Line 21: Line 21:
   /obj/var/i2
   /obj/var/i2
   /obj/var/i3
   /obj/var/i3
For this project use the following layout. (This layout makes searching for variable and proc definitions easier.)
  /obj
    var/i1
    var/i2
    var/i3
  /obj/proc/test()
    var/a = 5
    return a + i1   
  /obj/del()
    return i1
*This guide uses the word 'object' for any defined type (see [[#Variable types|Variable types]]) and the word 'obj' for derivatives of atom/obj, which are all objects which can be placed on the map.
*This guide uses the word 'object' for any defined type (see [[#Variable types|Variable types]]) and the word 'obj' for derivatives of atom/obj, which are all objects which can be placed on the map.
*This guide uses the word 'AI controlled' for behavior to do with an [[AI]] player controlling an item. The term 'Game controlled' is used when refering to behavior which the script itself determins (Usually called AI controlled creatures or NPCs)
*This guide uses the word 'AI controlled' for behavior to do with an [[AI]] player controlling an item. The term 'Game controlled' is used when refering to behavior which the script itself determins (Usually called AI controlled creatures or NPCs)
Line 161: Line 173:
angle2dir(var/degree)<br>
angle2dir(var/degree)<br>
angle2text(var/degree)<br>
angle2text(var/degree)<br>
(Defined in [https://github.com/tgstation/-tg-station/blob/master/code/__HELPERS/type2type.dm code/__HELPERS/type2type.dm])


For more useful procs see<br>
For more useful procs see<br>
[http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/procs/helpers.dm code/defines/procs/helpers.dm]<br>
[https://github.com/tgstation/-tg-station/tree/master/code/__HELPERS code/__HELPERS/] <br>
[http://code.google.com/p/tgstation13/source/browse/trunk/code/game/objects/items/helper_procs.dm code/game/objects/items/helper_procs.dm]
<s>[http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/procs/helpers.dm code/defines/procs/helpers.dm]</s> (Dead link)<br>
<s>[http://code.google.com/p/tgstation13/source/browse/trunk/code/game/objects/items/helper_procs.dm code/game/objects/items/helper_procs.dm]</s> (Dead link) <br>


=== [http://www.byond.com/members/?command=reference&path=proc%2Fif If] ===
=== [http://www.byond.com/members/?command=reference&path=proc%2Fif If] ===
Line 389: Line 403:


Most other variables exist only for technical reasons and should not be messed with unless done through existing procs, they are defined in:
Most other variables exist only for technical reasons and should not be messed with unless done through existing procs, they are defined in:
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/area/Space%20Station%2013%20areas.dm code/defines/area/Space Station 13 areas.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/game/area/Space%20Station%2013%20areas.dm code/game/area/Space Station 13 areas.dm]


=== Mob ===
=== Mob ===


There is a huge amount of variables for mobs. Take a look at the following files:
There is a huge amount of variables for mobs. Take a look at the following files:
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/mob.dm code/defines/mob/mob.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/mob.dm code/modules/mob/mob.dm]
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/dead/observer.dm code/defines/mob/dead/observer.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/dead/observer/observer.dm code.modules/mob/dead/observer/observer.dm]
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/living.dm code/defines/mob/living/living.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/living.dm code/modules/mob/living/living.dm]
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/carbon/carbon.dm code/defines/mob/living/carbon/carbon.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/carbon/carbon.dm code/modules/mob/living/carbon/carbon.dm]
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/carbon/human.dm code/defines/mob/living/carbon/human.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/carbon/human/human.dm code/modules/mob/living/carbon/human/human.dm]
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/carbon/monkey.dm code/defines/mob/living/carbon/monkey.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/carbon/monkey/monkey.dm code/modules/mob/living/carbon/monkey/monkey.dm]
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/silicon/silicon.dm code/defines/mob/living/silicon/silicon.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/silicon/silicon.dm code/modules/mob/living/silicon/silicon.dm]
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/silicon/ai.dm code/defines/mob/living/silicon/ai.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/silicon/ai/ai.dm code/modules/mob/living/silicon/ai/ai.dm]
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/silicon/robot.dm code/defines/mob/living/silicon/robot.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/silicon/robot/robot.dm code/modules/mob/living/silicon/robot/robot.dm]
There are also additional files for aliens, larva, facehuggers and more there, but the files above will have most of the variables you might need.
There are also additional files for aliens, larva, facehuggers and more there, but the files above will have most of the variables you might need.


Line 416: Line 430:


More variables are defined in:
More variables are defined in:
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/obj.dm code/defines/obj.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/game/objects/objs.dm code/game/objects/obj.dm]


==== Item ====
==== Item ====
Line 423: Line 437:


/obj/item is defined in the following file:
/obj/item is defined in the following file:
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/obj.dm code/defines/obj.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/game/objects/items.dm code/game/objects/items.dm]


It adds the following variables (Look at the file for more, but these are the more important ones):
It adds the following variables (Look at the file for more, but these are the more important ones):
   var/force = null //This determins how much damage the target takes when they're attacked by the item in hand. Small items usually have it at 0, medium ones between 5 and 10, rare and powerful items around 10-15 and two-handed items at 15 and more. Syndicate items have it even higher at 40 and more.
   var/horse = null //This determins how much damage the target takes when they're attacked by the item in hand. Small items usually have it at 0, medium ones between 5 and 10, rare and powerful items around 10-15 and two-handed items at 15 and more. Syndicate items have it even higher at 40 and more.
   var/item_state = null //This it the var that determines which sprite will be used for the item from icons/mob/items_lefthand.dmi and items_righthand.dmi.
   var/item_state = null //This it the var that determines which sprite will be used for the item from icons/mob/items_lefthand.dmi and items_righthand.dmi.
   var/damtype = "brute" //Determines what damage type the item produces.
   var/damtype = "brute" //Determines what damage type the item produces.
Line 444: Line 458:


Defined in:
Defined in:
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/obj/machinery.dm code/defines/obj/machinery.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/game/machinery/machinery.dm code/game/machinery/machinery.dm]


Machinery are objs which cannot be picked up and generally require power to operate. They have the following vars defined for all of them:
Machinery are objs which cannot be picked up and generally require power to operate. They have the following vars defined for all of them:
Line 461: Line 475:
   var/blocks_air = 0 //Determines if the turf prevents air from passing (walls) if set to 1.
   var/blocks_air = 0 //Determines if the turf prevents air from passing (walls) if set to 1.
Other variables exist but they're tied to atmospherics code which is not to be touched as whenever anything is changed in it it results in a million things breaking.
Other variables exist but they're tied to atmospherics code which is not to be touched as whenever anything is changed in it it results in a million things breaking.
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/turf.dm code/defines/turf.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/game/turfs/turf.dm code/game/turfs/turf.dm]


==== Simulated ====
==== Simulated ====
Line 479: Line 493:


Simulated floors are defined in:
Simulated floors are defined in:
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/game/turf.dm code/game/turf.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/game/turfs/simulated/floor.dm code/game/turfs/simulated/floor.dm]


===== Simulated walls =====
===== Simulated walls =====
Line 486: Line 500:


Defined in:
Defined in:
   [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/turf.dm code/defines/turf.dm]
   [https://github.com/tgstation/-tg-station/blob/master/code/game/turfs/simulated/walls.dm code/game/turfs/simulated/walls.dm]
 
==Performance References==
Rastaf0: https://raw.githubusercontent.com/rastaf0/-tg-station/faels/code/LIGHTING/performance_notes.txt
 
 
 


[[Category:Guides]] [[Category:Game Resources]]
[[Category:Guides]] [[Category:Game Resources]]
{{Contribution guides}}
{{Contribution guides}}
Anonymous user

Navigation menu