ExtraEntitiesMod

JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver Posts: 528 Fully active user
edited May 2013 in Modding
Introduction

I will make a small mod to bring some extra entites to NS2, like a teleport-trigger, a drivable train etc.
(the entites from hl1 that made you making some cool fun maps). I also included some npcs you can use for co-op maps etc.

Mappers can use them then in their maps to create something different.
The Mod will be called ExtraEntitesMod and if it's finished I will upload it to workshop.
Will also include all the entites to the CombatMod.

Entities worked on
(look at the bottom at the post to see all entites, will only write here entities that i'm currently working on)
• logic_power_point_listener (triggers when power in room changes)

Where can I get the mod?

If you want to get the mod, test the entities or use it on your mods (I will wrote a tutorial for that)
you can download the mod "ExtraEntitiesMod" in the workshop, Id is "66f9c57"

You can find the code here at GitHub:
https://github.com/JimWest/ExtraEntitesMod


How to use the entities?

To select the entitys, you have to set a diferent game in the Launch-Pad. To do that, best is to download the mod (EEM) from GitHub directly into your Ns2 folder (steamapps\common\natural selection 2\ExtraEntitesMod). To Setup the launchpad, use my setup_launchpad.vbs.


Only use one unique name for every entity, don't name 2 entities the same, this will cause some bugs cause the engine will only find one entity and the other will be ignored. You will need to set names to every entities that should get triggered by other entities (the engine will then find the entity inGame).

_________________________________________________________
Teleporters, trains etc:
_________________________________________________________

Teleport-Trigger
• The cone will show you the direction of the teleporter output, it will rotate, too, when you rotate the whole trigger.
• If its not only a exit (used in both directions), you need to set a name and a destination Name (name of the exit teleporter). Do the same for the 2nd teleporter (permute the names).
• The wait delay in sec let the teleporter ignore the player for that time, till he will teleport him again (2 sec is a good value, you don't have to change it).
• You can disable the trigger via trigger enabled - false, it will only teleport players when a logic entity (like a timer) triggered the teleporter.
• You can set the teleporter to marine or alien team only, default is for both teams (not on the screen, option called Team Number).
• Just ignore the Distance and Angles, thats just to show the cone in the Editor

Push_Trigger
• The cone will show you the direction of the pushforce. It will rotate, too, when you rotate the whole trigger.
• You can set the Push force, but the default 30 is a good value to start testing.
• You can disable the trigger via trigger enabled - false, it will only push players when a logic entity (like a timer) triggered the push_trigger.
• Just ignore the Distance and Angles, thats just to show the cone in the Editor

Gravity_Trigger
• Lets you change the gravity inside this trigger for every player which is inside
• You can set higher or lower gravity (0 will be no gravity, -50 higher etc., +10 would work a bit like a push trigger. Allowed are values form -100 to 100)

Func_Door
• Starts open let the door start unlocked (it will work like a normal door, but can be triggered and can be disabled)
• Stay open lets the door stay open when unlocked, but will close when locked (but no open/close all the time)

Func_Moveable
• You can set any model you like (most models are invisible at the background, but you can just put the same model 180° rotate behind it and link them with the logic_multiplier)
• You can scale the model as you like.
• Place the model at its "finished" position, when you set Starts opened to false, it will start there in the game, too. If you let it true, the model will start above or under the vent so the vent is opened and will be closed after triggering.
• Direction: currently you can only set Up, Down, Left, Right and a waypoint (use a train_waypoint for this)

Func_Platform
• Works like an elevator, needs 2 func_train_waypoints (start and end point)
• You can use every model for this

Func_Train
• A drivable train, can turn every model to a train
• Needs a name and refering func_train_waypoints to build a path (also add some numbers to the number entry of the waypoint, like 1 2 3 4 etc.)

Map_Settings
• Rise the view distance if you need to
• you can set fall damage on or off (default off, Lerks, Skulks, JetpackMarines and Fades don't get fall damage)

Map_Change
• Lets you change the map to a specific map after getting triggered (OH yeah this is working!)


_________________________________________________________
Now the Logic entities:
_________________________________________________________

Most logic entities have only one output, but you can use the logic_mutliplier to trigger as many things as you like (for example the timer triggers a multiplier and that triggers 10 doors, or 9 doors, 1 multiplier which then triggers again another entities).

Logic_Breakble
• Destroyable Model, will play a cinematic if distroyed
• You can set Health, material etc

Logic_Button
• Pushable Model (you can set every model to it), will trigger when getting pressed.
• You can set CooldownTime, the team which can trigger it, the amount (once per player, all the time etc.)

Logic_Cinematic
• Let's you play a Cinematic with all logic entities
• NEW: if you have a camera in your cinematic, this will set to every player so its like a cutscene

Logic_Counter
• Counts inputs and then triggers after the value in Counter is reached.

Logic_Emitter
• Emitts on trigger (to call UWE-style entities like sound event and cinematic (not logic_cinematic))

Logic_Emitter_Destoryer
• Can destroy emitted entities like sound and cinematic (when they're playing)

Logic_Event_Listener
• Triggers on special Events like game started, team won etc.

Logic_Function
• With this you can call game functions like Team1 or Team2 has won (good to combine with the Logic_Trigger and the Logic_Counter, you could let players run through a part of the map and if that happened 5 times team 1 or 2 has one...)
• Will add more functions to this you can use ingame

Logic_Give_item
• Gives a specific item to the triggering player (like welder, shotgun, jetpack, even exo etc.)

Logic_Listener
• Listens on UWE-style entities like button_emitter and timed_emitter to trigger my entities

Logic_Lua
• Lets you load your costum lua file.
• set your path of the lua file
You need to copy the lua file for testing into the ExtraEntitiesMod folder (later you can just put it into your map folder under a new lua folder (YourMap\lua\test.lua -> write in the editor lua\test.lua), but that only works if its on workshop and you suscriped to it, so bad for testing).

Logic_Multiplier
• Will give you the opportunity to trigger mutliple things, but the mutliplier always have to be triggered by another logic entity!
• You need to set the name and can name up to 10 outputs to be triggered, you can also trigger another multiplier

Logic_Reset
• Resets entities to their start values (usefully to reset a timer, counter etc)

Logic_Switch
• Works a bit like a multiplier with serveral outputs, but will not fire all outputs at the same time, only one.
• Direction of the next triggered entry can be set to forward, backward and random (start value can also be set to random)

Logic_Timer
• Will start to count after the game has started (when enabled), if its disabled, it will only start counting when another logic entity triggers it.
• You can set wait delay to your disired value, like 120 sec for 2 min etc.

Logic_Trigger
• Triggers the output entity when a player moves through
• Like the button, you can set CooldownTime, the team which can trigger it, the amount (once per player, all the time etc.)
• You can set if it triggeres when an entity enters or exits.

Logic_Waypoint
• Will give a waypoint to the triggering player to the position of this entity
• You can set the type of waypoint like move, weld, attack.

Logic_Weldable
• Will be trigger the output entity when beeing fully welded
• You can disable it so it can only be welded after some time (with a logic_timer etc)
• You can set the weld time at Weld Time in sec, when more player welds its going faster (like you weld a cc etc)

Logic_Worldtooltip
• Let's you print a short message with gui on the screen if player is near and looking at it (like in Explore mod,
but this one works in the normal game, too)

_________________________________________________________
NPC things:
_________________________________________________________

You can set the team of every npc, so it will be friends to team 1 or team 2

npc_wave_manager
• Spawns npcs in waves
• You can set the amount of spawned npcs, the class, how much waves etc.
• If you set wave number to 99, it will trigger all the time until it gets deactivated by another trigger
• Can trigger an output if the wave ends

npc_spawner_marine
• Spawns a marine, you can set the weapon loadout

npc_spawner_marine_exo
• Spawns an Exo marine, you can set the weapon loadout

npc_spawner_skulk
• Spawns a skulk

Post edited by JimWest on
ukeWorthyRival
«13456789

Comments

  • MagnetoMagneto Join Date: 2010-12-22 Member: 75856Members Posts: 436
    Good stuff, thanks again for this!
  • Dictator93Dictator93 Join Date: 2008-12-21 Member: 65833Members, Reinforced - Shadow Posts: 657 Fully active user
    QUOTE (JimWest @ Nov 3 2012, 11:41 PM) »
    Hi,

    I will make a small mod to bring some extra entites to NS2, like a teleport-trigger, a drivable train etc.
    (the entites from hl1 that made you making some cool fun maps).

    Mappers can use them then in their maps to create something different.
    The Mod will be called ExtraEntitesMod and if it's finished I will upload it to workshop.
    Will also include all the entites to the CombatMod.

    So stay tuned :-)


    This could allow elevators in game, which would be awesome
  • MaxunitMaxunit Join Date: 2005-02-01 Member: 39414Members, Reinforced - Shadow Posts: 224 Fully active user
    Elevators etc and Trains for NS2? Now, that would own so much. Would make a great game even greater :D
    I like to be in the darkness and to be unseen...
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver Posts: 528 Fully active user
    The train is moving on it's waypoints now:

  • MaxunitMaxunit Join Date: 2005-02-01 Member: 39414Members, Reinforced - Shadow Posts: 224 Fully active user
    edited November 2012
    Haha, nice, but this kind of train shouldn't actually rotate. It should only move forward and backwards. There should be a rotation platform to rotate the train instead :P

    Just my suggestion...
    I like to be in the darkness and to be unseen...
  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members Posts: 141
    Wow, that's pretty cool!

    My brother has been poking around with the map editor for the past few days, and this thread will probably make his day.
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue Posts: 4,269 Advanced user
    edited November 2012
    I still can't get my damage triggers to do any damage. If I can get them working, I'll give you those entities for your mod. :D
    Games:Subnautica Fan Game Mods: GorgeCraft & CTF & Proving Grounds Website: andysoulrider.uk
    Twitter: @AndySoulRider Twitch: Twitch.tv/SoulRider YouTube: Youtube.com/user/IamSoulRider/videos

    Capitalisation is the difference between helping your Uncle Jack off a horse and helping your uncle jack off a horse.
    Knowledge is gained through listening, Understanding is gained through discussion.
  • Dictator93Dictator93 Join Date: 2008-12-21 Member: 65833Members, Reinforced - Shadow Posts: 657 Fully active user
    QUOTE (JimWest @ Nov 4 2012, 11:09 PM) »
    The train is moving on it's waypoints now:


    I cannot wait to see what else you create. This is a great step on the way to a bright future!
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver Posts: 528 Fully active user
    Btw., anybody got a good idea how to clue the player on the train, but he should also be able to move, jump etc on the train?
  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members Posts: 141
    Hmm, I'm assuming it's not so simple as to grab the entities on top of the train and set their velocity?
  • SewlekSewlek The programmer previously known as Schimmel Join Date: 2003-05-13 Member: 16247Members, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Developer Posts: 2,341 Advanced user
    QUOTE (JimWest @ Nov 5 2012, 05:54 PM) »
    Btw., anybody got a good idea how to clue the player on the train, but he should also be able to move, jump etc on the train?


    thats the reason why we dont have yet elevators in the game, its a can of worms :D

    you can try to modify ControllerMixin, but you would also need to adjust some of the players code, which will turn out as quite big task i bet
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver Posts: 528 Fully active user
    Well it's not perfect but it's a start :-)
    ( ignore the path moving, thats totally bugged, I know ^^)

  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members Posts: 141
    edited November 2012
    Nice work! With a little more work, this could be the kind of thing that gets brought on-board officially.
    Post edited by Unknown User on
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver Posts: 528 Fully active user
    Well the current problem is atm to take the angle into account, so if the train rotates a bit left or right, the player will still stand on his position,
    but I don't get it right.

    I think I got the right formula to calculate the right position for the player, but the player seems alyways to get teleportet to the origin of the train.


  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands, Hoogezand Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue Posts: 15,780 Advanced user
    I'm keeping my eye on you Jim!

    Guardian of the "magic cookiejar" AdminModerator

    Existence Unknown

    Retired forum Admin, I mostly used a flamethrower tank for disputes... Mostly
    Retired EUPT Deputy | Moral Support | Squad 5 Blue
    102 1HP Skulk escapes and counting | Play the Latest Version of Booster Z-Frame
    YouTube NS2 Playlists: Unusual Selection | NS2 Stuff | NS2PT | NS2 Tuts

  • matsomatso Master of Patches Join Date: 2002-11-05 Member: 7000Members, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Shadow, NS2 Community Developer Posts: 1,554 mod
    The generic code for this should allow you to grab onto any moving platform. Say, an Onos.
    Member of CDT, Senior Spark Engine Hacker
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members Posts: 1,731
    I would check for collision with the entity and add the entity velocity to the player velocity.
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver Posts: 528 Fully active user
    edited November 2012
    When the train only rotates (changing the angles), there is no velocity, that's the problem.

    Edit:
    And, somethings really strange.
    When I set a Trigger on the physics model of the train with:
    CODE
    self.physicsModel:SetTriggerEnabled(true)


    The train has no collision anymore, even if I enable the Collision with
    CODE
    self.physicsModel:SetCollisionEnabled(true)
    Post edited by Unknown User on
  • MagnetoMagneto Join Date: 2010-12-22 Member: 75856Members Posts: 436
    Nice work so far, when i first played around with cinematics i hoped that turning on collision would make a moving object interact with players, glad to see something is being done about it!

    What other entities do you have planned?

    Id quite like to see a simple push force, either a wind like effect while inside the trigger or better yet a quake style launch pad, not to do anything crazy but for a fun effect i have planned, i can do something similar now using gravity but it doesn't work as well as skulks are sticky, if only there was a non-stick surface...
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver Posts: 528 Fully active user
    edited November 2012
    QUOTE (Magneto @ Nov 10 2012, 12:30 PM) »
    What other entities do you have planned?


    Y a push trigger.

    Btw., a onos can actually ride the train:
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands, Hoogezand Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue Posts: 15,780 Advanced user
    QUOTE (JimWest @ Nov 10 2012, 01:39 PM) »
    Y a push trigger.

    Btw., a onos can actually ride the train:

    Awesome! That Onos seems to be having loads of fun :P

    Guardian of the "magic cookiejar" AdminModerator

    Existence Unknown

    Retired forum Admin, I mostly used a flamethrower tank for disputes... Mostly
    Retired EUPT Deputy | Moral Support | Squad 5 Blue
    102 1HP Skulk escapes and counting | Play the Latest Version of Booster Z-Frame
    YouTube NS2 Playlists: Unusual Selection | NS2 Stuff | NS2PT | NS2 Tuts

  • Evil_IceEvil_Ice Join Date: 2004-07-09 Member: 29827Members, Squad Five Blue Posts: 531 Fully active user
    How are you setting the vector offsets for the origin additive value? Are you using an angle+distance? That's probably what I would do, using some sin() functions I'd grab the distance and angle from the origin of the elevator first, then reapply their offset from teh origin, based on teh rotation of the elevator + rotational offset value * distance vector value from the origin... it would still be a bit choppy but it should at least be doing more than keeping them at the origin, but I assume this what you are already attempting to do and are having difficulty.
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver Posts: 528 Fully active user
    Well I'll take the origin from the player and modifiy it with a movement vector from the train (I save that every time the train changes his position,
    its the new position - the old one) and then I'll try to get the right point after turning with that function:

    ( i save the degrees everytime the train is turning, so they should be right)

    CODE
    newOrigin.z = trainOrigin.z + (math.cos(degrees) * (entOrigin.z - trainOrigin.z) -  math.sin(degrees) * (entOrigin.x - trainOrigin.x))                
    newOrigin.x = trainOrigin.x + (math.sin(degrees) * (entOrigin.z - trainOrigin.z) +  math.cos(degrees) * (entOrigin.x - trainOrigin.x))


    But as you can see in the vid, it isn't perfect.
  • KurrineKurrine Join Date: 2010-07-03 Member: 72235Members Posts: 478
    I know you're knee-deep in trains right now, but is there any chance that one of the entities on that list would be a weldable trigger? I miss that mechanic quite a bit on maps.
    NS2 is a re-imagining, it'll likely never be the sequel some were looking for.

    NS2c, The NS2 you may be looking for; sticking closer to it's roots.

    Thank you, modding community.

    _______________________________________________________________________

    The best page in the universe
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver Posts: 528 Fully active user
    To weld vents? Well then we would needs vent models that can be closed first.
  • KurrineKurrine Join Date: 2010-07-03 Member: 72235Members Posts: 478
    edited November 2012
    QUOTE (JimWest @ Nov 10 2012, 09:51 AM) »
    To weld vents? Well then we would needs vent models that can be closed first.

    True, I'm hoping that would be the easier part at least.
    Edit:Edit(terrible structure): How hard would you say it'd be to trigger an object just sitting in front of and below or above just sliding up (or down) over the vent as a quick solution in the meantime?
    NS2 is a re-imagining, it'll likely never be the sequel some were looking for.

    NS2c, The NS2 you may be looking for; sticking closer to it's roots.

    Thank you, modding community.

    _______________________________________________________________________

    The best page in the universe
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver Posts: 528 Fully active user
    Oh damn, I got it now, I though i need the degrees in centigrade, but its rad !!!!
    The train is working now fine.
  • AurOn2AurOn2 COOKIES! FREEDOM, AND BISCUITS! Australia Join Date: 2012-01-13 Member: 140224Members, Forum Moderators, NS2 Playtester, Forum staff Posts: 2,130 mod
    QUOTE (Kouji_San @ Nov 10 2012, 08:45 AM) »
    I'm keeping my eye on you Jim!

    RUN AWAY
    RUN AWAY
    Anyway
    GO JIM
    WE'RE ROOTING (FOR) YOU!
    Send me a private message if you need me to kill someone "help" with anything.

    The very existence of flamethrowers proves that sometime, somewhere, someone said to themselves, “You know, I want to set those people over there on fire, but I’m just not close enough to get the job done.” - George Carlin.

    Youtube Channel for Sydney Music
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver Posts: 528 Fully active user
    Well, I think the train is now nearly finished, the positioning system is working like it should,
    it also checks now if you're jumping, when yes then the train will drive ahead and let you at your old position.

    I've also created a waypoint system where the mapper can create waypoints, give them Ids and even a wait delay
    so the train will wait for the delay till he's driving ahead.

    I also started the push_trigger, it's also nearly finished but I don't know what Editor model I should use.

    Here's the vid from the newest train:
  • perkyperky Join Date: 2012-08-31 Member: 157042Members Posts: 21
    Interesting, is the movement networked?
Sign In or Register to comment.