Input/Output Framework

FehaFeha Join Date: 2006-11-16 Member: 58633Members
edited January 2013 in Modding
<div class="IPBDescription">IOF in short</div>This mod is mostly intended to be used as a framework for coders, that they can use to easily create entities with inputs and outputs.
I also made some demo-entities, which are placeable by map editor, so mappers can do fun stuff with it already.
You can find the mod at <a href="http://steamcommunity.com/sharedfiles/filedetails/?id=116502607" target="_blank">Workshop</a>, or as a svn at <a href="https://fehastuff.googlecode.com/svn/trunk/NaturalSelection2/mod_ioframework" target="_blank">https://fehastuff.googlecode.com/svn/trunk/...mod_ioframework</a>

For modders:
To create an entity using this framework, all you has to do is use the mixin for I/OEntities, use a createI/O function, and for input entities, have a TriggerInput callback. To change an outputs value, a TriggerEntityOutput function is used.

For mappers:
If you add the entity to editor_setup.xml, you can give it params named like map_input_InputName (or output) with a string value, the mixins will notice this string, and use it to link ports as specified by mapper.
The string of an output is its unique id, none is needed, but only one may have the same.
The string of an input is used to find the output with that id, and then link to it.
If you look at my test map "test.level", although created to test entites, not as a tutorial, it should still be able to serve as a nice demonstration. It has some basic logic, arithmetic, and a timer test.


The demo-entities that mappers can use already, is quite a few logic, comparison, arithmetic and timer gates. However, I have not made many entities that does not depend on their inputs, and currently the only ones would be the trigger-volume and the door.
I am mostly trying to create the invisible backbones needed to create cool stuff using "flashy and physical" entities like doors, but if you have any idea of something that I should add, then please suggest it here.



I also made a mixin entities can use if they want to let mappers set a map_name string param, that can be used to find the entity. Pretty similar to the IOF from a mappers perspective, and although not really a part of an IO Framework, I made it as I suggest it might be usefull for later entities.



Fell free post any feedback/questions you have in this thread! :)
Sign In or Register to comment.