Skip to content

Commit f2bfda8

Browse files
committed
documents procs all the way down to istype()
1 parent b445c5b commit f2bfda8

39 files changed

+387
-50
lines changed

content/language/proc/fexists.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ type = "num" # AUTOGEN FIELD
88
description = "1 if the file exists; 0 if it does not."
99
+++
1010

11-
Determines if the file exists in the file system. Unlike [fdel()](@/language/proc/fdel.md), this exclusively operates on files - it cannot determine if a directory exists.
11+
Determines if the file exists in the file system. Unlike [fdel()](@/language/proc/fdel.md), this exclusively operates on files - it cannot determine if a directory exists.
12+
13+
```dm
14+
if(!fexists("code.dme"))
15+
world.log << "How did we get here?"
16+
```

content/language/proc/flick.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
title = "flick"
33
[[extra.args]]
44
name = "Icon" # AUTOGEN STATIC
5+
description = "An icon file, or a named icon state."
56
[[extra.args]]
67
name = "Object" # AUTOGEN STATIC
7-
+++
8+
description = "The object being changed."
9+
+++
10+
11+
Temporarily replaces the {{ atom(var="icon") }}, or {{ atom(var="icon_state") }}, of the specified object for the duration of the animation. This only occurs on the client - the icon or icon_state variable is not actually altered.
12+
13+
```dm
14+
/obj/button/Click()
15+
flick("pressed_animation", src)
16+
usr << "You pressed me!"
17+
```

content/language/proc/flist.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22
title = "flist"
33
[[extra.args]]
44
name = "Path" # AUTOGEN STATIC
5+
description = "The path in the file system to return the contents of."
56
[extra.return]
67
type = "/list" # AUTOGEN FIELD
7-
+++
8+
description = "A list of files and directories in the specified path."
9+
+++
10+
11+
This is non-recursive, and only returns the contents of the directory specified. Names returned are relative to the specified path.
12+
13+
Path must be a directory with a trailing slash.
14+
15+
```dm
16+
// given a directory structure like
17+
//
18+
// example
19+
// ├── maps
20+
// │ └── map.dmm
21+
// ├── code.dme
22+
// └── icons
23+
// ├── icon.dmi
24+
// └── other_icon.dmi
25+
26+
for(var/item in flist("icons/"))
27+
world.log << item // "icon.dmi", "other_icon.dmi"
28+
29+
for(var/item in flist("./"))
30+
world.log << item // "maps/", "code.dme", "icons/"
31+
32+
```

content/language/proc/floor.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
title = "floor"
33
[[extra.args]]
44
name = "A" # AUTOGEN STATIC
5+
description = "A number."
56
[extra.return]
67
type = "num" # AUTOGEN FIELD
7-
+++
8+
description = "The largest integer less than or equal to A."
9+
+++
10+
11+
```dm
12+
world.log << floor(0.999999) // 0
13+
world.log << floor(-0.00001) // 1
14+
```

content/language/proc/fract.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
title = "fract"
33
[[extra.args]]
44
name = "n" # AUTOGEN STATIC
5+
description = "A number."
56
[extra.return]
67
type = "num" # AUTOGEN FIELD
7-
+++
8+
description = "The numbers after the decimal point."
9+
+++
10+
11+
```dm
12+
world.log << fract(0.1234) // 1234
13+
world.log << fract(-0.1234) // -1234
14+
```

content/language/proc/ftime.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@
22
title = "ftime"
33
[[extra.args]]
44
name = "File" # AUTOGEN STATIC
5+
description = "The path to the entry on the file system to test."
56
[[extra.args]]
67
name = "IsCreationTime" # AUTOGEN STATIC
78
default_value = "0" # AUTOGEN FIELD
9+
description = "1 return the creation date; 0 for last modified date"
810
[extra.return]
911
type = "num" # AUTOGEN FIELD
10-
+++
12+
description = "Date expressed as number of deciseconds since Jan 1, 2000."
13+
+++
14+
15+
This value can be formatted using [time2text()](@/language/proc/time2text.md).
16+
17+
```dm
18+
var/time = ftime("environment.dme") // 7.76174e+09
19+
world.log << time2text(time) // Mon Aug 05 12:58:22 2024
20+
```

content/language/proc/get_dist.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@
22
title = "get_dist"
33
[[extra.args]]
44
name = "Loc1" # AUTOGEN STATIC
5+
description = "An object on the map."
56
type = "/atom" # AUTOGEN FIELD
67
[[extra.args]]
78
name = "Loc2" # AUTOGEN STATIC
9+
description = "An object on the map."
810
type = "/atom" # AUTOGEN FIELD
911
[extra.return]
1012
type = "num" # AUTOGEN FIELD
11-
+++
13+
description = "The number of tiles between both arguments."
14+
+++
15+
16+
If either object is not on the map, 127 will be returned.
17+
If both arguments are the same object, -1 will be returned.
18+
19+
{% parity() %}
20+
In BYOND, the distance in Z level is also calculated.
21+
{% end %}
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
+++
22
title = "get_step_away"
3+
[extra.return]
4+
type = "/turf, num"
5+
description = "The new position; or 0 if no movement has occured."
36
[[extra.args]]
47
name = "Ref" # AUTOGEN STATIC
58
type = "/atom/movable" # AUTOGEN FIELD
9+
description = "The moving object."
610
[[extra.args]]
711
name = "Trg" # AUTOGEN STATIC
812
type = "/atom" # AUTOGEN FIELD
13+
description = "The object being moved away from."
914
[[extra.args]]
1015
name = "Max" # AUTOGEN STATIC
1116
default_value = "5" # AUTOGEN FIELD
12-
+++
17+
description = "The maximum distance between Ref and Trg."
18+
+++
19+
20+
Calculates the step in the opposite direction from the provided object.
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
+++
22
title = "get_step_rand"
3+
[extra.return]
4+
type = "/turf, num"
5+
description = "The new position; or 0 if no movement has occured."
36
[[extra.args]]
47
name = "Ref" # AUTOGEN STATIC
58
type = "/atom/movable" # AUTOGEN FIELD
6-
+++
9+
description = "The moving object."
10+
+++
11+
12+
Calculates the destination of Ref taking a step in a random direction.

content/language/proc/get_step_to.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ title = "get_step_to"
44
od_unimplemented = true # AUTOGEN FIELD
55
[[extra.args]]
66
name = "Ref" # AUTOGEN STATIC
7+
description = "The moving object."
78
[[extra.args]]
89
name = "Trg" # AUTOGEN STATIC
10+
description = "The object being moved away towards."
911
[[extra.args]]
1012
name = "Min" # AUTOGEN STATIC
1113
default_value = "0" # AUTOGEN FIELD
12-
+++
14+
description = "If the two objects are within this many steps, no step is calculated."
15+
[extra.return]
16+
type = "/turf"
17+
description = "The location that should be moved to; 0 if no path is calculated."
18+
+++

0 commit comments

Comments
 (0)