Stuff I Can't Do Yet

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Stuff I Can't Do Yet
Warrior
Member # 1250
Profile #0
- Getting different choices in dialog boxes to do different things. I have a simple "Do you want to rest?" dialog set up, and both choices do the same thing. I'm not getting something, here.

- Getting dialog boxes to pop up when *looking* at things (indoors), i.e. getting special items out of chests. I'm not getting something, here.

- Getting dialog boxes to pop up outdoors when walking through an area. Wow. I can't believe I haven't figured this out, yet. I'm not getting something, here.

Does anyone notice a trend in my ignorance? The point is... I feel dwarfed by this. I've looked through the documentation (good stuff, just not what I need to know, all the time) and the appendices (invaluable for people who want to do real scripting). I'm still not certain if I'm just complaining here, or looking for some kind of commiseration... Let's go with that second one.

This is the self-declared "it's confusing" thread. Feel free to post things that have confounded/are still confounding you, or post some nice little tutorial advice to confused people, like myself.
Posts: 93 | Registered: Saturday, June 1 2002 07:00
Shock Trooper
Member # 4154
Profile #1
For the first thing: if you know how to set up a dialog (using the more complex setup than just with "message_dialog()") then you can do this. If not, then the instructions should tell you somewhere. Anyway. Set up the dialog with the text and the options. Make sure to define a variable by putting "short (name of variable);" between the customary "variables;" and "body" except without all the parenthesis and quotes and with "name of variable" replaced with the name of your variable.

It'll look like this: (if it's in a town)

begintownscript;
variables;

short choice;

body;

beginstate INIT_STATE;
break;


And so on with all the other states. Now you've defined the variable "choice".

After you set up the dialog, you'll put "choice = run_dialog(x);" where x is 0 or 1 depending on what you want (see appendices for run_dialog)

Now choice will the number of what option the player chose. Strangely enough, option 0 will make choice be 1, option 1 is 2, and 2 is 3.

Then you check for what they chose:

if (choice == 1) {
do first option }
if (choice == 2) {
do second option }
else {
do third option }


I apologize if this is confusing. My explanation is far worse than that which the docs have, but I hope it still helps.

For the second one: you need to use the script "specobj.txt" which you can find in VoDT's folder. It explains what to do in the script.

The third: just place a special on whichever spot you want the dialog to pop up on. Use message_dialog() in the state to do it.

[ Saturday, August 14, 2004 13:48: Message edited by: Eldiran ]

--------------------
You're a moron if you think I'm not.
Posts: 213 | Registered: Friday, March 26 2004 08:00
Off With Their Heads
Member # 4045
Profile Homepage #2
The docs are missing any sort of decent tutorial. The docs work well for people at two levels: knowing how everything works and just needing one or two details on a call, or people who know absolutely nothing whatsoever (and it's not even terribly good at the latter). There's no connection between the two levels of not knowing anything and knowing how to do everything. BoE-ers are lucky because we understand the concepts at work here, but anyone who's never touched the BoE Scenario Editor is at a serious disadvantage. There is no tutorial, no real intro beyond, "Hey, scripting works by calls, and you have to paint terrain in scenarios, too."

It frustrates the hell out of me, but I think we the community have to make this tutorial ourselves. If it doesn't get done by someone else in the next few months, I'll probably do it myself.

Everything will also be much easier when we have more BoA scenarios whose scripts we can examine.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Agent
Member # 2820
Profile #3
The chapter 1 Step by Step Scenario is one of the worst tutorials I have ever seen, but it can teach the absolute basics to someone who has never worked with the scenario editor and can get the BoA mentality into BoE designers. Side note: I have decided that I will buy BoA the moment a scenario is released that receives the generous praise of the general community. Hurry up guys!

[ Saturday, August 14, 2004 16:28: Message edited by: Garrison ]

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
Warrior
Member # 1250
Profile #4
Hmm... I've been doing just about what you recommended, Eldiran... I've got my variable (restchoice) declared, and I've got my if statements set up... I haven't got the brackets (though I know how they work; just haven't used them in this instance), and I've got an "end();" statement at the end of each if statement... Hmm. Wonder if that's giving me trouble. Probably, eh?
Posts: 93 | Registered: Saturday, June 1 2002 07:00
Infiltrator
Member # 3040
Profile #5
Yep, that's it. "end()" ends the state, not the if block. To end the if block, all you need is the closing bracket. What you're doing has the state ending at the end of the first if block.

--------------------
5.0.1.0.0.0.0.1.0...
Posts: 508 | Registered: Thursday, May 29 2003 07:00
Shock Trooper
Member # 4154
Profile #6
If you have any more trouble, just feel free to post the code and someone'll root through it.

--------------------
You're a moron if you think I'm not.
Posts: 213 | Registered: Friday, March 26 2004 08:00
Warrior
Member # 1250
Profile #7
All right... I got frustrated and deleted the two "choice" nodes in my town script... So I'm going to ask someone to put a tiny, rinky-dink little node code up here.

All I need to look at is the code. It can be totally generic, like the difference between printing two messages. I want to pick it apart so I know what in the world I was doing wrong with my code.
Posts: 93 | Registered: Saturday, June 1 2002 07:00
Off With Their Heads
Member # 4045
Profile Homepage #8
From VoDT, t0Fort Talrus.txt, a snippet of code that allows the player to rest, comments added by me:

beginstate 11;
reset_dialog();
add_dialog_str(0,"This is your room, a haven thoughtfully provided by the commander of Fort Talrus. It's dusty, but reasonable.",0);
add_dialog_str(1,"If you wish, you can take a quick rest before journeying onward.",0);
add_dialog_choice(0,"Leave.");
add_dialog_choice(1,"Rest for a few hours.");
choice = run_dialog(1); // This is the line that most people miss
// Note also that add_dialog_choice(1,"") corresponds to run_dialog being 2.
if (choice == 2) {
revive_party();
set_ticks_forward(100);
}
break;


[ Thursday, August 19, 2004 08:46: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Warrior
Member # 1250
Profile #9
Thank you. I haven't looked through that one yet, but I ought to have thought of digging around in the other scripts. I've looked at them before for stuff like how to format dialogue scripts, et cetera... I suppose I'm just getting a bit lazy, here. I just moved into college and I haven't been working on the scenario too much.
Posts: 93 | Registered: Saturday, June 1 2002 07:00