Script:setgroup: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 6: | Line 6: | ||
|parameters= | |parameters= | ||
group string* Name of the group to add or remove | group string* Name of the group to add or remove | ||
|intro=Entities with at least one shared group will not damage each other using (some?) area damages and spells. The {{Command|sendevent|-g}} command can use groups to limit the entities receiving the event and the {{Command|if|isgroup}} and {{Command|if|!isgroup}} commands can be used to check if another entity is part of a group. | |intro=Entities with at least one shared group will not damage each other using (some?) area damages and spells. The {{Command|sendevent|-g}} command can use groups to limit the entities receiving the event and the {{Command|if|isgroup}} and {{Command|if|!isgroup}} commands can be used to check if another entity is part of a group. [[Command:setshop|Shop containers]] can be set to only accept [[:Category:Items|items]] of certain groups using {{Command|shopcategory}}. | ||
}} | }} | ||
Latest revision as of 10:36, 26 June 2022
The setgroup
script command is used to add or remove a group for an entity. Entities with at least one shared group will not damage each other using (some?) area damages and spells. The sendevent -g
command can use groups to limit the entities receiving the event and the if isgroup
and if !isgroup
commands can be used to check if another entity is part of a group. Shop containers can be set to only accept items of certain groups using shopcategory
.
Usage
setgroup [-r] <group*>
Context: Any Entity
Flags:
-r
: Remove the entity from a group instead of adding it
Parameters:
Parameter | Type | Description |
---|---|---|
group |
string or variable |
Name of the group to add or remove |
Special groups
Entities in the demon
group are affected by the Control demon () spell.
Collisions involving entities in the door
group will cause the collide_door
event to be sent to both the door and the colliding entity.