ExtraEntitiesMod

JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
edited May 2013 in Modding
[u]Introduction[/u][br]
[br]
I will make a small mod to bring some extra entites to NS2, like a teleport-trigger, a drivable train etc. [br]
(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.[br]
[br]
Mappers can use them then in their maps to create something different.[br]
The Mod will be called ExtraEntitesMod and if it's finished I will upload it to workshop.[br]
Will also include all the entites to the CombatMod.[br]
[br]
[u]Entities worked on[/u][br]
(look at the bottom at the post to see all entites, will only write here entities that i'm currently working on)[br]
• logic_power_point_listener (triggers when power in room changes)[br]
[br]
[u]Where can I get the mod?[/u][br]
[br]
If you want to get the mod, test the entities or use it on your mods (I will wrote a tutorial for that)[br]
you can download the mod "ExtraEntitiesMod" in the workshop, Id is "66f9c57"[br]
[br]
You can find the code here at GitHub:[br]
https://github.com/JimWest/ExtraEntitesMod[br]
[br]
[br]
[u]How to use the entities?[/u][br]
[br]
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.[br]
[br]
[br]
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).[br]
[br]
_________________________________________________________[br]
Teleporters, trains etc:[br]
_________________________________________________________[br]
[br]
[u]Teleport-Trigger[/u][br]
• The cone will show you the direction of the teleporter output, it will rotate, too, when you rotate the whole trigger.[br]
• 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).[br]
• 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).[br]
• You can disable the trigger via trigger enabled - false, it will only teleport players when a logic entity (like a timer) triggered the teleporter.[br]
• You can set the teleporter to marine or alien team only, default is for both teams (not on the screen, option called Team Number).[br]
• Just ignore the Distance and Angles, thats just to show the cone in the Editor[br]
[br]
[u]Push_Trigger [/u][br]
• The cone will show you the direction of the pushforce. It will rotate, too, when you rotate the whole trigger.[br]
• You can set the Push force, but the default 30 is a good value to start testing.[br]
• 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.[br]
• Just ignore the Distance and Angles, thats just to show the cone in the Editor[br]
[br]
[u]Gravity_Trigger [/u][br]
• Lets you change the gravity inside this trigger for every player which is inside[br]
• 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)[br]
[br]
[u]Func_Door [/u][br]
• Starts open let the door start unlocked (it will work like a normal door, but can be triggered and can be disabled)[br]
• Stay open lets the door stay open when unlocked, but will close when locked (but no open/close all the time)[br]
[br]
[u]Func_Moveable [/u][br]
• 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)[br]
• You can scale the model as you like.[br]
• 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.[br]
• Direction: currently you can only set Up, Down, Left, Right and a waypoint (use a train_waypoint for this)[br]
[br]
[u]Func_Platform[/u][br]
• Works like an elevator, needs 2 func_train_waypoints (start and end point)[br]
• You can use every model for this[br]
[br]
[u]Func_Train[/u][br]
• A drivable train, can turn every model to a train[br]
• 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.)[br]
[br]
[u]Map_Settings[/u][br]
• Rise the view distance if you need to[br]
• you can set fall damage on or off (default off, Lerks, Skulks, JetpackMarines and Fades don't get fall damage)[br]
[br]
[u]Map_Change[/u][br]
• Lets you change the map to a specific map after getting triggered (OH yeah this is working!)[br]
[br]
[br]
_________________________________________________________[br]
Now the Logic entities:[br]
_________________________________________________________[br]
[br]
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).[br]
[br]
[u]Logic_Breakble[/u][br]
• Destroyable Model, will play a cinematic if distroyed[br]
• You can set Health, material etc[br]
[br]
[u]Logic_Button[/u][br]
• Pushable Model (you can set every model to it), will trigger when getting pressed.[br]
• You can set CooldownTime, the team which can trigger it, the amount (once per player, all the time etc.)[br]
[br]
[u]Logic_Cinematic[/u][br]
• Let's you play a Cinematic with all logic entities[br]
• NEW: if you have a camera in your cinematic, this will set to every player so its like a cutscene[br]
[br]
[u]Logic_Counter [/u][br]
• Counts inputs and then triggers after the value in Counter is reached. [br]
[br]
[u]Logic_Emitter [/u][br]
• Emitts on trigger (to call UWE-style entities like sound event and cinematic (not logic_cinematic))[br]
[br]
[u]Logic_Emitter_Destoryer [/u][br]
• Can destroy emitted entities like sound and cinematic (when they're playing)[br]
[br]
[u]Logic_Event_Listener[/u][br]
• Triggers on special Events like game started, team won etc.[br]
[br]
[u]Logic_Function [/u][br]
• 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...)[br]
• Will add more functions to this you can use ingame[br]
[br]
[u]Logic_Give_item[/u][br]
• Gives a specific item to the triggering player (like welder, shotgun, jetpack, even exo etc.)[br]
[br]
[u]Logic_Listener [/u][br]
• Listens on UWE-style entities like button_emitter and timed_emitter to trigger my entities[br]
[br]
[u]Logic_Lua[/u][br]
• Lets you load your costum lua file.[br]
• set your path of the lua file[br]
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).[br]
[br]
[u]Logic_Multiplier [/u][br]
• Will give you the opportunity to trigger mutliple things, but the mutliplier always have to be triggered by another logic entity![br]
• You need to set the name and can name up to 10 outputs to be triggered, you can also trigger another multiplier[br]
[br]
[u]Logic_Reset[/u][br]
• Resets entities to their start values (usefully to reset a timer, counter etc)[br]
[br]
[u]Logic_Switch[/u][br]
• Works a bit like a multiplier with serveral outputs, but will not fire all outputs at the same time, only one.[br]
• Direction of the next triggered entry can be set to forward, backward and random (start value can also be set to random)[br]
[br]
[u]Logic_Timer[/u][br]
• 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.[br]
• You can set wait delay to your disired value, like 120 sec for 2 min etc.[br]
[br]
[u]Logic_Trigger[/u][br]
• Triggers the output entity when a player moves through[br]
• Like the button, you can set CooldownTime, the team which can trigger it, the amount (once per player, all the time etc.)[br]
• You can set if it triggeres when an entity enters or exits.[br]
[br]
[u]Logic_Waypoint[/u][br]
• Will give a waypoint to the triggering player to the position of this entity[br]
• You can set the type of waypoint like move, weld, attack.[br]
[br]
[u]Logic_Weldable [/u][br]
• Will be trigger the output entity when beeing fully welded[br]
• You can disable it so it can only be welded after some time (with a logic_timer etc)[br]
• You can set the weld time at Weld Time in sec, when more player welds its going faster (like you weld a cc etc)[br]
[br]
[u]Logic_Worldtooltip [/u][br]
• Let's you print a short message with gui on the screen if player is near and looking at it (like in Explore mod,[br]
but this one works in the normal game, too)
[br]
[br]
_________________________________________________________[br]
NPC things:[br]
_________________________________________________________[br]
[br]
You can set the team of every npc, so it will be friends to team 1 or team 2[br]
[br]
[u]npc_wave_manager [/u][br]
• Spawns npcs in waves[br]
• You can set the amount of spawned npcs, the class, how much waves etc.[br]
• If you set wave number to 99, it will trigger all the time until it gets deactivated by another trigger[br]
• Can trigger an output if the wave ends[br]
[br]
[u]npc_spawner_marine [/u][br]
• Spawns a marine, you can set the weapon loadout[br]
[br]
[u]npc_spawner_marine_exo[/u][br]
• Spawns an Exo marine, you can set the weapon loadout[br]
[br]
[u]npc_spawner_skulk[/u][br]
• Spawns a skulk[br]
[br]
«13456789

