Combat help

sillyEnthusiast
Okay, so I'm trying to implement a simple combat system in which the player kills an enemy in exchange for a currency called grist to use the alchemiter as well as to build their house up so they can reach the first gate and get to their planet. However, I don't know how to make my weapons functional or set a combat system. I don't want strength, speed, etc. attributes, just a simple level-based system. I found the corecombat library, but I don't know how to look at what is in the library to know what is in it for me to use. Is there a way to see what functions and whatnot are in a library?

HegemonKhan
you can open up any *.aslx file with notepad, wordpad, or notepad++ ( http://notepad-plus-plus.org/ )

Game file: *.aslx
Library file: *aslx

and I think *.xml works with quest too, as well as being also openable via the text software above

---------

can you describe a~your 'level-based' combat system, as I'm not quite sure what that means, though with more details, I can help you, but implementing equipment is a bit more advanced, I think I can do some equipment usage, but I'm not that good at coding in equipment yet. We need more details~info on what you want your combat system to be, look like, do, and etc.

the others can also help you much better than I can too.

------

there's also the Libraries too:

Pertex' Combat+Equipment Library (or my variation of it and without equipment implemented)
Pixie's Simple Combat+Equipment+Magic Library + Pixie's new combat library+demo game
Chase's Wearables (Equipment) Library
Sora's Stackable (Items) Library
etc etc etc

The Pixie
Take a look at the "how to"s, as they is a starting point for a combat system there. The pages are built around learning types and tabs. I think tabs are pretty useful, but they can be ignored. On the other hand, types are essential if you want to see how libraries are coded and I would say to create any system in Quest of any size.

http://docs.textadventures.co.uk/quest/guides/

[list][*]Using Types[/*:m]
[*]Using Types and Tabs (Advanced)[/*:m]
[*]More on Tabs (Advanced) (implementing a magic system)[/*:m]
[*]Simple Combat System (Advanced)[/*:m][/list:u]

There is a lot of designing the system before you even start to code. Exactly how are attacks resolved, damage determined, etc. What will the player actually type at the keyboard? Armour, shields, dual wielding, healing, bows, cover, parrying, running away.

I will pimp my own system here too, though it might be too complicated for what you want.
viewtopic.php?f=18&t=4886

sillyEnthusiast
The best way I can think to explain it is the player starts at level 1, and likewise the small enemies up to the first gate are also level 1 and are 1-hit kills that grant so much grist. In an equation the system would look something like pl/el=h (pl=player level, el=enemy level, h=hits). And likewise, el/pl=h for an enemy to kill the player. Levels come from xp as well as better weapons.

sillyEnthusiast
Oh and Pixie, thanks for that link! I am terrible at navigating the docs site. I think I've scrolled through all the lists of things to no avail and the thing I need always ends up to be somewhere that I apparently couldn't find. I looked at your combat system, and while really cool, definitely too much for what I need.

HegemonKhan
sillyEnthusiast wrote:Okay, so I'm trying to implement a simple combat system in which the player kills an enemy in exchange for a currency called grist to use the alchemiter as well as to build their house up so they can reach the first gate and get to their planet. However, I don't know how to make my weapons functional or set a combat system. I don't want strength, speed, etc. attributes, just a simple level-based system.

The best way I can think to explain it is the player starts at level 1, and likewise the small enemies up to the first gate are also level 1 and are 1-hit kills that grant so much grist. In an equation the system would look something like pl/el=h (pl=player level, el=enemy level, h=hits). And likewise, el/pl=h for an enemy to kill the player. Levels come from xp as well as better weapons.


here's a start of me trying to help you, laughs. Your 'clvl - mlvl = hits~life~damage' is a bit more complex than I realized, I'll got to think of how to get this to work, lol. (it'd be easier to give a 'life' and 'damage' attributes, sighs):

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<version>1.0</version>
<gameid>xxx</gameid>
<author>HegemonKhan</author>
<pov type="object">player</pov>
<attr name="turns_integer" type="int">0</attr>
<statusattributes type="simplestringdictionary">turns_integer = Turns: !</statusattributes>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="character_object_type" />
</object>
<object name="monster_1_object">
<inherit name="editor_object" />
<inherit name="character_object_type" />
<attr name="experience_integer" type="int">5</attr>
<attr name="cash_integer" type="int">10</attr>
<attr name="right_hand_object" type="object">dagger_weapon_object</attr>
</object>
<object name="monster_2_object">
<inherit name="editor_object" />
<inherit name="character_object_type" />
<attr name="level_integer" type="int">2</attr>
<attr name="experience_integer" type="int">10</attr>
<attr name="cash_integer" type="int">50</attr>
<attr name="right_hand_object" type="object">shortsword_weapon_object</attr>
</object>
</object>
<object name="global_data_object">
<inherit name="editor_object" />
<object name="unarmed_weapon_object">
<inherit name="editor_object" />
<inherit name="weapon_object_type" />
<alias>unarmed</alias>
</object>
<object name="dagger_weapon_object">
<inherit name="editor_object" />
<inherit name="weapon_object_type" />
<alias>dagger</alias>
<attr name="damage_integer" type="int">2</attr>
</object>
<object name="shortsword_weapon_object">
<inherit name="editor_object" />
<inherit name="weapon_object_type" />
<alias>shortsword</alias>
<attr name="damage_integer" type="int">3</attr>
</object>
</object>
<turnscript name="global_turnscript">
<enabled />
<script>
leveling_function
game.turns_integer = game.turns_integer + 1
</script>
</turnscript>
<function name="leveling_function"><![CDATA[
if (game.pov.experience_integer >= game.pov.level_integer * 100 + 100) {
game.pov.experience_integer = game.pov.experience_integer - game.pov.level_integer * 100 + 100
game.pov.level_integer = game.pov.level_integer + 1
leveling_function
}
]]></function>
<function name="fight_function" parameters="self,enemy"><![CDATA[
// I got to think more about this, as it's more complex than I realized to get it to work right:
life_integer = ToInt (self.level_integer / enemy.level_integer
damage_integer = ToInt (self.right_hand.damage)
life_integer = life_integer - damage_integer
if (life_integer <= 0) {
}
]]></function>
<type name="character_object_type">
<attr name="level_integer" type="int">1</attr>
<attr name="experience_integer" type="int">0</attr>
<attr name="cash_integer" type="int">0</attr>
<attr name="right_hand_object" type="object">unarmed_weapon_object</attr>
<attr name="condition_stringlist" type="simplestringlist">normal</attr>
</type>
<type name="equipment_object_type">
<equip type="script">
</equip>
<unequip type="script">
</unequip>
</type>
<type name="weapon_object_type">
<inherit name="equipment_object_type" />
<attr name="damage_integer" type="int">1</attr>
</type>
</asl>

Avantar
sillyEnthusiast wrote:However, I don't know how to make my weapons functional ...


Here is my opinion:
I also wanted a simple combat system. The challenge started with equipping weapons. You need to know at least if a weapon is equipped. In my case I needed to know which weapon and what stats it has and if it is a single - or two handed weapon, is it in my left or right hand?
In your mind, you just need something simple - I did too.
You also have to consider if an enemy is present and reachable, what happens on enemy death and so forth(Does the enemy stay there being dead and searchable or does it vanish.How much XP does it give...). It usually ends up far more complicated than most hope for.

So my best advice would be to take The Pixie's advice and start here: http://docs.textadventures.co.uk/quest/ ... nced_.html and understand the bulk of that. From there construct the exact thing you want.
I personally learned from Pixie's Simple Combat example.(Thank you Pixie!)
If you incorporate armor and clothes in your game, I will surely recommend Chase's Wearables Library

If you need to equip weapons, I might be able to help when time permits.

sillyEnthusiast
I took some time to think about it differently than I have been, and I think I can do what I need to in the normal view without touching code if I'm right. I'll try it today and get back to y'all on if it works or not! And thanks, HK, that code gave me a good bit of insight into what I need to do here.

Silver
If I were ever to do combat I'd probably do it like Fighting Fantasy books. You enter an area where there's an enemy. You have a chance to turn on your heels or slip past otherwise it's game on.

HegemonKhan
@SillyEnthuisist:

you can create a new game file, go into Code View (at the top of the screen in the bar between the 'play' and '?-help' buttons is a notepaper-like button ~ this is a toggle button between the GUI~Editor mode and the Code View mode), delete the entire new game's code, highlight my code above (the 'select all' hyperlink), copy it, and then paste it into your new game, save it, and then play (well it's not really playablely done yet)~study it in its GUI~Editor form.

well... you're going to need to generate (or copy and paste) in a 'gameid' string though... (if you need help with this, let me know).

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums