Way for player to generate objects in-game?
Garsid
28 May 2015, 20:53That's it, really, I wonder how you can have the player create objects with non-random attributes in-game.
HegemonKhan
28 May 2015, 21:48Creating the Objects:
http://docs.textadventures.co.uk/quest/ ... reate.html
Creating~Set'ting the Objects' Attributes:
in GUI~Editor: run as script -> add a~new script -> variables -> 'set a variable or attribute' Script -> (set it up)
in Code: Object_name.Attribute_name = Value_or_Expression
example (in code):
or, if you are ready for Object Types:
http://docs.textadventures.co.uk/quest/ ... /type.html
http://docs.textadventures.co.uk/quest/types.html
http://docs.textadventures.co.uk/quest/ ... types.html
http://docs.textadventures.co.uk/quest/ ... types.html
or, there's also the 'set' Script too, if the 'Object_name.Attribute_name = Value_or_Expression', doesn't work:
http://docs.textadventures.co.uk/quest/scripts/set.html
------------------
if you mean, as in letting the person playing the game, to 'craft-create' their own Objects... then you need to use Commands:
http://docs.textadventures.co.uk/quest/ ... mmand.html
and etc advanced parsing scripting, not easy to code in if a code noob.
http://docs.textadventures.co.uk/quest/ ... reate.html
Creating~Set'ting the Objects' Attributes:
in GUI~Editor: run as script -> add a~new script -> variables -> 'set a variable or attribute' Script -> (set it up)
in Code: Object_name.Attribute_name = Value_or_Expression
example (in code):
<function name="test">
Create (orc_1)
orc_1.strength = 25
</function>
or, if you are ready for Object Types:
http://docs.textadventures.co.uk/quest/ ... /type.html
http://docs.textadventures.co.uk/quest/types.html
http://docs.textadventures.co.uk/quest/ ... types.html
http://docs.textadventures.co.uk/quest/ ... types.html
<function name="test">
Create (orc_1,"orc_object_type")
Create (orc_2,"orc_object_type")
Create (orc_3,"orc_object_type")
</function>
<type name="orc_object_type">
<attr name="strength" type="int">25</attr>
<attr name="endurance" type="int">25</attr>
<attr name="dexterity" type="int">25</attr>
</type>
or, there's also the 'set' Script too, if the 'Object_name.Attribute_name = Value_or_Expression', doesn't work:
http://docs.textadventures.co.uk/quest/scripts/set.html
------------------
if you mean, as in letting the person playing the game, to 'craft-create' their own Objects... then you need to use Commands:
http://docs.textadventures.co.uk/quest/ ... mmand.html
and etc advanced parsing scripting, not easy to code in if a code noob.