Comments

  • MagnetoMagneto Join Date: 2010-12-22 Member: 75856Members
    Good stuff, thanks again for this!
  • Dictator93Dictator93 Join Date: 2008-12-21 Member: 65833Members, Reinforced - Shadow
    <!--quoteo(post=2008706:date=Nov 3 2012, 11:41 PM:name=JimWest)--><div class='quotetop'>QUOTE (JimWest @ Nov 3 2012, 11:41 PM) <a href="index.php?act=findpost&pid=2008706"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->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 :-)<!--QuoteEnd--></div><!--QuoteEEnd-->

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

    <center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/CQvQFLilTQs"></param><embed src="http://www.youtube.com/v/CQvQFLilTQs" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
  • MaxunitMaxunit Join Date: 2005-02-01 Member: 39414Members, Reinforced - Shadow
    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...
  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members
    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
    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
  • Dictator93Dictator93 Join Date: 2008-12-21 Member: 65833Members, Reinforced - Shadow
    <!--quoteo(post=2010178:date=Nov 4 2012, 11:09 PM:name=JimWest)--><div class='quotetop'>QUOTE (JimWest @ Nov 4 2012, 11:09 PM) <a href="index.php?act=findpost&pid=2010178"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The train is moving on it's waypoints now:

    <center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/CQvQFLilTQs"></param><embed src="http://www.youtube.com/v/CQvQFLilTQs" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center><!--QuoteEnd--></div><!--QuoteEEnd-->
    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
    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
    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
    <!--quoteo(post=2011662:date=Nov 5 2012, 05:54 PM:name=JimWest)--><div class='quotetop'>QUOTE (JimWest @ Nov 5 2012, 05:54 PM) <a href="index.php?act=findpost&pid=2011662"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->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?<!--QuoteEnd--></div><!--QuoteEEnd-->

    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
    Well it's not perfect but it's a start :-)
    ( ignore the path moving, thats totally bugged, I know ^^)

    <center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/yPTNwgTrcYg"></param><embed src="http://www.youtube.com/v/yPTNwgTrcYg" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members
    edited November 2012
    Nice work! With a little more work, this could be the kind of thing that gets brought on-board officially.
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    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 Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    I'm keeping my eye on you Jim!
  • 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
    The generic code for this should allow you to grab onto any moving platform. Say, an Onos.
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members
    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
    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:
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->self.physicsModel:SetTriggerEnabled(true)<!--c2--></div><!--ec2-->

    The train has no collision anymore, even if I enable the Collision with
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->self.physicsModel:SetCollisionEnabled(true)<!--c2--></div><!--ec2-->
  • MagnetoMagneto Join Date: 2010-12-22 Member: 75856Members
    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
    edited November 2012
    <!--quoteo(post=2018203:date=Nov 10 2012, 12:30 PM:name=Magneto)--><div class='quotetop'>QUOTE (Magneto @ Nov 10 2012, 12:30 PM) <a href="index.php?act=findpost&pid=2018203"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->What other entities do you have planned?<!--QuoteEnd--></div><!--QuoteEEnd-->

    Y a push trigger.

    Btw., a onos can actually ride the train:
    <center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/NiI9gwFWY9U"></param><embed src="http://www.youtube.com/v/NiI9gwFWY9U" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    <!--quoteo(post=2018283:date=Nov 10 2012, 01:39 PM:name=JimWest)--><div class='quotetop'>QUOTE (JimWest @ Nov 10 2012, 01:39 PM) <a href="index.php?act=findpost&pid=2018283"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Y a push trigger.

    Btw., a onos can actually ride the train:
    <center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/NiI9gwFWY9U"></param><embed src="http://www.youtube.com/v/NiI9gwFWY9U" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center><!--QuoteEnd--></div><!--QuoteEEnd-->
    Awesome! That Onos seems to be having loads of fun :P
  • Evil_IceEvil_Ice Join Date: 2004-07-09 Member: 29827Members, Squad Five Blue
    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
    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)

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->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))<!--c2--></div><!--ec2-->

    But as you can see in the vid, it isn't perfect.
  • KurrineKurrine Join Date: 2010-07-03 Member: 72235Members
    <!--coloro:#aadd00--><span style="color:#aadd00"><!--/coloro-->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.<!--colorc--></span><!--/colorc-->
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    To weld vents? Well then we would needs vent models that can be closed first.
  • KurrineKurrine Join Date: 2010-07-03 Member: 72235Members
    edited November 2012
    <!--quoteo(post=2018530:date=Nov 10 2012, 09:51 AM:name=JimWest)--><div class='quotetop'>QUOTE (JimWest @ Nov 10 2012, 09:51 AM) <a href="index.php?act=findpost&pid=2018530"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->To weld vents? Well then we would needs vent models that can be closed first.<!--QuoteEnd--></div><!--QuoteEEnd-->
    <!--coloro:#aadd00--><span style="color:#aadd00"><!--/coloro-->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?<!--colorc--></span><!--/colorc-->
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    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&#33; FREEDOM, AND BISCUITS&#33; Australia Join Date: 2012-01-13 Member: 140224Members, Forum Moderators, NS2 Playtester, Forum staff
    <!--quoteo(post=2017519:date=Nov 10 2012, 08:45 AM:name=Kouji_San)--><div class='quotetop'>QUOTE (Kouji_San @ Nov 10 2012, 08:45 AM) <a href="index.php?act=findpost&pid=2017519"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I'm keeping my eye on you Jim!<!--QuoteEnd--></div><!--QuoteEEnd-->
    RUN AWAY
    RUN AWAY
    Anyway
    GO JIM
    WE'RE ROOTING (FOR) YOU!
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    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:
    <center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/zhvqFqC4XU0"></param><embed src="http://www.youtube.com/v/zhvqFqC4XU0" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
  • perkyperky Join Date: 2012-08-31 Member: 157042Members
    Interesting, is the movement networked?
Sign In or Register to comment.