Seasoned Roamer Dyng Posted July 9, 2004 Share Posted July 9, 2004 Ok, so I'm gonna try this editing/scripting-your-own-adventure-thingy. However I don't want the Warrior's Grove, so I decided to make an own starting town (so far it's just dirt and a few walls). But I still want you to be able to end the scenario by walking out of the starting town (to the north). My question is: how do I do this? I scanned through the editor docs, but I could find no mention of how you'd do this, and it doesn't seem to be implemented in the editor (as with its opposite, the starting location). It's probably a real stupid question (and dead simple), but I'd appreciate all help I can get anyway... Link to comment Share on other sites More sharing options...
Kyshakk Koan Tristrana Posted July 9, 2004 Share Posted July 9, 2004 Don't know the exact script (I suck at coding in general, and am too lazy to really try to learn), but take a look at the town script that comes with the Warrior's Grove. The scripts that come with the package are a good read for a begginner, I've gathered. Link to comment Share on other sites More sharing options...
Kyshakk Koan PoD person Posted July 9, 2004 Share Posted July 9, 2004 Either do what he said, or open up the "t0forttalrus.txt" file in the Valley of Dying Things folder. Look for the states that pertain to leaving the scenario (somewhere around 19, IIRC). When it is checking an SDF, that is to see whether the party won or not. Look in the editor docs appendix. The call you need should be in the "most important calls section." Link to comment Share on other sites More sharing options...
Well-Actually War Trall Archmagus Micael Posted July 9, 2004 Share Posted July 9, 2004 Here's the codes: Code: end_scenario(0); This code means that you leave the scenario, but do not win it. Code: end_scenario(1); This code means that you end the scenario and win it. Link to comment Share on other sites More sharing options...
Seasoned Roamer Dyng Posted July 10, 2004 Author Share Posted July 10, 2004 I use the following script at the bottom of my town script: Code: beginstate 11; reset_dialog(); add_dialog_str(0,"Do you wish to leave the scenario already?",0); add_dialog_choice(0,"Keep Fighting"); add_dialog_choice(1,"Chicken Out"); choice = run_dialog(1); if (choice == 1) end(); if (choice == 2) set_state_continue(12);break;beginstate 12; end_scenario(0);break; This I more or less stole from Warrior's Grove. In town details I make exiting to the north call special state 11. However, when I run the scenario and enter the town (executing the town script) it says something about "unknown command choice". What have I missed? Link to comment Share on other sites More sharing options...
Hatchling Cockatrice Lilith Posted July 10, 2004 Share Posted July 10, 2004 Sounds like you forgot to define choice as a variable. Link to comment Share on other sites More sharing options...
Rotghroth Rhapsody Overwhelming Posted July 10, 2004 Share Posted July 10, 2004 Quote: Originally written by Dyng: Code: beginstate 11; reset_dialog(); add_dialog_str(0,"Do you wish to leave the scenario already?",0); add_dialog_choice(0,"Keep Fighting"); add_dialog_choice(1,"Chicken Out"); choice = run_dialog(1); if (choice == 1) end(); if (choice == 2) set_state_continue(12);break;beginstate 12; end_scenario(0);break; I didn't start reading about scripting, so I might be saying no-sense, but I noticed the following in your script:You give two choices (0 and 1)The "if choice" part refers to choices 1 and 2, instead of 0 and 1... It's just a mater of logic but, as I said, I know no scripting. So I'll let someone who knows to tell you. edit: I checked the VotDT script for fort talrus, and it's just like you have there, so i'm wrong... hummm... Link to comment Share on other sites More sharing options...
Well-Actually War Trall Archmagus Micael Posted July 10, 2004 Share Posted July 10, 2004 With langyages like this, 0 = 1, 1 = 2, 2 = 3, etc. So basically Choice 0 means Choice 1, And Choice 1 means Choice 2. Understand? - Magic and Technology are NOT a good mix Link to comment Share on other sites More sharing options...
Seasoned Roamer Dyng Posted July 10, 2004 Author Share Posted July 10, 2004 Quote: Originally written by Thuryl:Sounds like you forgot to define choice as a variable. =D Yup! That's very likely it. Thanks. (I'm feeling pretty stupid right now...) Link to comment Share on other sites More sharing options...
Garrulous Glaahk Crunchy Frog Posted July 11, 2004 Share Posted July 11, 2004 Overwhelming - Yeah, the numbering when you set up the buttons starts at 0, but the value you get back starts at 1. Jeff admits that was a pretty stupid thing for him to do; it was basically a rather large oversight. Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted July 11, 2004 Share Posted July 11, 2004 Archimage Micael (which is not much of an improvement over "archmagi," by the way -- there's no I in archmage), I know what you're trying say and even I had trouble understanding what you're saying. Long story short, Overwhelming, the code is right. Choosing dialog choice 0 makes run_dialog return 1, and choosing dialog choice 1 makes run_dialog return 2, and choosing dialog choice 2 makes run_dialog return 3. It's weird, but that's how it works. EDIT: Posted at the same time as Flamefiend. Link to comment Share on other sites More sharing options...
Garrulous Glaahk Isaac Posted July 11, 2004 Share Posted July 11, 2004 Quote: Originally written by Just Call Me Kel:Archimage Micael (which is not much of an improvement over "archmagi," by the way -- there's no I in archmage) My dictionary includes "Archimage" but not "Archmage". "Archimage" is quite correct; however, considering the way Spiderweb Software spells it, "Archmage" would be a better choice. Not that it matters. Link to comment Share on other sites More sharing options...
Seasoned Roamer Dyng Posted July 11, 2004 Author Share Posted July 11, 2004 Ok, follow-up question. That neat piece of script works just fine (I just forgot to declare the variable 'choice', I got too happy cutting and pasting), and I'm starting to get the hang of dialogue scripts. But now I've noticed that if I exit the town in qustion to the north (thus executing the end-scenario question-dialog-thingy) and choose not to exit the scenario the party really exits the town to the north. I don't want this to happen since this places the party outside my map. How do I correct this? That is: I want the party to stay in town should they choose to continue the scenario, thus making it impossible to exit the town to the north... Any ideas or suggestions? Link to comment Share on other sites More sharing options...
Garrulous Glaahk Isaac Posted July 11, 2004 Share Posted July 11, 2004 block_entry(1); Link to comment Share on other sites More sharing options...
Seasoned Roamer Dyng Posted July 11, 2004 Author Share Posted July 11, 2004 Where in the script does that go exactly? Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted July 11, 2004 Share Posted July 11, 2004 Right before the end call. So... Code: if (choice == 1)block_entry(1);end(); Link to comment Share on other sites More sharing options...
Garrulous Glaahk Crunchy Frog Posted July 12, 2004 Share Posted July 12, 2004 Not quite right, Kelandon. If you have more than one statement in your if(), then you need braces around them, like so: Code: if (choice == 1) { block_entry(1); end();} Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted July 12, 2004 Share Posted July 12, 2004 My bad. Honestly, I was thinking: Code: if (choice == 1) block_entry(1); and just delete the end call entirely. It doesn't really make that much of a difference. Link to comment Share on other sites More sharing options...
Recommended Posts