Wave Image
















  • help > actions > groups
    Actions -> groups:
    
    Complex action forms are allowed to receive multiple targets
    in the form of an object array i.e. ({misery_ob, traveller_ob,
    wildcat_ob}) and groups extend this functionality to allow
    multiple objects to be considered as a single target for
    messaging purposes.
    
    Such an array might look like: ({misery_ob, ({traveller_ob,
    wildcat_ob}) }) and would imply that the action has two
    targets: Misery, and a grouping of traveller+wildcat.
    
    To give a fairly frivolous example, let's say you want an
    emote that allows player X to play a prank on player Y
    and get laughter from any spectators.
    
    You might currently try:
    mercury_ob->complex_action("$N $vpull a prank on $t, causing
    $t2 and $t3 to $v2break into laughter.", ({misery_ob, traveller_ob,
    wildcat_ob }))
    
    mercury_ob->complex_action("$N $vpull a prank on $t, causing 
    $t2 to $v2break into laughter.", ({misery_ob, ({traveller_ob,
    wildcat_ob}) }))
    
    There's no real difference in _these_ messaging options, but this
    style of reference breaks down quickly if you need to reference
    the "group" multiple times.
    
    mercury_ob->complex_action("$N $vpull a prank on $t, causing
    $t2 and $t3 to $v2snicker until $t $vlook at $t2 and $t3.", 
    ({misery_ob, traveller_ob, wildcat_ob })) = "You pull a prank 
    on Misery, causing Traveller and Wildcat to snicker until 
    Misery looks at him and him."
    
    You could make this slightly better by forcing the actions
    to use names on all references, or by hacking the player
    names directly into the string, but using the full names
    on each reference is also awkward and clunky. Try:
    
    mercury_ob->complex_action("$N $vpull a prank on $t, causing
    $t2 to $v2snicker until $t $vlook at $t2.", ({misery_ob, ({traveller_ob,
    wildcat_ob}) })) = "You pull a prank on Misery, causing Traveller
    and Wildcat to snicker until Misery looks at them."
    
    While I've given a rather frivolous example, group messaging
    can also allow for robust messaging of multi-target combat/skills.