Thread: New entities and mapping features in SC 4.5

Page 1 of 4 1234 LastLast
Results 1 to 25 of 80
  1. #1
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,485

    Standard Crate New entities and mapping features in SC 4.5


    ---------------------------------------------------------------------------
    :: Foreword ::
    ---------------------------------------------------------------------------


    The following is a near-complete list of all the new entities, entity parameters, flags, and mapping-specific features we will be bringing you in Sven Co-op 4.5. This thread does not list or explain any of the entities or features that were already in previous versions of Sven Co-op. You can find these in the Entity Guide or in JPolito’s 4.0 Feature thread.

    A demo .rmf showing some uses of the new features can be found here: http://www.svencoop.com/forums/showp...4&postcount=35

    For Sven Co-op 3.0 entities: Official Sven Co-op Entity Guide
    For Sven Co-op 4.0 entities: JPolito’s 4.0 Feature thread
    For Sven Co-op 4.6 entities: JPolito's 4.6 Feature thread
    For ALL Sven Co-op entities: Silencer’s Sven Co-op Entity Guide



    ---------------------------------------------------------------------------
    :: New Entities ::
    ---------------------------------------------------------------------------


    I) trigger_changevalue

    Purpose:
    This entity does what it says it does, it changes the keyvalue of an entity.

    Flags:
    Code:
    "Don't use X" - Do not set X value of a vector (origin, angles, ...)
    "Don't use Y" - Do not set Y value of a vector (origin, angles, ...)
    "Don't use Z" - Do not set Z value of a vector (origin, angles, ...)
    KeyValues:
    Code:
    "Name" (targetname) - Name of this entity
    "Target" (target) - Name of the target entity
    "Key Name" (m_iszValueName) - Name of the value to change (the key, e.g. "health")
    "New Value" (m_iszNewValue) - The new value
    "What to do" (m_iszValueType) - See Usage
    Usage:
    The entity can either set a new value (replacing the old one) or do arithmetic operations or even binary logical operations on values.
    The following operations are available:
    Code:
    -Replace Value
    
    -Add (arithmetic +)
    -Multiply (arithmetic *)
    -Subtract (arithmetic -)
    -Divide (arithmetic /)
    
    -AND (logical & )
    -OR (logical | )
    -NAND (logical ~& )
    -NOR (logical ~| )
    Arithmetic only works on numbers (also vectors!), logical only works on integers (no vectors)

    What's it good for?
    There are several scenarios where this will be handy. For example you could dynamically recolor Sprites with arithmetic + and value (1 0 0) (too make it red over time). You could change the targetname of freshly created monsters with an increasing number to create 100 uniquely targettable monsters with only 4 entities (squadmaker, trigger_changevalue, multi_manager and trigger_relay) You can instantly change monsters health to a value you like. You can use the logical operations to activate or deactivate spawnflags. Etc etc...

    Drawbacks
    Replacing a keyvalue works perfectly, only cutback are values that entities only check on spawn and then don't care about later.


    II) trigger_copyvalue

    Purpose:
    It copies a keyvalue of one entity to another keyvalue of another entity.

    Flags:
    Code:
    "Don't use X" - Do not set X value of a vector (origin, angles, ...)
    "Don't use Y" - Do not set Y value of a vector (origin, angles, ...)
    "Don't use Z" - Do not set Z value of a vector (origin, angles, ...)
    "Constant" - If active, the target entity's value will always be equal to the source entity's value
    "Start On" - only when "Constant" is active: Start on (self explanatory)
    -Angles to Direction 
    -Direction to Angles (Useful if you want to move something in the direction it's facing or force players to look in the direction of a train they are on.)
    KeyValues:
    Code:
    "Name" (targetname) - Name of this entity
    "Target" (target) - Name of the target entity
    "Target Key" (m_iszOldValueName) - Name of the target value (the key, e.g. "health")
    "Source" (netname) - Name of the source entity
    "Source Key" (m_iszNewValueName) - Name of the source value (the key, e.g. "health")
    "What to do" (m_iszValueType) - See Usage
    Usage:
    Almost the same as trigger_changevalue, only that it will take the source entity's value and use it to replace (or modify) the target entity's value.
    If it is set to "Constant", this will happen as long as it is on (trigger it with trigger_state "On", "Toggle" or "Off" to change it's activity state), otherwise it will copy the value once (when triggered) and then leave it alone again.

    What's it good for?
    For example giving players a special item when they reach a score of 1000 (score is the keyvalue "frags" in players - what, you can't target players? We will come to that...) Or you could copy the health of a boss to 4 game_counter, one firing at 750, one firing at 500 and one firing at 250, triggering scripted scenarios for your ultimate boss fight.


    III) trigger_renameplayer

    Purpose:
    This entity is useful when you want to target a player (for example to attach something with a trigger_setorigin)

    Flags:
    Code:
    None
    KeyValues:
    Code:
    "Name" (targetname) - Name of this entity
    "Player Name" (netname) - Name to give the player
    Usage:
    The player has to trigger this entity: Create a button or a trigger_once/trigger_multiple that targets the trigger_renameplayer. When the button was used by a player or the trigger_once/trigger_multiple has been touched by a player, the trigger_renameplayer will change that player's name.
    You can also use info_player_start, info_player_deathmatch, info_player_dm2 and info_player_coop to give players a targetname. Use "netname" for this.

    What's it good for?
    You could perhaps use a player as Copy Pointer in a trigger_setorigin. You could also let env_lasers shoot at players or use the trigger_copyvalue entity to use player keyvalues for scripting (Mad Barney: "Hey, you don't even have more then 20 points, you can't come in! I don't like losers, hahaha!")


    IV) game_slot_counter

    Purpose:
    This entity checks how many slots the server has and triggers it's target if the specified value matches.

    Flags:
    Code:
    None
    KeyValues:
    Code:
    "Value" (frags) - The value to check against
    "Target" (target) - Name of the target entity
    Usage:
    Put it in the map, set the value and the target.

    What's it good for?
    You could make cooperative puzzles depending on the player amount. One player slot? Propably some loner with bad internet connection. Be a mensch, let him play. 32 player slot? That riddle won't solve with only 4 players, bad luck.


    V) game_player_counter

    Purpose:
    This entity checks how many players are on the server and triggers it's targets if the specified values match.

    Flags:
    Code:
    None
    KeyValues:
    Code:
    "Min Value" (frags) - The min value to check against
    "Max Value" (health) - The max value to check against
    "Min Target" (target) - Name of the minvalue target entity
    "Max Target" (netname) - Name of the maxvalue target entity
    "Filter player targetname" (message) - Choose which players are counted
    Usage:
    Put it in the map, set the value(s) and the target(s).

    What's it good for?
    You could make cooperative puzzles depending on the player amount. You could also change the min value of a game_zone_player to wait for all players that are currently on the server. Change health of monsters according to player amount, or even change the amount of monsters, weapons, ammo and health depending on the player amount.


    VI) func_clip
    Like a func_monsterclip this entity clips only specific entities.

    Flags:
    Code:
    "Monsters" - blocks monsters
    "No clients" - does NOT block players
    "Pushables" - blocks func_pushables
    "Everything else" - blocks everything that is not a monster, player or pushable
    "Directional" - blocks only in one direction (use angles!)
    "Start off" - starts deactivated (blocks nothing)
    Keyvalues:
    Code:
    "Name" (targetname) - Name of this entity
    "Direction tolerance" (frags) - Tolerance in degrees for the directional setting (standard 90)
    Drawbacks:
    When clipping players the brush must have 90 degree angles, or the players may be able to walk through. You also can't use it as a ceiling or floor.


    VII) trigger_vote
    This entity allows a mapper to trigger custom votes. Useful for canceling cutscenes or choosing difficulty levels.

    Keyvalues:
    Code:
    "Name" (targetname) - Name of this entity
    "Message" (message) - The vote message text that should be displayed
    "Time to vote" (health) - The time till the vote is over
    "Percentage needed" (frags) - Percentage needed to "win" the vote
    "Yes Target" (target) - Name of target that gets fired if voted "Yes"
    "No Target" (netname) - Name of target that gets fired if voted "No"
    VIII) trigger_save and trigger_load
    trigger_save saves a keyvalue of an entity to disk, trigger_load loads a keyvalue from disk into the keyvalue of an entity. That way a mapper can store data and load it after a server has been restarted or a map new loaded.

    If you wanted to load and save a game_counter frags value, here's how you'd set it up:

    trigger_save:
    Code:
    Name: Whatever you like
    Key: lol_frags (can be anything)
    Target: Name of your game_counter
    Target Value: frags
    trigger_load:
    Code:
    Name: Whatever you like
    Key: lol_frags (can be anything, but must be the same as the key in trigger_save)
    Target: Name of your game_counter
    Target Value: frags
    IX) trigger_condition

    spawnflags:
    Code:
    -"Start off" - won't check until triggered on
    -"Don't use X (R)" - will ignore X on vectors or red on colors
    -"Don't use Y (G)" - will ignore Y on vectors or green on colors
    -"Don't use Z (B)" - will ignore Z on vectors or blue on colors
    -"Don't use W (A)" - will ignore W on vectors or alpha on colors
    -"Trigger once" - will go off after first trigger (otherwise it will trigger again when the condition changes)
    keyvalues:
    Code:
    -"Name" (targetname) - Name of the entity
    -"Target" (target) - Target to observe
    -"Watch Key" (m_iszValueName) - Key to observe
    -"Value to Match" (m_iszCheckValue) - the value to check against
    -"Match Option" (m_iCheckType) - choices of match options (see below)
    -"True Target" (netname) - Target to trigger if condition is true
    -"False Target" (message) - Target to trigger if condition is false
    match options:
    Code:
    0: "Equal" - true if keyvalue is equal to match value
    1: "Not Equal" - true if keyvalue is different to match value
    2: "Less" - true if keyvalue is less (smaller) than match value
    3: "Greater" - true if keyvalue is greater (bigger) than match value
    4: "Less or Equal" - self explanatory
    5: "Greater or Equal" - self explanatory
    X) trigger_createentity

    Allows a mapper to spawn any entity he wants as well as set the keyvalues for it. Keyvalues can be copied from other entities, e.g. the brush model of a func_pushable.

    It works as follows: Set a name to trigger it (triggering it will spawn the new entity, there is no "off", "on", "start on" or constant spawn option), classname of the new entity and targetname of the new entity.

    Any entity keyvalue you want to set for the new entity, has to be added using "smart edit" in VHE. There is a very important rule to keep in mind:
    All standard entity vars (see list in the notes section below) will be swallowed by the engine. To set those, you need to add a MINUS to the keyname.
    For example:
    Code:
    "-target" "target123"
    This will set key "target" of the new entity to "target123"
    If you want to use values of existing entities, add a PLUS to the keyname and set value to the entity's targetname. For example:
    Code:
    "+target" "target123"
    This will set key "target" of the new entity to the target of "target123"!

    You may want to use this entity to create a brush entity. In order to do that you have to copy the model from some other brush entity, like this:

    +model pushableexample
    (note: the model must have an origin brush)

    You can also copy spawnflags:

    +spawnflags pushableexample

    keyvalues:
    Code:
    -"Name" (targetname) - Name of the entity
    -"Child Classname" (m_iszCrtEntChildClass) - Child Classname (e.g. "func_wall")
    -"Child Targetname" (m_iszCrtEntChildName) - Child Targetname (e.g. "new_wall_001")

    XI) trigger_changemodel

    NOTICE: This entity is now fixed in 4.6 (no longer crashes the game).

    Changes the model of an entity. Supports players and playermodels. Useful for mutating enemies, force changing playermodels or ambient model effects.

    keyvalues:
    Code:
    -"Name" (targetname) - name of this entity
    -"Target" (target) - name of the entity to affect
    -"Model" (model) - path to new model (.mdl or .spr)
    Must be used in conjunction with custom_precache.

    XII) trigger_lookat

    forces one entity to face another entity.

    XIII) trigger_hurt_remote

    You can use this to hurt or heal specific entities (its target). It can also hurt or heal armor. You can use it to penalize players or give players a specific amount of health and armor in a script. It also has a flag "Instant Kill", which is also "Instant Heal" if damage is negative, meaning it gives the maximum health or maximum armor of the target entity. Using "Constant" in combination with "Delay" will hurt or heal periodically. That can be used to poison a specific player or slowly heal a boss.

    Note: the Constant feature appears to be crash-prone. A similar effect can be achieved by simply triggering a non-constant trigger_hurt_remote with a looping multimanager.

    XIV) custom_precache
    Used to precache models for trigger_changemodel

    XV) trigger_cameratarget
    A brush based entity you can click on using the camera mouse cursor function.

    XVI) func_group
    Added func_group brush entity, which is the old method of grouping objects before a certain version of VHE, as this entity is casted into normal solid brushes by the compile tools. You can use this to keep brush groups in the MAP file-form.


    ---------------------------------------------------------------------------
    :: New Entity-Specific Parameters/Flags/Features ::
    ---------------------------------------------------------------------------


    I) info_player_*

    New keyvalues:
    Code:
    -"Only Spawn Players with Targetname" (message) - When set, players with different targetnames can not spawn here.
    -"Repel Speed" (frags) - If spawnflag (4) is set, this value is used as repeling speed (default 64)
    Use "New Player Targetname" in combination with the new keyvalue to make player classes that spawn in separated areas.


    New spawnflags:
    Code:
    -"Repel Spawn" (4) - Player will spawn repeling down a rope (like repeling soldiers)
    -"Filter player targetname" (8) - Filters the given keyvalue and spawns only players with that targetname
    -"Invert Filter" (16) - or spawns only players with a different targetname
    -"Fire Target on Playerspawn" (32) - Will fire the target when a player spawns instead of when this entity is used
    II) brush based triggers
    -Removed a "feature" with trigger_multiples setting their delay to 0.2 seconds automatically when the mapper set it to 0. From now on, the mapper decides how long the delay is.
    -Added new flags:
    Code:
    "Everything else" - trigger fires if touched by func_train, etc.
    "Only on enter" - trigger fires only if an entity enters this trigger
    "Only on leave" - trigger fires only if an entity leaves this trigger
    Note: "Only on enter/leave" has issues when multiple entities leave/enter at once. Be careful.

    III) trigger_teleport

    new spawnflags:
    Code:
    -"Random destination" - if "target" is the name of multiple destinations, the trigger_teleport will choose one randomly everytime it teleports something
    -"Keep Angles" - teleported entities will keep their original angles, rather than getting those from the destination entity
    -"Keep velocity" - teleported entities will keep their original velocity, instead of being stopped
    -"Rotate (Dest Angles)" - teleported entities will be rotated by the angles of the destination entity
    -"Ignore cooldown delay" (2048) - Useful for teleporters that are not for players, or keep a single player at a position.
    IV) info_teleport_destination

    -Added "teleporter cooldown delay"

    V) func_door/func_door_rotating

    -Doors don't return if a blocking entity has been killed/gibbed.
    -func_door_rotating uses velocity of touching entity instead of angles. fallback to angles if speed is 0
    - Obey Trigger Mode can be used to force a func_door/func_rotating open or shut with an "On" or "Off" input from a trigger_relay or multimanager, instead of toggling it like it used to.

    new keyvalues:
    Code:
    -"Ignore Targetname" (m_fIgnoreTargetname) - boolean. if yes this door is openable even with a targetname set.
    -"Who can open this" (m_iOpenFlags) - works like spawnflags: Default (0), Pushables (1), No clients (2), 1 and 2 (3), Everything else (4), 1 and 4 (5), 2 and 4 (6), 3 and 4 (7)
    VI) func_train

    -Follows moving path_corners, instead of stopping at last corner position when movement started.
    -path_corner now has spawnflag "Random Targets" (like trigger_teleport, see above)

    VII) trigger_setorigin

    - trigger_setorigin no longer crashes, freezes the game or does anything else when it's target entity is removed from game or so.

    new spawnflag:
    Code:
    -"Rotate around Parent" - use this when you have an offset set. See picture for explanation:
    http://maxvollmer.de/svencoop/trigge...gin_rotate.png

    VIII) game_player_equip

    New spawnflags:
    Code:
    -"Filter Playername" (2) - When set, the game_player_equip will only equip players with a mapper specified targetname
    -"Re-Equip on Use" (4) - When set, instead of equipping the activator, using this game_player_equip will strip all player's weapons and re-equip them.
    New keyvalue:
    Code:
    -"Player Targetname" (target) - If spawnflag (2) is set, only players with this targetname will be equipped
    You can of course combine "Filter Playername" and "Re-Equip on Use"

    Tutorial on useage of game_player_equip: http://www.svencoop.com/forums/showthread.php?t=37100

    IX) trigger_respawn

    New spawnflag:
    Code:
    -"Respawn Target" (1) - When set, this entity respawns it's targets instead of all players.
    //Useful to respawn only one or a group of players. This will also call the Spawn() method of any non-player entity. Useful if a keyvalue has been changed using trigger_changevalue/copyvalue, but the entity only checks that value on spawn.

    X) func_breakable, func_pushable

    New spawnflags:
    Code:
    -"Repairable" (8) - Players can repair the breakable with wrench
    -"Show HUD Info" (16) - Players will see HUD Info (like when looking at monsters)
    - Updated how "Instant Break" works, a level designer can now determine which weapon should cause the instant break (defaults to WEAPON_CROWBAR for obvious required compatibility).

    XI) multi_manager

    - The maximum amount of targets a multi_manager can have has been increased to 32

    - It is now possible to specify whether the multimanager should toggle, turn on, turn off, or killtarget its target.
    This is done by adding a '#' mark after you set the Value, and then adding the number 0, 1 or 2, to respectively turn off, turn on, or killtarget the target. Leaving the # mark and the extra number out will result in the multimanager toggling as normal.
    For example, it could look like this:
    Key: monsterspawner
    Value: 3#2
    This will killtarget the entity "monsterspawner" after 3 seconds.

    XII) trigger_push
    -trigger_push has new spawnflag "Force push" which prevents a player from slowing down or going back (he can still strafe or go faster)

    XIII) trigger_camera

    - New spawnflag "Instant Move", which lets the camera ignore deceleration and acceleration, so it moves exactly like a func_train would move.

    - New feature: The mouse cursor.

    The mouse cursor is a new feature of trigger_cameras. Mappers can enable the cursor and select what actions can be performed. There are six different action/trigger possibilities:
    Left click, Right click, third button click, left double click, right double click, third button double click

    A mapper can select an action for each type + a custom parameter:

    Code:
    -'Off' - trigger the clicked entity off
    -'On' - trigger the clicked entity on
    -'Toggle' - toggle the clicked entity
    -'Remove' - remove the clicked entity (killtarget)
    -'Hurt' - hurt the clicked entity (parameter is dmg amount)
    -'Heal' - heal the clicked entity (parameter is health amount)
    -'Spawn' - spawn a new entity at click position (parameter is entity name)
    -'Teleport' - teleport an entity TO the click position (parameter is targetname of entity to teleport)
    -'Teleport away' - teleport the CLICKED entity AWAY (parameter is either targetname of destination or coordinates)
    -'Explosion' - create an explosion at clicked position
    -'Drag' - drag the clicked entity
    Example video: http://maxvollmer.de/svencoop/sc_41_cursor.avi

    Expanded possibilities for this feature are being planned.

    XIV) Custom damage values for weapon entities
    Mappers can specify the 'dmg' key in a weapon entity to give it a custom damage value instead of inherit one from the skill configuration.

    XV) Model scaling
    Just like you can set the scale of an env_sprite, you can now change the "scale" key of any model-based entity (presumably brush based as well) in order to change the size. This is a visual change only; hitboxes and hullsize does not change. You can change it during run-time with trigger_changevalue.

    XVI) Squadmaker
    Implemented env_xenmaker template feature for the squadmaker. New key "xenmaker" specifies a targetname of the env_xenmaker to copy and activate. The copied env_xenmaker is destroyed after being fired.



    ---------------------------------------------------------------------------
    :: New Map Customization Features ::
    ---------------------------------------------------------------------------


    mp_teamfraglimit

    Same as mp_fraglimit, only that this will count all frags (player1 frags + player2 frags ...)
    If mp_fraglimit is non-zero, mp_teamfraglimit will be ignored.

    Forced sound looping

    Added the ability to force sounds to loop, or play only once, via their filenames. Useful for using MP3s as looping replacements for monster sounds, etc.

    A sound with "_loop.*" at the end of its filename will loop by default, e.g.: mysound_loop.mp3. A sound with "_once.*" at the end of its filename will play once by default -- e.g. mysound_once.wav

    Global sound replacement

    The global sound-replacement file (globalsoundlist) can be set in map CFGs, now, as an alternative to worldspawn.

    Custom auto-balancing

    Mappers can now set custom playercount-based auto-balancing values in the map .cfg

    mp_pcbalancing_factorlist "1.0;1.8;1.4;1.2;1.1;1.0"
    The first value is the damage multiplier for one player, 2nd for two players, etc. The last number is used for that number of players or more. You can have up to 16 or 32 different values iirc.

    Weapon options

    List of all new weapon options, including 4.0 options:

    weaponmode_9mmhandgun 0 // Set to 1 have silencer instead of rapid fire
    weaponmode_mp5 0 // Set to 1 disable the zoom/scope
    weaponmode_shotgun 0 // Set for 1 double blast instead of rapid fire
    weaponmode_crossbow 0 // Set to 1 disable exploding bolts
    weaponmode_rpg 0 // Set to 1 disable laser sight
    weaponmode_357 1 // Set to 0 enable the zoom/scope

    mp_dropweapons

    mp_dropweapons -1 will prevent everything but shock roaches from being dropped (once you grab a minigun, you'll have to die to get rid of it)
    mp_dropweapons 0 will prevent everything but shock roaches and miniguns from being dropped


    ---------------------------------------------------------------------------
    :: Trigger filtering ::
    ---------------------------------------------------------------------------



    Quote Originally Posted by Protector View Post
    I have added extended filtering for complex trigger systems in maps.

    All entities now have 8 new values:

    Code:
    "toutfiltertype" (Targetname Out Filter Type) - can be "Exclude" or "Include"
    "coutfiltertype" (Classname Out Filter Type) - can be "Exclude" or "Include"
    "tinfiltertype" (Targetname In Filter Type) - can be "Exclude" or "Include"
    "cinfiltertype" (Classname In Filter Type) - can be "Exclude" or "Include"
    "toutfilter" (Targetname Out Filter) - a string of targetnames, seperated with ';'
    "coutfilter" (Classname Out Filter) - a string of classnames, seperated with ';'
    "tinfilter" (Targetname In Filter) - a string of targetnames, seperated with ';'
    "cinfilter" (Classname In Filter) - a string of classnames, seperated with ';'
    So, what does it do? The filters are lists of targetnames or classnames. You can filter OUT going triggers (e.g. this entity triggers another entity) or IN coming triggers (this entity is triggered by another entity)

    If you chose INCLUDE as filter, nothing can trigger (or be triggered) except entities with the names in that filter. If you chose EXCLUDE as filter, everything can trigger (or be triggered) except entities with the names in that filter.


    Example:

    Entity A with name "lol1" has tinfiltertype set to "Exclude" and tinfilter is "lol2;lol3"
    Entity B with name "lol1" has tinfiltertype set to "Include" and tinfilter is "lol3"
    Entity C with name "lol1" has tinfiltertype set to "Exclude" and tinfilter is "lol3;lol4"
    Entity D with name "lol2" has target "lol1"
    Entity E with name "lol3" has target "lol1"
    Entity F with name "lol4" has target "lol1"

    When D triggers it's targets, normally A, B and C would be triggered. With the filters active, only C is triggered. A does not allow D ("lol2") and B only allows C ("lol3")

    When E triggers it's targets, normally A, B and C would be triggered. With the filters active, only B is triggered. A does not allow E ("lol3") and C does not allow E ("lol3")

    When F triggers it's targets, normally A, B and C would be triggered. With the filters active, only A is triggered. B only allows E ("lol3") and C does not allow F ("lol4")

    In combination with !activator, this gives the mapper power to create very complex trigger systems, without using too much entities.
    Please note that these entity keyvalues have to be added in manually by going out of smart edit. They were removed from the .fgd due to cluttering too much. A few entities, such as doors, still have the keyvalues in the .fgd.
    Also, this filtering option only concerns itself with direct triggering. You can't control, for example, which player or npc is allowed to activate a trigger_multiple. You'd have to use trigger_condition for that.


    ---------------------------------------------------------------------------
    :: Notes ::
    ---------------------------------------------------------------------------


    trigger_condition, trigger_copyvalue and trigger_changevalue

    It is not possible to change an entity pointer (for example groundentity or owner) for security reasons (a mapper could easily insert code into a running server with such a feature)
    It is allowed to access them in which case a pointer's targetname will be used.

    Trigger_changevalue and trigger_condition also support the targetnames "!activator" and "!caller". If a trigger_changevalue/condition uses !activator, it will target the first entity in the chain of entities which triggered the trigger_changevalue/condition. !caller will target the entity which triggered the trigger_changevalue/condition.
    Support for !activator and !caller is planned to be added for all entities.

    Update: !activator works for all entities now.

    You may find this list of Half-Life's base variables usefull with some of the entities:
    Edit: In Silencer’s Sven Co-op Entity Guide


    ---------------------------------------------------------------------------
    :: Afterword ::
    ---------------------------------------------------------------------------


    If you have any comments or questions about any of this, feel free to ask, and we will do our best to answer.
    Last edited by JPolito; 30-05-2013 at 09:13 AM. Reason: Removed weaponmode_m16 and weaponmode_wrench (these don't exist)

  2. #2
    Silencer Lt.JC's Avatar  
    Tester
    Join Date
    Dec 2003
    Location
    Germany
    Posts
    1,249

    Re: New entities and mapping features in SC 4.1.

    This all sounds really brilliant. I don't know what to do with most of the entities right now but some of them would definately improve my private "Republic Coop" maps.
    But sadly there is still no 3d Skybox which still gets in the technical difficulty of the project.

    However I'm sure all of this will be helpful for the mappers and I am happy to see that the crash problems for the trigger_setorigin entity have been solved.

    Good work, now I'm keen on seeing maps get released with those features.
    Last edited by Lt.JC; 20-01-2010 at 05:38 AM.
    Born to Fight,
    Trained to Kill,
    Taught to Survive,
    and told to take no Prisoners.
    Visit http://www.youtube.com/NostalgicGames

  3. #3
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [UK]
    Posts
    8,603

    Re: New entities and mapping features in SC 4.1.

    There are plenty more entity changes that haven't been published here, so keep your eyes pealed
    We will probably put them up shortly after compiling a change log for ourselves.
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

  4. #4
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,600

    Re: New entities and mapping features in SC 4.1.

    holy balls, there are so many new things that can be done with these ents. I can't wait to play around with the mouse pointer feature! You could do something like have a few players control all of the monsters and the others try to escape, or play mini games like chess and whack-a-mole. I bet with some dedication you could even create some kind of strategy game too.

  5. #5
    Retired BlueFeena's Avatar
    Join Date
    Jun 2004
    Posts
    2,067

    Re: New entities and mapping features in SC 4.1.

    Actually, the new mouse-camera-thing allows for some great puzzles. Think about it; Dino Crisis style puzzles that requires the players to crunch something out in their heads, and then work with some kind of computer interface to solve the puzzle with a point'n click interface. Awesome.

    On top of that, a camera entity could arguably make a fantastic support gun -- such a wave of monsters attacking, and a player is able to merely "click" where he wants an explosion to occur, feeling a helluva lot like firing a gun turret.

  6. #6
    Registered User
    Join Date
    Apr 2003
    Location
    Missouri, US
    Posts
    6,344

    Re: New entities and mapping features in SC 4.1.

    The side scrolling map I was making years ago might actually be possible (might already be as of 4.07). :P

  7. #7
    Unregistered User Fice's Avatar
    Join Date
    Nov 2005
    Location
    Germany
    Posts
    99

    Re: New entities and mapping features in SC 4.1.

    Everytime a SvenCoop Patch comes out, I think of the new entities and things i can create with them.
    However this time, the possibilities for mappers are endless. I'm truly speechless

  8. #8
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,485

    Re: New entities and mapping features in SC 4.1.

    You could also create Deus Ex style security consoles where the players can open/close doors and turn turrets off/on.

    One thing I'm kind of curious about is how exactly the logical operations of the trigger_changevalue work. Can you shed some light on this protector?

  9. #9
    I'm in your Sven Co-op, coding stuff Protector's Avatar  
    Programmer
    Join Date
    Sep 2003
    Location
    Basel, Switzerland
    Posts
    679

    Re: New entities and mapping features in SC 4.1.

    They are mostly for flags.
    If you look at integer values in binary form, you have zeros and ones. A normal 4 byte integer has 32 bits, so you have a list of 32 zeros/ones. You can use those 32 bits as flags, by switching them "on" or "off" and then checking them again. That's what you do when checking spawnflags in hammer.
    Bitwise logical operators are used in C++ to do those operations on single bits. E.g. 7 & 1 equals 1, because 7 is 0111 (4 + 2 + 1) and 1 is 0001 and on every single bit there is an AND operation performed. AND is 1 when both values were 1, and is 0 in every other case. So we have 0 & 0 = 0, 1 & 0 = 0, 1 & 0 = 0, 1 & 1 = 1, which is 0001, and that is 1.
    OR however is an operation that is 0 if both values are 0 or 1 in any other case. So 7 | 1 (7 OR 1) is 7, because 0 | 0 = 0, 1 | 0 = 1, 1 | 0 = 1, 1 | 1 = 1, so we get 0111, which is 7.

    You can use the logical operators to set flags using OR: flagvalue | flagbit, e.g. you want to set flagbit 2: flagvalue | 0010, which will always create a number where the second bit is 1. All other bits are unchanged.

    And you can use them to remove flags, using AND NOT: flagvalue &~ flagbit, e.g: flagvalue &~ 0010 = flagvalue & 1101. Every 0 in flagvalue stays 0, every 1 stays 1, only the second bit is forced to 0.


    Wikipedia article:
    http://en.wikipedia.org/wiki/Bitwise_operation

  10. #10
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,485

    Re: New entities and mapping features in SC 4.1.

    Do you have a concrete example of how it could be used?

  11. #11
    I'm in your Sven Co-op, coding stuff Protector's Avatar  
    Programmer
    Join Date
    Sep 2003
    Location
    Basel, Switzerland
    Posts
    679

    Re: New entities and mapping features in SC 4.1.

    Take spawnflag "Breakable" on a func_pushable (128)
    Depending on what players do during the game you want to switch "Breakable" on and off.

    trigger_changevalue settings:
    Code:
    Name: make_invincible
    Target: breakable
    Key name: spawnflags
    New value: 128
    What to do: NAND
    Code:
    Name: make_breakable
    Target: breakable
    Key name: spawnflags
    New value: 128
    What to do: OR

  12. #12
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,485

    Re: New entities and mapping features in SC 4.1.

    Why not just use replace value 128/0, or +/- 128? I'm having a hard time seeing how it could come in handy but that's probably because I still don't really understand how it works.

  13. #13
    I'm in your Sven Co-op, coding stuff Protector's Avatar  
    Programmer
    Join Date
    Sep 2003
    Location
    Basel, Switzerland
    Posts
    679

    Re: New entities and mapping features in SC 4.1.

    If you replace the value, you will delete all other flags. If for example "Liftable" is active, the spawnflag value isn't 128, it is 128 | 2048 = 2176. Setting spawnflags to 0 or to 128 would deactivate "Liftable".

    If you use OR and NAND however, you would switch between 2048 and 2176. Or between 0 and 128, if no other spawnflag is set. Or between 1 and 129, if spawnflag 1 is set. Etc.

    If you use +/-128, you could end up in a negative value (e.g. if spawnflags was 0), or if you have "Liftable" set, but not "Breakable", -128 would result in 1920, which would be spawnflags 1024, 512, 256 and 128.

  14. #14
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,485

    Re: New entities and mapping features in SC 4.1.

    I've used OR/AND before in java programming and electrical circuits, but I just don't see how they can be used in a situation like this. Usually it means that 2 parameters are being compared, but in this case there is only 1 value involved, so what is being compared? And what is being changed?

  15. #15
    I'm in your Sven Co-op, coding stuff Protector's Avatar  
    Programmer
    Join Date
    Sep 2003
    Location
    Basel, Switzerland
    Posts
    679

    Re: New entities and mapping features in SC 4.1.

    spawnflags is 2176.

    -> spawnflags OR 128 stays 2176.

    -> spawnflags AND NOT 128 becomes 2048.


    spawnflags is 2048.

    -> spawnflags AND NOT 128 stays 2048.

    -> spawnflags OR 128 becomes 2176.

  16. #16
    Banned Solokiller's Avatar
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    3,314

    Re: New entities and mapping features in SC 4.1.

    I've never used bitwise operators in C++ before, but i should definitely try this out now that i know how powerful it can be.

  17. #17
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,485

    Re: New entities and mapping features in SC 4.1.

    Silencer is currently working on a more comprehensive entity guide. In the meantime you can ask as many questions you want and I will try to answer them as best as I can.

    There are some new entities that have been added since I made the original post:

    # Added trigger_lookat - forces one entity to face another entity.

    # Added trigger_hurt_remote - is an entity that you can use to hurt or heal specific entities (its target). It can also hurt or heal armor. You can use it to penalize players or give players a specific amount of health and armor in a script. It also has a flag "Instant Kill", which is also "Instant Heal" if damage is negative, meaning it gives the maximum health or maximum armor of the target entity. Using "Constant" in combination with "Delay" will hurt or heal periodically. That can be used to poison a specific player or slowly heal a boss.

    # Added custom_precache - Used to precache models for trigger_changemodel

    # Added trigger_cameratarget - A brush based entity you can click on using the camera mouse cursor function.

    # Added trigger_save and trigger_load - trigger_save saves a keyvalue of an entity to disk, trigger_load loads a keyvalue from disk into the keyvalue of an entity. That way a mapper can store data and load it after a server has been restarted or a map new loaded.



    Also, an advanced entity filtering system has been added:

    Quote Originally Posted by Protector View Post
    I have added extended filtering for complex trigger systems in maps.

    All entities now have 8 new values:

    Code:
    "toutfiltertype" (Targetname Out Filter Type) - can be "Exclude" or "Include"
    "coutfiltertype" (Classname Out Filter Type) - can be "Exclude" or "Include"
    "tinfiltertype" (Targetname In Filter Type) - can be "Exclude" or "Include"
    "cinfiltertype" (Classname In Filter Type) - can be "Exclude" or "Include"
    "toutfilter" (Targetname Out Filter) - a string of targetnames, seperated with ';'
    "coutfilter" (Classname Out Filter) - a string of classnames, seperated with ';'
    "tinfilter" (Targetname In Filter) - a string of targetnames, seperated with ';'
    "cinfilter" (Classname In Filter) - a string of classnames, seperated with ';'
    So, what does it do? The filters are lists of targetnames or classnames. You can filter OUT going triggers (e.g. this entity triggers another entity) or IN coming triggers (this entity is triggered by another entity)

    If you chose INCLUDE as filter, nothing can trigger (or be triggered) except entities with the names in that filter. If you chose EXCLUDE as filter, everything can trigger (or be triggered) except entities with the names in that filter.


    Example:

    Entity A with name "lol1" has tinfiltertype set to "Exclude" and tinfilter is "lol2;lol3"
    Entity B with name "lol1" has tinfiltertype set to "Include" and tinfilter is "lol3"
    Entity C with name "lol1" has tinfiltertype set to "Exclude" and tinfilter is "lol3;lol4"
    Entity D with name "lol2" has target "lol1"
    Entity E with name "lol3" has target "lol1"
    Entity F with name "lol4" has target "lol1"

    When D triggers it's targets, normally A, B and C would be triggered. With the filters active, only C is triggered. A does not allow D ("lol2") and B only allows C ("lol3")

    When E triggers it's targets, normally A, B and C would be triggered. With the filters active, only B is triggered. A does not allow E ("lol3") and C does not allow E ("lol3")

    When F triggers it's targets, normally A, B and C would be triggered. With the filters active, only A is triggered. B only allows E ("lol3") and C does not allow F ("lol4")

    In combination with !activator, this gives the mapper power to create very complex trigger systems, without using too much entities.
    Please note that these entity keyvalues have to be added in manually by going out of smart edit.
    Also, this filtering option only concerns itself with direct triggering. You can't control, for example, which player or npc is allowed to activate a trigger_multiple. You'd have to use trigger_condition for that.


    There are also other changes you can only find at:

    http://www.svencoop.com/wiki/index.php/Changelog_4.5



    Edit: Updated the OP.

  18. #18
    Registered User
    Join Date
    Jul 2003
    Posts
    1,145

    Re: New entities and mapping features in SC 4.5.

    Ok, some questions:

    SHOCKRIFLE:
    1) Should the weapon_shockrifle be in the fgd? Since it is possible to create one in-game, I assume it exists?
    2) Is there a corresponding ammo_ entity for the shockrifle?

    TARGETTING PLAYERS:
    3) If a player has been given a targetname, and the player dies, is it removed, or stays with that particular player at respawn?
    4) If a player has been given a targetname which is being used for specific events in the map, and that player leaves the game, would that break the events in the map?

  19. #19
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,485

    Re: New entities and mapping features in SC 4.5.

    Quote Originally Posted by Uncle View Post
    Ok, some questions:

    SHOCKRIFLE:
    1) Should the weapon_shockrifle be in the fgd? Since it is possible to create one in-game, I assume it exists?
    2) Is there a corresponding ammo_ entity for the shockrifle?

    TARGETTING PLAYERS:
    3) If a player has been given a targetname, and the player dies, is it removed, or stays with that particular player at respawn?
    4) If a player has been given a targetname which is being used for specific events in the map, and that player leaves the game, would that break the events in the map?
    1)
    I believe something like weapon_shockrifle exists since it was used in one of the beta test maps. AdamR should know.

    2)
    Don't think so. It's meant to be a temporary weapon you pick up in battle and then dispose of.

    3)
    The targetname stays after respawning

    4)
    If a player with a targetname leaves, that targetname is gone. In Jumpers, I work around this by ending the map if the Main Jumper leaves.
    I use a game_player_counter, with min value 0, with min target playerlose, and the filter set to jumper.

    I believe the game_player_counter is designed so it doesn't trigger until a change is registered, so the map shouldn't end immediately as the map starts even though there is no player with that targetname at the beginning. However, I'm not one to take risks so I made the game_player_counter target a locked game_counter that isn't unlocked until the jumper is selected.

  20. #20
    Registered User
    Join Date
    Jun 2006
    Posts
    14

    Re: New entities and mapping features in SC 4.5.

    This is some really cool stuff! I have a question:

    I'm not totally understanding the trigger_condition, specifically how I can use it to control trigger_multiples in relation to the targetname of players passing through them.

    I've managed to use a trigger_condition to open a door if a player's health is low, but I don't see how I can use it to make it so that only a player with targetname set to say "route1" can activate a particular trigger_multiple. I've set it so the trigger_multiple triggers the trigger_condition, which then compares !activator to "route1", and if the trigger_condition is true a door should open. This doesn't happen, so I figure I've messed up badly.

  21. #21
    more wpoly = more fun Tuesday's Avenger's Avatar  
    Contributor
    Join Date
    Mar 2004
    Location
    United States
    Posts
    1,461

    Re: New entities and mapping features in SC 4.5.

    I can't get the game_player_counter to work for the life of me. I want it trigger when it detects no players of a certain type. I have:

    A info_player_deathmatch which is active at the start of the map. It names its players "liveplayer".
    Another info_player_deathmatch which is switched on after 5 seconds; the old spawn is deleted. It names its players "deadplayer".
    An env_xenmaker called "crabspawn" that makes a headcrab.
    I have a game_player_counter set up as follows:
    Min Value: 0
    Max Value: N/A
    Min Target: crabspawn
    Max Target: N/A
    Filter Player Targetname: liveplayer

    The idea is that the player would spawn in, go about his business until forced to respawn, at which point he would repspawn in a different locale and count as 'dead'; one the counter detected no "live" players on the map, it should trigger an event - in this case, the xenmaker. However, when I run the map, wait, and then suicide and respawn at the new spawn point, nothing happens. What have I messed up?

  22. #22
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,485

    Re: New entities and mapping features in SC 4.5.

    Quote Originally Posted by Wilson View Post
    This is some really cool stuff! I have a question:

    I'm not totally understanding the trigger_condition, specifically how I can use it to control trigger_multiples in relation to the targetname of players passing through them.

    I've managed to use a trigger_condition to open a door if a player's health is low, but I don't see how I can use it to make it so that only a player with targetname set to say "route1" can activate a particular trigger_multiple. I've set it so the trigger_multiple triggers the trigger_condition, which then compares !activator to "route1", and if the trigger_condition is true a door should open. This doesn't happen, so I figure I've messed up badly.
    The idea is basically to have the trigger_multiple target a trigger_condition which checks if the targetname of !activator equals route1. Ticking the flag "cyclic" is necessary if you want the player to be able to trigger it multiple times, and "keep !activator" wouldn't hurt either, although probably not necessary.
    If that isn't working, perhaps the player simply hasn't been renamed? How are you renaming the player?

  23. #23
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,485

    Re: New entities and mapping features in SC 4.5.

    Tuesday: I can't see any errors with that setup. Perhaps a typo?

  24. #24
    Registered User
    Join Date
    Jun 2006
    Posts
    14

    Re: New entities and mapping features in SC 4.5.

    Ah, I see. I'm sure I tried doing it like that, but obviously not. Thanks! I'll try it out and see how it goes. I'm sure the renaming worked because the door opening when the player has low health worked.

    EDIT: Yep, that worked lovely, thanks. My mistake was that I thought I had to set 'Entity to monitor' to the trigger_multiple and 'Watch Key' to !activator which is clearly wrong now I think about it.
    Last edited by Wilson; 09-09-2010 at 04:44 PM.

  25. #25
    more wpoly = more fun Tuesday's Avenger's Avatar  
    Contributor
    Join Date
    Mar 2004
    Location
    United States
    Posts
    1,461

    Re: New entities and mapping features in SC 4.5.

    Quote Originally Posted by Nih View Post
    Tuesday: I can't see any errors with that setup. Perhaps a typo?
    Alright, thanks Nih. I'll check it over and make sure, hopefully it's something trivial.

Page 1 of 4 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •