Skip to main content
source

Types


actor-link-info: basicsource

Functions


actor-link-dead-hook(arg0: entity-actor, arg1: pointer) => symbolsource
actor-link-subtask-complete-hook(arg0: entity-actor, arg1: pointer) => symbolsource
actor-link-subtask-incomplete-count-hook(arg0: entity-actor, arg1: pointer) => symbolsource

alt-actor-list-subtask-incomplete-count

alt-actor-list-subtask-incomplete-count(arg0: process-drawable) => intsource

entity-actor-count

entity-actor-count(arg0: res-lump, arg1: symbol) => intsource

entity-actor-lookup

entity-actor-lookup(arg0: res-lump, arg1: symbol, arg2: int) => entity-actorsource

entity-h

source

Types


actor-bank

actor-bank: basicsource
Fields
type: type
pause-dist: meters
birth-dist: meters
birth-max: int32

actor-group

actor-group: inline-array-classsource
Fields
type: type
length: int32
allocated-length: int32
_data: uint8
data: actor-reference

actor-reference

actor-reference: structuresource
Fields
actor: entity
id: uint32

entity

entity: res-lumpsource
Fields
type: type
length: int32
allocated-length: int32
data-base: pointer
data-top: pointer
data-size: int32
extra: entity-links
tag: pointer
trans: vector
aid: uint32
Methods
birth!(obj: entity) => _type_source
kill!(obj: entity) => _type_source
add-to-level!(obj: entity-actor, arg0: level-group, arg1: level, arg2: actor-id) => nonesource
remove-from-level!(obj: entity, arg0: level-group) => _type_source
get-level(obj: entity) => levelsource

entity-actor

entity-actor: entitysource
Fields
type: type
length: int32
allocated-length: int32
data-base: pointer
data-top: pointer
data-size: int32
extra: entity-links
tag: pointer
trans: vector
aid: uint32
etype: type
task: game-task
kill-mask: task-mask
vis-id: int16
quat: quaternion
Methods
next-actor(obj: entity-actor) => entity-actorsource
prev-actor(obj: entity-actor) => entity-actorsource
debug-print(obj: entity-actor, arg0: symbol, arg1: type) => nonesource
toggle-status(obj: entity-actor, arg0: entity-perm-status, arg1: symbol) => nonesource
get-simple-travel-vector(obj: entity-actor, arg0: vector, arg1: vector, arg2: vector, arg3: object, arg4: float) => nav-meshsource
project-point-to-nav-mesh(obj: entity-actor, arg0: vector, arg1: vector, arg2: nav-poly, arg3: float) => nav-polysource

entity-camera

entity-camera: entitysource
Fields
type: type
length: int32
allocated-length: int32
data-base: pointer
data-top: pointer
data-size: int32
extra: entity-links
tag: pointer
trans: vector
aid: uint32
connect: connectable

entity-info

entity-info: basicsource
Fields
type: type
ptype: type
package: string
art-group: pair
pool: symbol
heap-size: int32
entity-links: structuresource
Fields
prev-link: entity-links
next-link: entity-links
entity: entity
process: process
level: level
vis-id: int32
kill-mask: task-mask
vis-dist: meters
trans: vector
perm: entity-perm
status: uint16
aid: uint32
task: uint8
Methods
birth?(obj: entity-links, arg0: vector) => symbolsource
entity-links-array: inline-array-classsource
Fields
type: type
length: int32
allocated-length: int32
_data: uint8
data: entity-links

entity-nav-mesh

entity-nav-mesh: entitysource
Fields
type: type
length: int32
allocated-length: int32
data-base: pointer
data-top: pointer
data-size: int32
extra: entity-links
tag: pointer
trans: vector
aid: uint32
nav-mesh: nav-mesh
Methods
initialize-nav-mesh!(obj: entity-nav-mesh) => nonesource
Initialize the nav-mesh in this entity.
debug-draw(obj: entity-nav-mesh) => nonesource

entity-perm

entity-perm: structuresource
Fields
user-object: object
user-uint64: uint64
user-float: float
user-int32: int32
user-uint32: uint32
user-int16: int16
user-uint16: uint16
user-int8: int8
user-uint8: uint8
status: entity-perm-status
dummy: uint8
task: uint8
aid: actor-id
quad: uint128
Methods
update(obj: entity-perm, arg0: symbol, arg1: entity-perm-status) => _type_source

entity-perm-array

entity-perm-array: inline-array-classsource
Fields
type: type
length: int32
allocated-length: int32
_data: uint8
data: entity-perm

entity-race-mesh

entity-race-mesh: entitysource
Fields
type: type
length: int32
allocated-length: int32
data-base: pointer
data-top: pointer
data-size: int32
extra: entity-links
tag: pointer
trans: vector
aid: uint32
race-mesh: race-mesh
Methods
entity-race-mesh-method-27: unknown
entity-race-mesh-method-28: unknown

