Stupid Question
Author | Topic: Stupid Question |
---|---|
Agent
Member # 27
|
written Saturday, June 24 2006 17:38
Profile
Where can I get the coordinates of a space, besides counting the squares in the editor. I use a PC, if that makes any sort of difference. Posts: 1233 | Registered: Wednesday, October 3 2001 07:00 |
? Man, ? Amazing
Member # 5755
|
written Saturday, June 24 2006 17:50
Profile
The 3D editor puts the x,y coordinates of the center point in the editing window, right below all the icons. *checks* It is the third line from the bottom in the lower right corner. Also, Kel made a special ability in that shows the coordinates in-game. -------------------- quote: Posts: 4114 | Registered: Monday, April 25 2005 07:00 |
Agent
Member # 27
|
written Sunday, June 25 2006 12:01
Profile
New question: Here is some scripting I wrote for my practice scenario. It works, but for some reason keeps reactivating. What I mean is, when you pull the lever for the first and what should be only time, everything works. But when you step on the lever again you get the message quote:Nothing else happens. The demon doesn't spawn, the sound effect doesn't go off, nothing. But the message comes up every time you walk over the lever. Here is my code: To keep my question simple, WTF? Posts: 1233 | Registered: Wednesday, October 3 2001 07:00 |
The Establishment
Member # 6
|
written Sunday, June 25 2006 12:22
Profile
Just curious on a couple things: 1) Why don't you enclose the second half of state 12 into the first, i.e. nest the second conditional in with the first, that way it never gets seen if 2,3 is > 0. 2) Why are two seperate states required. It seems like the flag 3,3 is used unnecessarily. This is, of course, assuming you have shown us all that relates to this encounter. 3) I usually put the result of run_dialog() in another variable, typically called "choice". I don't think it matters, but I've had weird things with dialog at times. [ Sunday, June 25, 2006 12:22: Message edited by: *i ] -------------------- Your flower power is no match for my glower power! Posts: 3726 | Registered: Tuesday, September 18 2001 07:00 |
Apprentice
Member # 7216
|
written Sunday, June 25 2006 13:29
Profile
If you use the original specobj script for the lever, memory cells 2 and 3 are the coordinates of a flag that, when set to 1, prevent the event from happening. So... set mem cell 2 =2 and mem cell 3 = 3 to prevent the lever from being used again. EDIT: flag (3,3) does seem to be unnecessary to this section of script. [ Sunday, June 25, 2006 13:32: Message edited by: Green Apple ] -------------------- Apple.elqqA Posts: 18 | Registered: Monday, June 12 2006 07:00 |
Agent
Member # 27
|
written Sunday, June 25 2006 14:03
Profile
This worked. I combined them together like you said, and the message dialog wouldn't continue to show up every subsequent time I stepped on the lever. quote:It's little important facts like these I wish were put in big bold letters somewhere easy to find. Question: I set the memory cells on the lever to my SDF. Does this mean I dont have to use the call set_flag(2,3,1)? Edit: And because I used the specobj script on the lever, do I not have to place special encounter over it? [ Sunday, June 25, 2006 14:07: Message edited by: Enraged Slith ] Posts: 1233 | Registered: Wednesday, October 3 2001 07:00 |
Apprentice
Member # 7216
|
written Sunday, June 25 2006 14:26
Profile
The documentation is confusing, isn't it. If I was an old member who'd been here for years, I'd probably post a link to some site that explains it all perfectly. I'm pretty sure that you do need to use the set_flag call- the mem cells are only used to say which flag prevents the event, not which flag to set to 1-you'd need to write your own object script for that. I'm also sure that you don't need a special encounter. If I'm wrong, please tell me. :) -------------------- Apple.elqqA Posts: 18 | Registered: Monday, June 12 2006 07:00 |
Law Bringer
Member # 4153
|
written Sunday, June 25 2006 18:44
Profile
Homepage
Okay, if you use a specobj script, you don't need a special encounter on the lever's space. As for the code itself, I see issues. (see comment) quote:What was the line "run_dialog(0) == 2;" intended to do? Because in here, all it will do is run the dialogue box, without taking the player's input. -------------------- Gamble with Gaea, and she eats your dice. I hate undead. I really, really, really, really hate undead. With a passion. Posts: 4130 | Registered: Friday, March 26 2004 08:00 |
Agent
Member # 27
|
written Sunday, June 25 2006 20:00
Profile
Maybe it's just because I've just started but the run_dialog() instructions seemed very vague to me. I spent a lot of time trying to make sense of them, but the closer I thought I knew what they did, the less I actually understood. Could someone clarify this call's function for me? Posts: 1233 | Registered: Wednesday, October 3 2001 07:00 |
Law Bringer
Member # 4153
|
written Sunday, June 25 2006 20:41
Profile
Homepage
run_dialog() runs the dialog that has been constructed by using the add_dialog_string(), add_dialog_choice(), and all the preset dialog functions. If you put a 1 in the parentheses, the "record" button will appear when the dialog is displayed, a zero will omit the button. As for what the function returns, if there's only one choice (say, "Okay."), the function will just return a 1, since that's the number of the choice. For more than one choice, it will return different numbers depending on what choice the player picks. Say I've got this set up: "Pointless drivel" will appear with the choices and a Record button. If the player picks "Fish", run_dialog() will return a '1', thus making choice equal to 1. (Note, the function returns a number one higher than the number given in add_dialog_choice().) If the player picks "pi", then the function returns a 2. I hope that cleared things up. Class is dismissed. -------------------- Gamble with Gaea, and she eats your dice. I hate undead. I really, really, really, really hate undead. With a passion. Posts: 4130 | Registered: Friday, March 26 2004 08:00 |
Agent
Member # 27
|
written Monday, June 26 2006 14:51
Profile
Thanks for clearing up the function of run_dialog(), however, one thing about it still bugs me. The phrase "choice = run_dialog(1);". What is the function of choice = and why change the variable from '0' in the first place? Wouldn't saying choice = run_dialog(1) be the same as saying 0 = run_dialog(1)? So what would 0 = run_dialog() mean? Isn't '0' preset to false? And when writing the next part of the script Wouldn't that basically be saying if (FALSE)? I'm running on low sleep and this problem is driving me crazy. Please clarify. A less involved question: What exactly is the function of 'end()' and when would it be used? Posts: 1233 | Registered: Wednesday, October 3 2001 07:00 |
Off With Their Heads
Member # 4045
|
written Monday, June 26 2006 17:13
Profile
Homepage
The idea is that "choice = run_dialog(1)" sets the variable "choice" to whatever the value of run_dialog is. It's like saying "choice = 1" or "choice = 2" or whatever. (You work right to left, so BoA turns the run_dialog into a number and then sets choice to that number.) So "choice" starts out as 0 in the beginning of the script — this is unnecessary; you could take it out and just say "short choice;" — and then it gets set to whatever the run_dialog returned (either 1 or 2, depending on what the player chose). That way, when you run your "if" business, the "choice" variable is either 1 or 2. And "end" is used when you want everything to stop right away. I have an example of this in an article — "end" is under One-Shot Specials. [ Monday, June 26, 2006 17:18: 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 |
The Establishment
Member # 6
|
written Monday, June 26 2006 17:21
Profile
quote:The variable 'choice' is a placeholder variable and useful as it is more or less fixed until changed or entering a new area. Run dialog is a specific function that does two things: 1) It brings up the dialogue message allowing the player to see it and choose. 2) It returns the choice that the player gave. Note that run_dialog() does not have an intrinsic value in itself...it is a function, not a variable. I'd suggest assigning first and not putting run_dialog() in a logical test as it may or may not get evaluated depending on the order of operations and the coding Jeff used on how the boolean statements are evaluated. In other words, if one of the conditions is determined false in an AND construct, it could just skip evaluating the other because it "knows" the entire statement is false. In such case, the player would see no message at all. Of course, the coding could have that all values are checked regardless of the logic meaning this would not be the case. '0' is an integer value and not generally the same as false. For a boolean or logical type variable, 0 may mean false in some languages. However, 0 and false should not be equated as the same. In your case, 'choice' is an integer variable so that the meaning of 0 is indeed the number zero, not false. 0 = run_dialog() would mean that you are attempted to reassign the integer value of zero, which is not allowed. Assignment is done with the variable to be operated on on the left -- don't confuse assignment equals with the mathematical equals, there is a subtle difference that I just pointed out. -------------------- Your flower power is no match for my glower power! Posts: 3726 | Registered: Tuesday, September 18 2001 07:00 |
Off With Their Heads
Member # 4045
|
written Monday, June 26 2006 17:25
Profile
Homepage
quote:I think, in this case, he's okay. I usually put run_dialog in an "if" phrase unless I have three options to choose among, and it's safe as long as the run_dialog is in the first condition, I believe. The reason, apparently, is that BoA reads right-to-left inside expressions but left-to-right outside them. Or something. :rolleyes: [ Monday, June 26, 2006 17:27: 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 |
Agent
Member # 27
|
written Tuesday, June 27 2006 08:53
Profile
Thank you, that cleared a lot of things up. Is this more or less what it should look like now? Note that I set 'choice' as a variable earlier in the town script. Edit: And yes I did read the one-shot specials section, but I'm going to stay away from 'end()'for the time being until I get a better handle on scripting. [ Tuesday, June 27, 2006 08:58: Message edited by: Enraged Slith ] Posts: 1233 | Registered: Wednesday, October 3 2001 07:00 |
Off With Their Heads
Member # 4045
|
written Tuesday, June 27 2006 10:10
Profile
Homepage
You also have to run the effect. Stick a run_animation or run_animation_sound at the end, perhaps after you've placed the monster. By the way, if you place the monster first and use a hidden group (which I always prefer over place_monster whenever possible, for a variety of reasons), you can use put_effect_on_char instead of specifying the space. -------------------- 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 # 6682
|
written Wednesday, June 28 2006 08:54
Profile
This thread is useful for newbies like me... -------------------- Lancer Posts: 73 | Registered: Friday, January 13 2006 08:00 |
The Establishment
Member # 6
|
written Wednesday, June 28 2006 13:51
Profile
Glad to see it's of use. At some point, we should archive some of the more useful discussions. Unfortunately, I really don't have time, but an ambitious person would definitely be appreciated. -------------------- Your flower power is no match for my glower power! Posts: 3726 | Registered: Tuesday, September 18 2001 07:00 |
Agent
Member # 27
|
written Friday, June 30 2006 07:30
Profile
New question: I am designing a practice town with a lot of puzzles, SDFs, and combinations. I am trying to make an altar that kills a character of your choice if he doesn't have enough (stat). Please help me fill in this code (or fix whatever I screwed up). Edit: Mainly I want you to correct any large errors and fill in what I need at the top. I've already found most of the small errors and typos. [ Friday, June 30, 2006 08:00: Message edited by: Enraged Slith ] Posts: 1233 | Registered: Wednesday, October 3 2001 07:00 |
Infiltrator
Member # 5576
|
written Friday, June 30 2006 08:24
Profile
Homepage
ME is a reserved constant, defined equal to -1, except when running a creature (or terrain? I can't remember.) script. You need a different variable name I think. Also, you can get the selected pc with a get_selected_char() call. Or, you can ask the player to selecta pc with run_select_a_pc() and get_selected_pc(). It might also be a nice touch to alter the strings so that the player is asked "Do you want [name of selected character] to rest on the alter?" and so forth. You can do this with the string manipulation calls without too much trouble. -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
Off With Their Heads
Member # 4045
|
written Friday, June 30 2006 10:18
Profile
Homepage
The call run_dialog needs arguments (probably the number "1"). You don't need the "end" calls. As Niemand indicated, you'll need a real variable, not ME. I'd go with something like this at the top (much like what Niemand described): Within the "else" part, you can put the rest of your code, and instead of ME, use get_selected_pc(). -------------------- 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 # 27
|
written Tuesday, July 11 2006 10:39
Profile
New question, sort of. I looked back over this town script and figured out why I was having trouble with a certain state. However, I can not think of a different way to write it out. Basically this is what I have written: The problem here was that when your character selected the second choice, the first choice ELSE message would play, and then the second message would play. I know now that ELSE is called whenever the IF requirements are not met. How can I make it so that Choice 1 has two possible outcomes while Choice 2 is also a possible outcome. Posts: 1233 | Registered: Wednesday, October 3 2001 07:00 |
Infiltrator
Member # 5576
|
written Tuesday, July 11 2006 12:25
Profile
Homepage
What you want is: The problem was that you combined two conditions into one if statement, so that the else block occurred if either was false, when you wanted it to occur when only a specific one was false. EDIT: How did I mispell 'that' as 'htta'? [ Tuesday, July 11, 2006 12:30: Message edited by: Niemand ] -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
Lifecrafter
Member # 6193
|
written Tuesday, July 11 2006 12:32
Profile
Homepage
quote:You need brackets after the if(choice == 1). Edit: Note to self, don't use tab when posting. [ Tuesday, July 11, 2006 12:37: Message edited by: Lazarus. ] -------------------- Guaranteed to blow your mind. Frostbite: Get It While It's...... Hot? Posts: 900 | Registered: Monday, August 8 2005 07:00 |