How to add enemies?
HyperMasenko
16 Jul 2013, 03:43How do you add opposing characters, such as a beast that will hurt you? Also, where/how do you add an attack function?
HegemonKhan
17 Jul 2013, 02:16make "enemy" objects and then you got to add attributes and add in scripting too.
for example:
(hopefully, you can figure this out how to do this stuff in the GUI~Editor)
The "Object Type" (it creates an Inherited attribute) which you can select on~via the:
Object -> Attribute (Tab) -> Inherited Attributes -> (scroll down to the very bottom of the list to find the ones you created)
and the "Object Type" is added~created under the "Advanced" on the left pane~side (the "tree of stuff").
you can also make a command instead, which I can help you with, but not right now, going to see a movie, hehe.
------------------
here's some libraries ~ guides too:
http://quest5.net/wiki/Simple_Combat_System_(Advanced)
http://quest5.net/wiki/Using_Types
enjoy
for example:
(hopefully, you can figure this out how to do this stuff in the GUI~Editor)
The "Object Type" (it creates an Inherited attribute) which you can select on~via the:
Object -> Attribute (Tab) -> Inherited Attributes -> (scroll down to the very bottom of the list to find the ones you created)
and the "Object Type" is added~created under the "Advanced" on the left pane~side (the "tree of stuff").
<object name="player">
<inherited name="editor_object" />
<inherited name="editor_player" />
<inherited name="character_type" />
</object>
<object name="orc">
<inherited name="editor_object" />
<inherited name="character_type" />
<verb name="fight">
if (orc.hostile=true) {
player.hp = player.hp - (player.str - orc.end)
msg ("The monster attacks you, and now you have only" + player.hp + "life remaining.")
orc.hp = orc.hp - (orc.str - player.end)
msg ("You attack the monster, and now it only has" + player.hp + "life remaining.")
if (player.hp=0) {
msg ("The monster killed you")
msg ("GAME OVER")
finish
}
if (orc.hp=0) {
player.exp = player.exp + orc.exp
player.cash = player.cash + orc.cash
orc.dead=true
msg (You killed the monster!")
} else {
invoke (orc.fight)
}
} else {
msg ("The orc is not hostile yet, so it's not an enemy that you can fight right now")
}
</verb>
</object>
<type name="character_type">
<dead type="boolean">false</dead>
<undead type="boolean">false</undead>
<hostile type="boolean">false</hostile>
<hostility type="int">0</hostility>
<hp type="int">0</hp>
<mp type="int">0</mp>
<str type="int">0</str>
<end type="int">0</end>
<dex type="int">0</dex>
<agi type="int">0</agi>
<spd type="int">0</spd>
<int type="int">0</int>
<spi type="int">0</spi>
<men type="int">0</men>
<pie type="int">0</pie>
<luk type="int">0</luk>
<lvl type="int">0</lvl>
<exp type="int">0</exp>
<cash type="int">0</cash>
</type>
you can also make a command instead, which I can help you with, but not right now, going to see a movie, hehe.
------------------
here's some libraries ~ guides too:
http://quest5.net/wiki/Simple_Combat_System_(Advanced)
http://quest5.net/wiki/Using_Types
enjoy
