Can powernodes affect the state of objects other than light?

guitarxeguitarxe Join Date: 2012-11-02 Member: 166148Members
I'm starting to poke around the Spark editor (so different from what I'm used to with UDK and Hammer), and before I commit to a particular map I'm wondering if the following is possible:

Powernodes that are destroyed can turn off lights in the game, but can they affect the state of anything else?

I guess what I'm asking is is there any kind of scripting available like the kismet in UDK, for example? I haven't been able to find anything of the sort when I had a quick look.

Comments

  • TigTig Join Date: 2010-05-08 Member: 71674Members, Reinforced - Shadow, WC 2013 - Silver
    edited November 2012
    <!--quoteo(post=2017131:date=Nov 9 2012, 11:47 AM:name=guitarxe)--><div class='quotetop'>QUOTE (guitarxe @ Nov 9 2012, 11:47 AM) <a href="index.php?act=findpost&pid=2017131"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I'm starting to poke around the Spark editor (so different from what I'm used to with UDK and Hammer), and before I commit to a particular map I'm wondering if the following is possible:

    Powernodes that are destroyed can turn off lights in the game, but can they affect the state of anything else?

    I guess what I'm asking is is there any kind of scripting available like the kismet in UDK, for example? I haven't been able to find anything of the sort when I had a quick look.<!--QuoteEnd--></div><!--QuoteEEnd-->

    you bet, through modding and lua scripting. but not in standard natural selection 2 game mode... currently.

    edit: take your questions over to the <strike>nerds</strike> smart guys in the modding forum.
  • KrozuKrozu Join Date: 2012-08-06 Member: 154854Members
    And what exactly would you like to change the state off? Doors maybe, or other power nodes?
  • guitarxeguitarxe Join Date: 2012-11-02 Member: 166148Members
    Mostly doors, yes, but also visual flair like "shutters" over windows. For example if the power is cut-off the shutters automatically raise to let light in through the windows (albeit some poor, insufficient light).
    Maybe stop some rotating blade in a ventilation flue that will now let aliens have a shortcut somewhere.

    Basically I just want to be able to have a bigger effect when the powernode is destroyed. Both in terms of visual flair and for map strategy.
  • Shr3dShr3d Join Date: 2006-11-02 Member: 58265Members, Reinforced - Shadow
  • m0rdm0rd Join Date: 2012-11-26 Member: 173223Members
    Searching for something similar here. How would someone go about scripting this? I was thinking of a "prison cell" idea where the prison cells are sealed by Forcefields (using the Forcefield Prop as a glass window of sorts), where I could tie the Forcefields to the Power Node which would shut off if the node was destroyed. Kinda disappointed that there isn't an option to tie Props to Power Nodes as yet and I'm not looking forward to getting my hands dirty with LUA scripting since I wouldn't have the faintest clue on where to start.
  • TwixitTwixit Join Date: 2012-11-05 Member: 167120Members
    Short answer may give the explanation: Alpha/Beta Map-Editor.

    The Editor will improve but not yet, tho they still search for some one who can program for the Editor.
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    Anything that could be affected by power node changes must be an entity. An Entity is a networking concept. It is an object or container of data that allows Client and Server to communicate about the same thing and remain synchronized. You need to have anything affected by Power Nodes be entities so the server can query them and trigger any changes needed; then propagate those changes out to the appropriate clients.

    So, anything that would get changed with a Power Node's state must be created via code, and then wired into the editor_setup.xml file. The editor has to know WTH it is you're placing in a map.

    Depending on what you're wanting to do, this could either be fairly straight forward, or potentially <b>very</b> complicated. Something like a force field would need a model with collision / physics related data in the model. Otherwise, the Client/Server won't know how / when / should something interact with said Force Field.

    Ideally, mappers would have an entity system available to them, and then be able to use trigger volumes to achieve this sort of effect. A trigger entity could then "Listen" to power nodes and perform X when their state changes. The "X" being defined by the mapper. Having a system like this would require a significant amount of work however, so I wouldn't expect to see it any time soon.

    If you're curious how things get affected by Power node state changes, take a look at PowerConsumerMixin.lua and PowerSourceMixin.lua
    Nice thing is, hooking things into the power grid is almost as simple as implementing those two mixins. In the first version of MvM, I modified doors so they require power from the closest power node. It was very easy to do.
Sign In or Register to comment.