Starting Player Off With Inventory (and another question)

Darkweaver
Hello everyone. I'm an old time fan of text adventure games and I'm thrilled about Quest!

I just started messing around with it and I have a couple initial questions.

1) How do I start the player out with inventory? As in, I want him to already be carrying a couple of items from the start.

2) How do I get objects that you can interact with to show up below the room description?

Thank you!

Edit: Figured out #2 just now. Still need help with #1.

HegemonKhan
in the GUI~Editor, you can simply go to the (default) 'player' Player Object and add Objects to him~her~it, which will be your inventory Objects:

'player' Player Object (left side's 'tree of stuff', click so it is highlighted, then on the right side...) -> Objects (Tab) -> Add -> (name and set up your objects)

or if you already made objects elsewhere, you can simply drag and drop them from where ever into~onto the 'player' Player Object (in the left side's 'tree of stuff')

-------------

some links to help you out:

http://docs.textadventures.co.uk/quest/
http://docs.textadventures.co.uk/quest/tutorial/
http://docs.textadventures.co.uk/quest/ ... notes.html

if you still need help, let me or others know (post away), as we'll be glad to help you get stuff figured out, hehe.

Darkweaver
HegemonKhan wrote:in the GUI~Editor, you can simply go to the (default) 'player' Player Object and add Objects to him~her~it, which will be your inventory Objects:

'player' Player Object (left side's 'tree of stuff', click so it is highlighted, then on the right side...) -> Objects (Tab) -> Add -> (name and set up your objects)

or if you already made objects elsewhere, you can simply drag and drop them from where ever into~onto the 'player' Player Object (in the left side's 'tree of stuff')

-------------

some links to help you out:

http://docs.textadventures.co.uk/quest/
http://docs.textadventures.co.uk/quest/tutorial/
http://docs.textadventures.co.uk/quest/ ... notes.html

if you still need help, let me or others know (post away), as we'll be glad to help you get stuff figured out, hehe.

Hey there, thank you very, very much. I will likely have many more questions since I am getting really into this and I really appreciate any help. I am not good at scripting so I could use laymen's terms at best. This has been very helpful.

I admit a lot of the scripting stuff I see in replies here are a bit intimidating.

I have been reading the tutorial quite a bit but it seems a lot is not there or I cannot find certain things. I will try my best not to be too naggy.

HegemonKhan
were you able to add objects to your inventory? or you still need help with doing this?

------

the tutorial is a great first step to learning to use quest. you should try to do everything in the tutorial (even if some of the stuff is boring and seemingly simple), as some of the important things for using or doing things in questr are a bit hidden within the tutorial as its section titles are a bit broad and ambigious.

most of the posts do use code for helping people, but there's also these links (that have more GUI~Editor pics help for you):

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

and the library files too:

viewforum.php?f=18

unfortunately, there's still not too much help via using the GUI~Editor, as again helping via code, is much easier and faster:

copy and paste (once you craft or research the code for them, anyways), lol

though, other users and mods, will be glad to provide the help you need through using the GUI~Editor, for you. I will too, but I'm not too knowledgeable with using it, others can help you faster, better, accurately, and etc than I can via with using the GUI~Editor.

------

don't worry about the coding~scripting, as quest has the GUI~Editor. I'm not that familiar with the GUI~Editor, as I moved onto the code, as I'm interested in trying to learn it and programming~coding in general, hehe. I prefer to help via using code as it is faster and easier for me to do so, but I'll certainly try to help you with using the GUI~Editor to do things as best as I can, and there's all the other users and mods here, who certainly can help you much better than I can.

it's certainly intimidating at first, but if you become interested in learning it and trying trying to work with it, we can help you, and it's not as bad as it seems, as quest has one of the most user-friendly code structure that is out there, which helps us noobie's to coding a lot, hehe.

Darkweaver
Okay, thank you. I am currently on my tablet so I will be trying this tomorrow, first thing since I am in bed and about to sleep. I have a question about how to switch a lamp on and off since I cannot seem to get it to work right once you get into a dark room. But maybe I will save that and more questions for tomorrow.

HegemonKhan
unforutnately, a lot of this is as code, so just ask about how to do this stuff in the GUI~Editor, if you can't figure it out.

-------

more useful links:

http://docs.textadventures.co.uk/quest/elements/
http://docs.textadventures.co.uk/quest/types/
http://docs.textadventures.co.uk/quest/scripts/
http://docs.textadventures.co.uk/quest/functions/

--------

1. first make sure you first turn on the 'switchable' Tab ( http://docs.textadventures.co.uk/quest/ ... notes.html ), so you have those feature options for your object(s).

2. about the 'darkness' feature:

http://docs.textadventures.co.uk/quest/ ... ength.html (note the 'weak' darkness setting)
http://docs.textadventures.co.uk/quest/ ... ength.html (note the 'weak' darkness setting)
http://docs.textadventures.co.uk/quest/ ... ength.html (note the 'weak' darkness setting)
http://docs.textadventures.co.uk/quest/ ... tdark.html
http://docs.textadventures.co.uk/quest/ ... light.html
http://docs.textadventures.co.uk/quest/ ... kness.html

I'm not familiar with how you do the darkness feature~options~settings in the GUI~Editor, sorry. Hopefully you can figure out how to do the darkness stuff in the GUI~Editor

3. about the 'if' script:

GUI~Editor: run as script -> add a script -> scripts -> if -> (set it up, make sure you click on the correct 'add a script' circle buttons for your 'then', 'if else', and~or 'else' sub parts of your 'if' script)

4. about the 'switchable' feature:

I think in the GUI~Editor, for it's scripts:

run as script -> add a script -> objects -> switch object on~off -> (set it up)

http://docs.textadventures.co.uk/quest/ ... jects.html ( scroll down to the section 'switching the tv on and off' )

http://docs.textadventures.co.uk/quest/ ... tchon.html
http://docs.textadventures.co.uk/quest/ ... hedon.html
http://docs.textadventures.co.uk/quest/ ... choff.html

Darkweaver
HegemonKhan wrote:unforutnately, a lot of this is as code, so just ask about how to do this stuff in the GUI~Editor, if you can't figure it out.

-------

more useful links:

http://docs.textadventures.co.uk/quest/elements/
http://docs.textadventures.co.uk/quest/types/
http://docs.textadventures.co.uk/quest/scripts/
http://docs.textadventures.co.uk/quest/functions/

--------

1. first make sure you first turn on the 'switchable' Tab ( http://docs.textadventures.co.uk/quest/ ... notes.html ), so you have those feature options for your object(s).

2. about the 'darkness' feature:

http://docs.textadventures.co.uk/quest/ ... ength.html (note the 'weak' darkness setting)
http://docs.textadventures.co.uk/quest/ ... ength.html (note the 'weak' darkness setting)
http://docs.textadventures.co.uk/quest/ ... ength.html (note the 'weak' darkness setting)
http://docs.textadventures.co.uk/quest/ ... tdark.html
http://docs.textadventures.co.uk/quest/ ... light.html
http://docs.textadventures.co.uk/quest/ ... kness.html

I'm not familiar with how you do the darkness feature~options~settings in the GUI~Editor, sorry. Hopefully you can figure out how to do the darkness stuff in the GUI~Editor

3. about the 'if' script:

GUI~Editor: run as script -> add a script -> scripts -> if -> (set it up, make sure you click on the correct 'add a script' circle buttons for your 'then', 'if else', and~or 'else' sub parts of your 'if' script)

4. about the 'switchable' feature:

I think in the GUI~Editor, for it's scripts:

run as script -> add a script -> objects -> switch object on~off -> (set it up)

http://docs.textadventures.co.uk/quest/ ... jects.html ( scroll down to the section 'switching the tv on and off' )

http://docs.textadventures.co.uk/quest/ ... tchon.html
http://docs.textadventures.co.uk/quest/ ... hedon.html
http://docs.textadventures.co.uk/quest/ ... choff.html

Yeah, I'm stumped.

See, I managed to figure out the switch on option and light/dark and was finally able to get the portable lamp to light one room for now.

HegemonKhan
Are you still stumped (and with what), or not?

if you want a portable light source... there's a library (think of library files~code as like a game 'patch~expansion pack~add-on~mod~etc") file for it that someone wrote:

viewtopic.php?f=18&t=3743

ask for help on how to add the library file to your game, if you're interested in using this library file~code 's feature.

Darkweaver
HegemonKhan wrote:Are you still stumped (and with what), or not?

if you want a portable light source... there's a library (think of library files~code as like a game 'patch~expansion pack~add-on~mod~etc") file for it that someone wrote:

viewtopic.php?f=18&t=3743

ask for help on how to add the library file to your game, if you're interested in using this library file~code 's feature.

Okay, I will give it a shot. I don't even know what to do with these codes, where to put them, etc, etc, but I'll experiment a bit. :mrgreen:

Too confusing. I don't know where to put that code, what part of that code I'm supposed to use, etc. Sorry, I'm dumb but this brand spanking new to me.

HegemonKhan
here's links on how to use (put) library files (into your game):

http://docs.textadventures.co.uk/quest/ ... aries.html
http://docs.textadventures.co.uk/quest/ ... aries.html

all you need to add to your game code is a single code line ONLY:

(you do NOT add the actual code lines within the library file into your game code, well you can if you want to, but that defeats the very purpose of the library file, lol. A library file is to hold the code you want to add, so that all you got to do is to add the single code line that adds the library file to your game, which it's contents ~ its code lines ~ will be automatically used by your game as they're within the library file, which you added to your game code via just that single required code line, hehe)

(think of a library file as a basket that holds eggs, the code lines of stuff you want to add to your game. So, instead of adding the eggs into your game, you just have to add the basket, the library file, via a single code line to do so)

<include ref="your_library_file's_name.aslx" />

and this goes within the 'game' Object (see~read further below to understand where this is in your game code)

(this is an example only) basically you simply need to add this code line into your game file's coding:

// in the GUI~Editor, there's a notepaper-looking button at the top, in the horizontal bar, between the 'play' and '?-help' buttons. This notepaper button is a toggle button, to switch back and forth between the GUI~Editor view mode and the code view mode. Press this notepaper button to see your game's entire coding. (You can also just open up your game file, *.aslx, with notepad, wordpad, or notepad++, too, to see your game's entire coding)

// people who're good at programing~coding write code horizontally (as it saves so much space), but for us noobies, it's easier to read, write, and troubleshoot vertical code.

This is what a newly created~started game file code looks like:

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="testing game stuff">
<gameid>eaba3834-ff71-459e-8be5-5f72b041cfe9</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>

// this tells quest that this is a game file (*.aslx):

<asl> // the beginning of your game file
(your game's entire mass of code)
</asl> // the ending of your game file

// whereas, instead of using '<asl>(your game's entire mass of code)</asl>', this tells quest that this is a library file (*.aslx):

<library> // the beginning of your library file
(your code that you want to insert into your game file, be it from a few functions or objects to an entire game engine, lol)
</library> // the ending of your library file

// I think and~or hope you get the idea of the structure used for the 'beginning' and 'ending' of code lines~blocks now, I hope!

<asl version="550"> // the ' version="550" ' tells quest what version you're using. This (the number) needs to match up with the quest version that you downloaded and installed, for the game file to play on your quest.exe . I am still using an older version: ' <asl version="540"> ', as I haven't moved onto the newest version of quest yet.

<include ref="English.aslx" /> // these are your default library files, giving the language used for quest as english.

<include ref="Core.aslx" /> // these are your default library files, the 'core.aslx' library file holds all of the individual quest core library files that create the quest engine, quest itself, for us to use, hehe. You can see those files if you look into the folders for quest on your computer, usually: c://programs/quest/etc/(see all those quest core library files?)

// This (the special 'game' Object in the GUI~Editor and its code form below) holds your global game settings that you (and the quest engine randomly generates the game ID, as it must be unique) chose (such as in the GUI~Editor: game -> 'whatever' Tabs -> set them up):

<game name="testing game stuff">
<gameid>eaba3834-ff71-459e-8be5-5f72b041cfe9</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<author>HK</author>
<pov type="object">your_main_playable_character</pov>
<start type="script">
// blah scripts, such as a 'character creation' script block
</start>
</game>

// your default objects:

<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>

// ---------------------

// so... for adding a library file into your game code, it should look like this (using the default new game code):

// let's say I made a library file that adds code of a new game area to explore into the game:

// the library file's name: HK's_added_new_game_area_library_file.aslx
// it's contents: <library>blah code for adding a new area</library>

// and to include it into your game file:

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="HK's_added_new_game_area_library_file.aslx" />
<game name="testing game stuff">
<gameid>eaba3834-ff71-459e-8be5-5f72b041cfe9</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>


and lastly, the library file itself, must be in the same location~folder as your 'quest.exe' quest file is in for it to be found and used in your game by the quest engine (quest.exe).

------------

I'm sure this probably confused you, as I'm trying to explain the code to you, hehe.

so ask away at everything that confuses you, and I'll try to help you along with it.

------------

don't worry, programming isn't easy, it takes time to learn...

I was totally new to quest and to programmng, but I've used quest to learn the basics of programming over about 2 years ago to do so, you can see my embarassing stumbling slow progress in my noob thread, lol:

viewtopic.php?f=10&t=3348&hilit=HK+noob+help+me+thread

enjoy, laughing at me, hehe :D
(I was so overwhelmed just by all the terms... haha, took me a long time to start to really understand them, lol)

Darkweaver
Yup, I am terribly confused but here is what I am going to do.

Because I am already in the process of making a full game and as someone who grew up with Infocom, I have about four lines of text describing a hallway, I do not want to mess it up.

So, I will make another game to use as practice I can mess up. But yeah, I am finding this a bit difficult initially. I was hoping for a GUI that would do most of what I wanted since I wanted to avoid scripting. I still love Quest. Guess I jusy have to practice alot.

Edit: Quest got me Worldbuilding now. Actually brainstorming things like geography, history, characters, cities, religion, etc. for his world I want to make. I want to use Quest to make a rich, detailed world. This program is a gem.

HegemonKhan
you can do all this with the GUI~Editor, but you need to know how to do it (you do have to choose and understand scripting with the GUI~Editor, but the scripts are already there for you, you just need to pick the right ones that you need, so thus, you need to understand 'if' scripting structure on how to do the things that you want).

you were asking for making~having a portable light source, this takes a bit of advanced coding, which has already been done and provided for us as a library file, but you need to know how to implement that library file, hence my attempt at trying to help you with doing it.

quest doesn't have much systems (such as RPG systems: magic, equipment, items, and etc) already in place, because we haven't made many of them publically available, so we got only ourselves to blame. Quest is very powerful for good programmers and for people who can't use code at all, but there's still a learning curve even with using the GUI~Editor, as well as with quest's coding. This is true for anything, no matter how easy to use the game making engine is set up.

-------------

darkweaver wrote:Edit: Quest got me Worldbuilding now. Actually brainstorming things like geography, history, characters, cities, religion, etc. for his world I want to make. I want to use Quest to make a rich, detailed world. This program is a gem.


I started a thread on this stuff, just to try to gather it all in a single place on this site, but I haven't had the time to get back to it in a long time:

viewforum.php?f=20
viewtopic.php?f=20&t=3876

------------

the other users and~or mods will help you, and they're very knowledgeable with quest, able to quickly and much more accurately help you, step by step, via~with doing things in the GUI~Editor, whereas it takes me much longer to do so, and not very clearly nor concisely either. I'm just not the best for helping people, as I'm still a noobie with coding, and hardly know the GUI~Editor, so not of hardly much help with it (I can, but it takes me so long to do provide help with it, sighs).

Darkweaver
Oh, that's a cool little bonus. Thank you! You've been really helpful and ridiculously patient with me. :mrgreen:

I'm starting to get the hang of some things. I still cannot figure out how to put a book on top of a pedestal and have the book be seen when you get into the room. I've done other containers and they worked fine but this "surface" container seems a bit tricky or I'm missing something.

The next big thing I want to do is NPC enemies. Like, attacking and getting attacked by things that can follow you around. I know that is not going to be easy....

Getting the hang of scripts a bit better now.

HegemonKhan
combat is a huge jump... it can be somewhat simple, or uber complex.

and moving an object to the same room as your character is easy to do, but having it laggingly follow behind you (or move towards your character, room to room), room to room, is very advanced coding: path~trajectory coding, which is way beyond me, lol.

I'd first at least try to do the 'characer creation' script block, and see if you can get that.

'surface' is like an open container, though as to your troubles with it, you need to provide more specifics (game code, lol) for us to see what needs to be fixed for it to work.

----------------

here's a lot more help for you:

some useful links:

1. http://quest5.net/wiki/Category:All_Fun ... t_Commands (page 1, range: A-S)
2. http://quest5.net/w/index.php?title=Cat ... t#mw-pages (page 2, range: S-Z)
3. http://quest5.net/wiki/Main_Page
4. http://quest5.net/wiki/Tutorial
5. http://quest5.net/wiki/How_to (guides)
6. http://quest5.net/wiki/Object_element
7. http://quest5.net/wiki/Attribute_Types
8. http://quest5.net/wiki/ASLX_Elements
9. http://quest5.net/wiki/Category:ASLX_Elements
10. viewforum.php?f=18 (guides)
11. viewforum.php?f=20 (text adventure game design)

for character creation:

http://quest5.net/wiki/Character_Creation

leveling up stat selection:

viewtopic.php?f=18&t=4057

Equipment:

1. viewtopic.php?f=18&t=2901
2. viewtopic.php?f=18&t=2660
3. http://quest5.net/wiki/Simple_Combat_System_(Advanced)

Combat:

1. viewtopic.php?f=18&t=2660
2. http://quest5.net/wiki/Simple_Combat_System_(Advanced)

my old combat code (credit goes to Pertex and his Combat code):

<asl version="530">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<pov type="object">player</pov>
<start type="script">
cc
</start>
<turns type="int">0</turns>
<statusattributes type="stringdictionary">turns = </statusattributes>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="defaultplayer" />
<inherit name="pc" />
<cur_hp type="int">999</cur_hp>
<max_hp type="int">999</max_hp>
<str type="int">100</str>
<end type="int">100</end>
<dex type="int">100</dex>
<agi type="int">100</agi>
<spd type="int">100</spd>
<hc type="int">100</hc>
<pd type="int">100</pd>
<pr type="int">100</pr>
</object>
<object name="orc1">
<inherit name="editor_object" />
<inherit name="npc" />
<hostile type="boolean">true</hostile>
<dead type="boolean">false</dead>
<alias>orc</alias>
<cur_hp type="int">999</cur_hp>
<max_hp type="int">999</max_hp>
<str type="int">25</str>
<end type="int">25</end>
<dex type="int">25</dex>
<agi type="int">25</agi>
<spd type="int">25</spd>
<hc type="int">25</hc>
<pd type="int">25</pd>
<pr type="int">25</pr>
</object>
</object>
<turnscript name="game_turns">
<enabled />
<script>
sa
game.turns = game.turns + 1
</script>
</turnscript>
<command name="fight">
<pattern>fight #text#</pattern>
<script>
battle_system (game.pov,text)
</script>
</command>
<type name="char">
<cur_hp type="int">0</cur_hp>
<drop type="boolean">false</drop>
<defending type="boolean">false</defending>
<max_hp type="int">0</max_hp>
<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>
<hp type="int">0</hp>
<hc type="int">0</hc>
<pd type="int">0</pd>
<pr type="int">0</pr>
</type>
<type name="pc">
<inherit name="char" />
<statusattributes type="stringdictionary">hp = ;str = ;end = ;dex = ;agi = ;spd = ;hc = ;pd = ;pr = </statusattributes>
</type>
<type name="npc">
<inherit name="char" />
<dead type="boolean">false</dead>
<hostile type="boolean">false</hostile>
<displayverbs type="list">Look at; Talk; Fight</displayverbs>
</type>
<function name="cc">
msg ("What is your name?")
get input {
game.pov.alias = result
msg (" - " + game.pov.alias)
show menu ("What is your gender?", split ("male;female" , ";"), false) {
game.pov.gender = result
show menu ("What is your race?", split ("human;dwarf;elf" , ";"), false) {
game.pov.race = result
show menu ("What is your class?", split ("warrior;cleric;mage;thief" , ";"), false) {
game.pov.class = result
msg (game.pov.alias + " is a " + game.pov.gender + " " + game.pov.race + " " + game.pov.class + ".")
wait {
ClearScreen
}
}
}
}
}
</function>
<function name="sa">
game.pov.hp = game.pov.cur_hp + " / " + game.pov.max_hp
</function>
<function name="battle_system" parameters="self,text" type="boolean">
first_value = false
enemy = GetObject (text)
if (enemy = null) {
foreach (obj,AllObjects()) {
if (obj.alias=text) {
enemy = obj
}
}
}
if (enemy = null) {
msg ("There is no " + text + " here.")
first_value = false
}
else if (not Doesinherit (enemy,"npc")) {
msg ("You can not battle that!")
first_value = false
}
else if (not npc_reachable (enemy)) {
msg ("There is no " + enemy.alias + " in your vicinity.")
first_value = false
}
else if (GetBoolean (enemy,"dead") = true) {
msg (enemy.alias + " is already dead.")
first_value = false
}
else if (GetBoolean (enemy,"hostile") = false) {
msg (enemy.alias + " is not hostile.")
first_value = false
}
else if (battle_sequence (self,enemy) = true) {
msg ("The battle is over.")
first_value = true
}
return (first_value)
</function>
<function name="battle_sequence" parameters="self,enemy" type="boolean"><![CDATA[
second_value = false
if (enemy.dead = false) {
if (GetInt (self,"spd") > GetInt (enemy,"spd")) {
on ready {
msg ("You get to go first for this round")
if (self_battle_turn (self,enemy) = true) {
battle_sequence (self,enemy)
}
}
on ready {
if (enemy.dead = false) {
if (enemy_battle_turn (self,enemy) = true) {
msg ("The round has ended.")
}
}
}
on ready {
battle_sequence (self,enemy)
}
}
else if (GetInt (self,"spd") < GetInt (enemy,"spd")) {
on ready {
msg (enemy.alias + " gets to go first for this round.")
if (enemy_battle_turn (self,enemy) = true) {
msg ("It is now your turn.")
}
}
on ready {
if (self_battle_turn (self,enemy) = true) {
battle_sequence (self,enemy)
}
else {
msg ("The round has ended.")
}
}
on ready {
battle_sequence (self,enemy)
}
}
else if (GetInt (self,"spd") = GetInt (enemy,"spd")) {
if (RandomChance (50) = true) {
on ready {
msg ("You get to go first for this round")
if (self_battle_turn (self,enemy) = true) {
battle_sequence (self,enemy)
}
}
on ready {
if (enemy_battle_turn (self,enemy) = true) {
msg ("The round has ended.")
}
}
on ready {
battle_sequence (self,enemy)
}
}
else {
on ready {
msg (enemy.alias + " gets to go first for this round.")
if (enemy_battle_turn (self,enemy) = true) {
msg ("It is now your turn.")
}
}
on ready {
if (self_battle_turn (self,enemy) = true) {
battle_sequence (self,enemy)
}
else {
msg ("The round has ended.")
}
}
on ready {
battle_sequence (self,enemy)
}
}
}
}
else {
second_value = true
}
return (second_value)
]]></function>
<function name="self_battle_turn" parameters="self,enemy" type="boolean"><![CDATA[
third_value = false
msg (self.alias + " has " + self.cur_hp + " HP left.")
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
wait {
show menu ("What is your battle choice?", split ("Attack;Defend;Cast;Item;Run", ";"), false) {
switch (result) {
case ("Attack") {
fourth_value = false
if (RandomChance (GetInt (enemy,"agi") - GetInt (self,"spd")) = true) {
msg (enemy.alias + "evaded your attack!")
fourth_value = true
}
else if (RandomChance (GetInt (enemy,"Dex") - GetInt (self,"agi")) = true) {
msg (enemy.alias + "parried your attack!")
fourth_value = true
}
else if (RandomChance (GetInt (enemy,"agi") - GetInt (self,"dex")) = true) {
msg (enemy.alias + "blocked your attack!")
fourth_value = true
}
else if (RandomChance (GetInt (self,"dex") - GetInt (enemy,"spd")) = false) {
msg ("Your attack missed " + enemy.alias +"!")
fourth_value = true
}
else if (RandomChance (GetInt (enemy,"pr") - GetInt (self,"hc")) = true) {
msg ("Your attack got resisted by " + enemy.alias +"!")
fourth_value = true
}
else if (fourth_value = false) {
if (self.defending = true and enemy.defending = true) {
enemy.cur_hp = enemy.cur_hp - (crit_hit (self) * 2 * GetInt (self,"pd") / 2 + GetInt (self,"pd") * (GetInt (self,"str") - GetInt (enemy,"end")) / 100)
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
self.defending = false
}
else if (self.defending = true and enemy.defending = false) {
enemy.cur_hp = enemy.cur_hp - (crit_hit (self) * 2 * GetInt (self,"pd") + GetInt (self,"pd") * (GetInt (self,"str") - GetInt (enemy,"end")) / 100)
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
self.defending = false
}
else if (self.defending = false and enemy.defending = true) {
enemy.cur_hp = enemy.cur_hp - (crit_hit (self) * GetInt (self,"pd") / 2 + GetInt (self,"pd") * (GetInt (self,"str") - GetInt (enemy,"end")) / 100)
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
}
else if (self.defending = false and enemy.defending = false) {
enemy.cur_hp = enemy.cur_hp - (crit_hit (self) * GetInt (self,"pd") + GetInt (self,"pd") * (GetInt (self,"str") - GetInt (enemy,"end")) / 100)
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
}
}
}
case ("Defend") {
if (self.defending = false) {
self.defending = true
}
}
case ("Cast") {
self.defending = false
}
case ("Item") {
self.defending = false
}
case ("Run") {
self.defending = false
}
}
if (GetInt (enemy,"cur_hp") > 0) {
if (RandomChance (GetInt (self,"spd") - GetInt (enemy,"spd")) = true) {
msg ("You get an extra battle turn!")
self_battle_turn (self,enemy)
}
else {
msg ("Your battle turn is over.")
third_value = false
}
}
else if (GetInt (enemy,"cur_hp") <= 0) {
msg (enemy.alias + " is dead.")
msg ("You have won the battle!")
enemy.defending = false
enemy.dead = true
third_value = true
wait {
ClearScreen
}
}
}
}
return (third_value)
]]></function>
<function name="enemy_battle_turn" parameters="self,enemy" type="boolean"><![CDATA[
fifth_value = false
msg (self.alias + " has " + self.cur_hp + " HP left.")
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
result = GetRandomInt (1,3)
switch (result) {
case (1) {
sixth_value = false
if (RandomChance (GetInt (self,"agi") - GetInt (enemy,"spd")) = true) {
msg ("You have evaded the attack!")
sixth_value = true
}
else if (RandomChance (GetInt (self,"dex") - GetInt (enemy,"agi")) = true) {
msg ("You have parried the attack!")
sixth_value = true
}
else if (RandomChance (GetInt (self,"agi") - GetInt (enemy,"dex")) = true) {
msg ("You have blocked the attack!")
sixth_value = true
}
else if (RandomChance (GetInt (enemy,"dex") - GetInt (self,"spd")) = false) {
msg (enemy.alias +"'s attack missed!")
sixth_value = true
}
else if (RandomChance (GetInt (self,"pr") - GetInt (enemy,"hc")) = true) {
msg ("You resisted the attack!")
sixth_value = true
}
else if (sixth_value = false) {
if (enemy.defending = true and self.defending = true) {
self.cur_hp = self.cur_hp - (crit_hit (enemy) * 2 * GetInt (enemy,"pd") / 2 + GetInt (enemy,"pd") * (GetInt (enemy,"str") - GetInt (self,"end")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
enemy.defending = false
}
else if (enemy.defending = true and self.defending = false) {
self.cur_hp = self.cur_hp - (crit_hit (enemy) * 2 * GetInt (enemy,"pd") + GetInt (enemy,"pd") * (GetInt (enemy,"str") - GetInt (self,"end")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
enemy.defending = false
}
else if (enemy.defending = false and self.defending = true) {
self.cur_hp = self.cur_hp - (crit_hit (enemy) * GetInt (enemy,"pd") / 2 + GetInt (enemy,"pd") * (GetInt (enemy,"str") - GetInt (self,"end")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
}
else if (enemy.defending = false and self.defending = false) {
self.cur_hp = self.cur_hp - (crit_hit (enemy) * GetInt (enemy,"pd") + GetInt (enemy,"pd") * (GetInt (enemy,"str") - GetInt (self,"end")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
}
}
}
case (2) {
if (enemy.defending = false) {
msg (enemy.alias + " has choosen to defend itself.")
enemy.defending = true
}
}
case (3) {
enemy.defending = false
msg ("Cast")
}
}
if (GetInt (self,"cur_hp") > 0) {
if (RandomChance (GetInt (enemy,"spd") - GetInt (self,"spd")) = true) {
msg (enemy.alias + " gets an extra battle turn!")
wait {
enemy_battle_turn (self,enemy)
}
}
else {
msg (enemy.alias + " 's battle turn is over.")
fifth_value = true
}
}
else if (GetInt (self,"cur_hp") <= 0) {
msg (self.alias + " has died.")
msg ("GAME OVER")
finish
}
return (fifth_value)
]]></function>
<function name="npc_reachable" parameters="object" type="boolean">
value = false
foreach (x,ScopeReachableNotHeld ()) {
if (x=object) {
value = true
}
}
return (value)
</function>
<function name="crit_hit" parameters="object" type="int">
if (RandomChance (GetInt (object,"luck")) = true) {
value = 2
}
else {
value = 1
}
return (value)
</function>
</asl>


and sorry about the abrevs, here's the key~legend for them:

01. cc = character creation function
02. sa = status attributes (mainly for implementing/displaying of ' cur / max ' stats) function
03. char = character object type ("pcs", "npcs", "monsters", etc., so, not a room, item, equipment, spell, etc)
04. pc = playable character object type ("player" characters / game.povs)
05. npc = non-playable character ("people", "monsters", and etc, so not a "player" character / not a game.pov, I'm going to have a hostility system, so any npc can be friendly or hostile, instead of having an actual "monster/enemy" type set aside)
06. hp = hit points (life) stat attribute
07. mp = mana points (magic) stat attribute
08. str = strength (physical damage, carry weight / equipment requirement, etc) stat attribute
09. end = endurance (physical defense, and etc) stat attribute
10. dex = dexterity (weapon~attack skill, think of this as "if your attack connects or not, do you 'whiff' or not", so not to gete confused with hc, and etc) stat attribute
11. agi = agility (dodging/evading, and etc) stat attribute
12. spd = speed (who goes first in battle, extra battle turns, escaping from battle, and etc) stat attribute
13. hc = hit chance (think of this more as piercing their armor or not, so not to get confused with dex, and etc) stat attribute
14. pd = physical damage stat attribute
15. fp = fire damage stat attribute
16. wp = water damage stat attribute
17. ap = air damage stat attribute
18. ed = earth damage stat attribute
19. ld = light damage stat attribute
20. dd = dark damage stat attribute
21. pr = physical resistance stat attribute
22. fr = fire resistance stat attribute
23. wr = water resistance stat attribute
24. ar = air resistance stat attribute
25. er = earth resistance stat attribute
26. lr = light resistance stat attribute
27. dr = dark resistance stat attribute
28. defending = boolean (reduces damage done for that character and increases the damage done by that character, if they chosoe to attack on the next turn)
29. escaped = boolean, run from battle (not completed/implemented yet)
30. hostile = boolean, any npc can be friendly or a(n) "monster/enemy", based upon a hostility scale (0-100), but not completed
31. dead = boolean
32. crit_hit = critical hit (bonus damage based upon luck)
33. luck = luck stat attribute
34. lvl = level stat attribute
35. exp = experience stat attribute
36. cash = cash stat attribute (currency)
37. lvlup = level up function


Shopping:

viewtopic.php?f=18&t=2557

Items:

viewtopic.php?f=18&t=3515

Date and Time:

viewtopic.php?f=18&t=2580

my explore and travel example code:

<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>eef801a1-4e6b-4b0a-bdbf-8f3ecfa8389c</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<turns type="int">0</turns>
<statusattributes type="simplestringdictionary">turns=</statusattributes>
<start type="script">
msg ("Important Note:")
msg ("Type in: help")
</start>
</game>
<object name="homeland">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
<object name="grassland">
<inherit name="editor_room" />
</object>
<object name="plains">
<inherit name="editor_room" />
</object>
<object name="desert">
<inherit name="editor_room" />
</object>
<object name="tundra">
<inherit name="editor_room" />
</object>
<object name="swampland">
<inherit name="editor_room" />
</object>
<object name="mountains">
<inherit name="editor_room" />
</object>
<object name="forest">
<inherit name="editor_room" />
</object>
<object name="wasteland">
<inherit name="editor_room" />
</object>
<object name="coastland">
<inherit name="editor_room" />
</object>
<object name="hills">
<inherit name="editor_room" />
</object>
<command name="help_command">
<pattern>help</pattern>
<script>
help_function
</script>
</command>
<command name="explore_command">
<pattern>explore</pattern>
<script>
explore_function
</script>
</command>
<command name="travel_command">
<pattern>travel</pattern>
<script>
travel_function
</script>
</command>
<object name="data_object">
<inherit name="editor_object" />
<travel_string_list type="simplestringlist">homeland</travel_string_list>
<homeland_events_string_list type="simplestringlist">grassland_discovery;plains_discovery;desert_discovery;tundra_discovery;swampland_discovery;forest_discovery;mountains_discovery;hills_discovery;wasteland_discovery;coastland_discovery</homeland_events_string_list>
<homeland_events_script_dictionary type="scriptdictionary">
<item key="grassland_discovery">
list add (data_object.travel_string_list, "grassland")
msg ("You've discovered the grassland! Now, you can travel to the grassland and explore it!")
</item>
<item key="plains_discovery">
list add (data_object.travel_string_list, "plains")
msg ("You've discovered the plains! Now, you can travel to the plains and explore it!")
</item>
<item key="desert_discovery">
list add (data_object.travel_string_list, "desert")
msg ("You've discovered the desert! Now, you can travel to the desert and explore it!")
</item>
<item key="tundra_discovery">
list add (data_object.travel_string_list, "tundra")
msg ("You've discovered the tundra! Now, you can travel to the tundra and explore it!")
</item>
<item key="swampland_discovery">
list add (data_object.travel_string_list, "swampland")
msg ("You've discovered the swampland! Now, you can travel to the swampland and explore it!")
</item>
<item key="forest_discovery">
list add (data_object.travel_string_list, "forest")
msg ("You've discovered the forest! Now, you can travel to the forest and explore it!")
</item>
<item key="mountains_discovery">
list add (data_object.travel_string_list, "mountains")
msg ("You've discovered the mountains! Now, you can travel to the mountains and explore it!")
</item>
<item key="hills_discovery">
list add (data_object.travel_string_list, "hills")
msg ("You've discovered the hills! Now, you can travel to the hills and explore it!")
</item>
<item key="wasteland_discovery">
list add (data_object.travel_string_list, "wasteland")
msg ("You've discovered the wasteland! Now, you can travel to the wasteland and explore it!")
</item>
<item key="coastland_discovery">
list add (data_object.travel_string_list, "coastland")
msg ("You've discovered the coastland! Now, you can travel to the coastland and explore it!")
</item>
</homeland_events_script_dictionary>
</object>
<turnscript name="global_turnscript">
<enabled />
<script>
game.turns = game.turns + 1
</script>
</turnscript>
<function name="help_function">
msg ("Type 'explore' to explore your area.")
msg ("Type 'travel' to travel to different areas.")
</function>
<function name="explore_function"><![CDATA[
switch (game.pov.parent) {
case (homeland) {
result_1 = ListCount (data_object.homeland_events_string_list) - 1
if (result_1 >= 0) {
result_2 = StringListItem (data_object.homeland_events_string_list,GetRandomInt(0,result_1))
invoke (ScriptDictionaryItem (data_object.homeland_events_script_dictionary,result_2))
on ready {
foreach (item_x, split ("grassland_discovery;plains_discovery;desert_discovery;tundra_discovery;swampland_discovery;forest_discovery;mountains_discovery;hills_discovery;wasteland_discovery;coastland_discovery",";")) {
if (result_2 = item_x) {
list remove (data_object.homeland_events_string_list, result_2)
}
}
}
} else {
msg ("There seemingly is nothing left to explore in this area.")
}
}
}
]]></function>
<function name="travel_function">
show menu ("Where do you wish to travel?",data_object.travel_string_list,false) {
if (not game.pov.parent = GetObject (result)) {
game.pov.parent = GetObject (result)
} else {
msg ("You are already at this area.")
ask ("Try again?") {
if (result=true) {
travel_function
} else {
msg ("You realize that you need to discover a new area to travel to first, before you can travel to that place.")
}
}
}
}
</function>
</asl>


Magic:

http://quest5.net/wiki/Using_Types_and_Tabs_(Advanced) (scroll down, and especially to the bottom for the game file+code links)

and etc game aspects and their links

--------------

err... some of the links may not work anymore as the quest documentation got moved from the old wiki to now (whatever the online source used for it).

Darkweaver
I did it!!!!

I created a successful portable lantern (with a small catch!)

I created a container that can be opened and closed. I put a "Glow Stone" in it that illuminates dark rooms and set it than you cannot "take" the glow stone out.

I then when into the Verbs listed and added Turn On and Turn Off. For Turn On, I basically put if the lantern is closed, then open the lantern. If lantern is already open, it prints "it's already open"

For Turn Off, I did the same thing except put if the lantern is on, close it. If lantern is already closed, then it prints "it's already closed."

I did multiple testing through dark rooms and it works perfectly. Portable light source resolved!

The catch is the lantern is a container with the light source inside of it, but that's fine and it still works exactly how I want. Plus, it adds a little "realism" to it. :P

HegemonKhan
that's really an ingenious method, you should make a thread, alternative simple portable lantern (or whatever you want to call it), in the ' library and code samples ' forum board section, about how to do this, hehe. Great job! :D

Darkweaver
HegemonKhan wrote:that's really an ingenious method, you should make a thread, alternative simple portable lantern (or whatever you want to call it), in the ' library and code samples ' forum board section, about how to do this, hehe. Great job! :D

Thank you very much!

Considering I'm having a difficult time, it's surprising I was able to figure this out. :lol:

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

Support

Forums