Spawn: Difference between revisions

From Eternity Wiki
Jump to navigationJump to search
(New page: Type: Miscellaneous, parameterized Parameter Information: *Unknown 1 = DeHackEd number of thing type to spawn (must be valid, no default) *Unknown 2 = Integer amount of units to add to...)
 
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
Type: Miscellaneous, parameterized
Spawn appears both as an ACS function and as an EDF codepointer. Details follow.
==ACS Function==
{{ACSFunction|description=Spawns an object of the provided type at the given coordinates, facing the given angle.
|usage=
''Boolean'' '''Spawn'''(''str type'', ''fixed x'', ''fixed y'', ''fixed z'', ''int tid'', ''int angle'')


Parameter Information:  
''Boolean'' '''SpawnForced'''(''str type'', ''fixed x'', ''fixed y'', ''fixed z'', ''int tid'', ''int angle'')
*Unknown 1 = DeHackEd number of thing type to spawn (must be valid, no default)
|parameters=
*Unknown 2 = Integer amount of units to add to z coordinate of object (default = 0)
*''type'': name of [[thingtype]] to spawn. Both main name and ACS compatibility name are accepted.
*''x'', ''y'', ''z'': [[fixed point]] coordinates where to spawn the thing.
*''tid'': optional [[TID]] to give to the new thing.
*''angle'': [[byte angle]] of where the thing should look on spawn
|return='''TRUE''' if spawning succeeded, '''FALSE''' otherwise.
|notes=Spawning with '''Spawn''' will only work if there's enough room, otherwise nothing will happen and the function will return '''FALSE'''. Use '''SpawnForced''' if you need to always spawn something on the location.
|id=ACC internal
|seealso=
*[[Thing_Spawn]]}}
==EDF Codepointer==
{{codepointer|description=Spawns an object of the provided type at the calling object's location. Friendliness of the calling object will be transferred to the spawned object.
|usage='''Spawn'''


Purpose: Spawns an object of the provided type at the calling object's location. Friendliness of the calling object will be transferred to the spawned object. This codepointer is new to MBF.
'''misc1''' ''name''


Notes: This codepointer will no longer crash on invalid thing type numbers as of Eternity Engine v3.31 public beta 3. If the type indicated is not valid, the pointer will do nothing. Also note that if both the source and spawned object are solid, they will become stuck to each other. This codepointer is more suitable for boss-brain-like effects.
'''misc2''' ''z''
|parameters=
*'''misc1''' = Thing mnemonic or DeHackEd number to spawn (must be valid, no default)
*'''misc2''' = Integer amount of units to add to z coordinate of object (default = 0)
|notes=If the type indicated is not valid, the pointer will do nothing. Also note that if both the source and spawned object are solid, they will become stuck to each other. This codepointer is more suitable for boss-brain-like effects.


Thunk: Yes.
NOTE: for [[Decorate state syntax|Decorate]] availability, use [[SpawnEx]] or [[SpawnAbove]].
|seealso=
*[[SpawnAbove]]
*[[SpawnEx]]}}

Latest revision as of 01:31, 10 May 2026

Spawn appears both as an ACS function and as an EDF codepointer. Details follow.

ACS Function

Description

This is an ACS built-in function.

Spawns an object of the provided type at the given coordinates, facing the given angle.

Usage

Boolean Spawn(str type, fixed x, fixed y, fixed z, int tid, int angle)

Boolean SpawnForced(str type, fixed x, fixed y, fixed z, int tid, int angle)

Parameters

  • type: name of thingtype to spawn. Both main name and ACS compatibility name are accepted.
  • x, y, z: fixed point coordinates where to spawn the thing.
  • tid: optional TID to give to the new thing.
  • angle: byte angle of where the thing should look on spawn

Return value

TRUE if spawning succeeded, FALSE otherwise.

Examples

No examples given.

Notes

Spawning with Spawn will only work if there's enough room, otherwise nothing will happen and the function will return FALSE. Use SpawnForced if you need to always spawn something on the location.

This function's identification in zspecial.acs is: ACC internal.

See also

EDF Codepointer

Description

Spawns an object of the provided type at the calling object's location. Friendliness of the calling object will be transferred to the spawned object.

Usage

Spawn

misc1 name

misc2 z

Parameters

  • misc1 = Thing mnemonic or DeHackEd number to spawn (must be valid, no default)
  • misc2 = Integer amount of units to add to z coordinate of object (default = 0)

Examples

No examples given.

Notes

If the type indicated is not valid, the pointer will do nothing. Also note that if both the source and spawned object are solid, they will become stuck to each other. This codepointer is more suitable for boss-brain-like effects.

NOTE: for Decorate availability, use SpawnEx or SpawnAbove.

See also