Variables


*ACTOR-bank*

*ACTOR-bank*: actor-banksource

*generate-actor-vis-output*

*generate-actor-vis-output*: symbolsource

*generate-actor-vis-start*

*generate-actor-vis-start*: symbolsource

*generate-actor-vis*

*generate-actor-vis*: symbolsource

entity-table

source

Functions


entity-info-lookup

entity-info-lookup(arg0: type) => entity-infosource
Given a type, return the entity-info from *entity-info* whos type
matches the `ptype` field. Set's `method 13` on said type that returns the `length`
off the [[entity-info]]

If nothing matches, set `method 13` to `#f` and return `#f`

Variables


*entity-info*

*entity-info*: arraysource

entity

source

Types


debug-actor-info

debug-actor-info: basicsource
Fields
type: type
name: basic
handle: handle
process: basic
pid: int32

Functions


check-for-rougue-process

check-for-rougue-process(arg0: process, arg1: int, arg2: int, arg3: level) => nonesource

debug-actor

debug-actor(arg0: string) => nonesource

draw-actor-marks

draw-actor-marks(arg0: process) => nonesource

dump-entity-remap

dump-entity-remap(arg0: object, arg1: object) => nonesource

entity-actor-from-level-name

entity-actor-from-level-name(arg0: level) => entity-actorsource

entity-birth-no-kill

entity-birth-no-kill(arg0: entity) => processsource

entity-by-aid

entity-by-aid(arg0: uint) => entitysource

entity-by-meters

entity-by-meters(arg0: float, arg1: float, arg2: float) => entity-actorsource

entity-by-name

entity-by-name(arg0: string) => entitysource

entity-by-type

entity-by-type(arg0: type) => entity-actorsource

entity-count

entity-count() => intsource

entity-deactivate-handler

entity-deactivate-handler(arg0: process, arg1: entity-actor) => nonesource

entity-nav-mesh-by-aid

entity-nav-mesh-by-aid(arg0: actor-id) => entity-nav-meshsource

entity-process-count

entity-process-count(arg0: symbol) => intsource

entity-remap-names

entity-remap-names(arg0: pair) => nonesource

entity-speed-test

entity-speed-test(arg0: string) => entitysource

entity-task-complete-off

entity-task-complete-off(arg0: entity) => nonesource

entity-task-complete-on

entity-task-complete-on(arg0: entity) => nonesource

expand-bounding-box

expand-bounding-box(arg0: vector, arg1: vector, arg2: vector, arg3: vector) => nonesource

expand-vis-box-with-point

expand-vis-box-with-point(arg0: entity, arg1: vector) => nonesource

find-nearest-entity

find-nearest-entity(arg0: vector, arg1: type) => entitysource

init-entity

init-entity(arg0: process, arg1: entity-actor, arg2: process) => nonesource
nav-mesh-from-res-tag(arg0: entity, arg1: symbol, arg2: int) => nav-meshsource

process-by-ename

process-by-ename(arg0: string) => processsource

process-drawable-from-entity!

process-drawable-from-entity!(arg0: process-drawable, arg1: entity-actor) => nonesource

process-drawable-scale-from-entity!

process-drawable-scale-from-entity!(arg0: process-drawable, arg1: entity) => nonesource

process-entity-set!

process-entity-set!(arg0: process, arg1: entity) => entitysource

process-entity-status!

process-entity-status!(arg0: process, arg1: entity-perm-status, arg2: symbol) => entity-perm-statussource

process-status-bits

process-status-bits(arg0: process, arg1: symbol) => nonesource

process-task-mask

process-task-mask(arg0: process) => task-masksource

reset-actors

reset-actors(arg0: symbol) => nonesource

reset-cameras

reset-cameras() => nonesource

update-actor-vis-box

update-actor-vis-box(arg0: process-drawable, arg1: vector, arg2: vector) => nonesource

Variables


*compact-actors*

*compact-actors*: symbolsource

*debug-actor-info*

*debug-actor-info*: debug-actor-infosource

*pid-string*

*pid-string*: stringsource

*spawn-actors*

*spawn-actors*: symbolsource

*vis-actors*

*vis-actors*: symbolsource

Types


res-lump

res-lump: basicsource
Fields
type: type
length: int32
allocated-length: int32
data-base: pointer
data-top: pointer
data-size: int32
extra: entity-links
tag: pointer
Methods
get-property-data(obj: res-lump, arg0: symbol, arg1: symbol, arg2: float, arg3: pointer, arg4: pointer, arg5: pointer) => pointersource
Returns an address to a given property's data at a specific time stamp, or default on error.
name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp.
default is the default result returned in the case of an error.
tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f
buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode.
get-property-struct(obj: res-lump, arg0: symbol, arg1: symbol, arg2: float, arg3: structure, arg4: pointer, arg5: pointer) => structuresource
Returns a given struct property's value at a specific time stamp, or default on error.
name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp.
default is the default result returned in the case of an error.
tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f
buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode.
get-property-value(obj: res-lump, arg0: symbol, arg1: symbol, arg2: float, arg3: uint128, arg4: pointer, arg5: pointer) => uint128source
Returns a given value property's value at a specific time stamp, or default on error.
name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp.
default is the default result returned in the case of an error.
tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f
buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode.
get-property-value-float(obj: res-lump, arg0: symbol, arg1: symbol, arg2: float, arg3: float, arg4: pointer, arg5: pointer) => floatsource
same as get-property-value but float type is checked first?
get-tag-index-data(obj: res-lump, arg0: int) => pointersource
get the data address of the n'th tag.
get-tag-data(obj: res-lump, arg0: res-tag) => pointersource
get the data address of the specified tag.
allocate-data-memory-for-tag!(obj: res-lump, arg0: res-tag) => res-tagsource
Find space for the data described by arg0 in obj.
Returns a tag with data-offset set correctly for this res-lump.
If the lump already contains memory for the given tag, and it is big enough,
it will be reused. Alignment will be at least 8 bytes.
If the input tag has elt-count = 0, it will return a tag for elt-count = 1.
sort!(obj: res-lump) => _type_source
Sort all tags based on name, then key-frame.
add-data!(obj: res-lump, arg0: res-tag, arg1: pointer) => res-lumpsource
Given a tag and a pointer to its data, copy it to this res-lump.
This doesn't seem to do the right thing if the given tag is a non-inline tag
with > 1 element.
add-32bit-data!(obj: res-lump, arg0: res-tag, arg1: object) => res-lumpsource
Add a single 32-bit value using add-data.
lookup-tag-idx(obj: res-lump, arg0: symbol, arg1: symbol, arg2: float) => res-tag-pairsource
Look up the index of the tag containing with the given name and timestamp.
Correct lookups return a res-tag-pair, which contains one tag index in the lower 32 bits and one in the upper 32 bits.
Depending on the mode, they may be the same, or they may be two tags that you should interpolate
between, if the exact time was not found.

name-sym should be the name of the thing you want.
time is for the timestamp you want.
If mode = 'base, then both the indices are the same and the timestamp is ignored.
If mode = 'interp, then it tries to get closest below/closest above (or both the same, if exact match found)
If mode = 'exact, then it requires an exact timestamp match and both indices are the same.
If things go wrong, returns a negative number
make-property-data(obj: res-lump, arg0: float, arg1: res-tag-pair, arg2: pointer) => pointersource
Returns (a pointer to) the value data of a property with the tag-pair.
If tag-pair does not represent an exact point in the timeline, then the data is interpolated based on time
with the result written into buf. buf must have enough space to copy all of the data.
Otherwise, simply returns an address to the resource binary.
get-curve-data!(obj: res-lump, arg0: curve, arg1: symbol, arg2: symbol, arg3: float) => symbolsource
Read curve data and write it to curve-target. Return #t if both control points and knots data was succesfully read, #f otherwise.

res-tag

res-tag: uint128source

res-tag-pair

res-tag-pair: uint64source

Variables


*res-key-string*

*res-key-string*: stringsource
Expand description
res is a generic storage system for not very large data, used mostly for the game entities.

These res files store collections of data, which can be as values (int8, int16, int32, int64, uint8, uint16, uint32, uint64, float, vector), or any structure (as references), which are tagged and identified with a res-tag.

The data is stored similar to an unboxed inline-array, the type of the data is stored in the res-tag.



A res-lump stores and is used to access all of the data for a single "resource", a collection of varying data.

This is similar to a C++ map or C# dictionary. The key is a res-tag and the value is the corresponding binary data.



A res-tag is a tag that contains information about a particular property of this resource, such as type, name, and amount of elements.

For example, information about an array of vectors that make up a path - for a moving platform - or an integer to store its entity ID.



Keyframes are used to specify when/where the data is relevant.

For example (this is made-up), say you have a camera spline, and you want the FOV to change at three specific points:

when it starts, somewhere in the middle, and at the end.

You would store an array of three FOV values. The key-frame field could then be used to say at which point in the spline

the FOV should be at that value. If the camera is somewhere between those points, the result could then be interpolated.



Properties are looked up from a res-lump using their name (a symbol).

You can look up the data of the property you want directly using the various get-property methods.

Curves can be quickly filled in using the get-curve-data! method.





This is updated from the entity system used in Crash 2, which had most of these features and worked very similarly!
### Variables ---

*res-static-buf*

*res-static-buf*: pointersource