GithubHelp home page GithubHelp logo

"Tell me about" dialog function about fo1in2 HOT 65 CLOSED

Lexx2k avatar Lexx2k commented on August 25, 2024
"Tell me about" dialog function

from fo1in2.

Comments (65)

FakelsHub avatar FakelsHub commented on August 25, 2024 2

I'm curious, why exactly does it not work with other languages? Is it because some languages don't have lower/uppercase characters?

Something like this, the function simply does not know which characters are lowercase.
This is valid only for national characters, within the codes 128-255 ASCII

Well ok I'll add a function.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024 2

This bug appeared in the current dev version sfall.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024 1

I've added a _ as a typing indicator.

procedure do_up_ok begin
   ButPres := false;
   play_sfx(SoundR);
   if (input != "") then begin
      call ClearInputBox;
      Format("_", 200, 102, 240, 14, justifyleft);  <<<<<<<<<<<<<< ADD
      ShowWin; // redraw tellme interface
      call GenerateReply;
   end
end

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024 1

fucking button & fucking function!!!

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024 1

It seems that again I broke the dialog mode)
I'll fix it tomorrow.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024 1

I'll see in the engine what value is used for the width there.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024 1

Format("$" + dude_caps, 3, 36, 70, 15, justifycenter);
try replace width to 60
Format("$" + dude_caps, 3, 36, 60, 15, justifycenter);
or code to

text := "$" + dude_caps;
w := text_width(text);
if w > 60 then w := 60;
Format(text, 38 - (w / 2), 36, w, 15, justifyleft);

so is used in engine.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

I would not advise you make this feature. :-)
But if there is a desire, then its implementation lies entirely through the by sfall engine, need adding new functions for processing.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Yeah, we started reversing some Fallout stuff for it, but it's kinda stuck now. Not sure if it will ever happen, but who knows...
Technically it isn't really important. It's more a kind of "prestige feature."

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

I can add a function for inputing text from the keyboard, like this is the only engine function that is needed for this feature, the rest can be done through a script.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Anything that gets this a step closer would be awesome.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Current status: (Screenshot)

Remaining issues:
< Moved checklist to first post >

Obviously a real input box would be the way to go, but the garbage I cooked works for some early prototype testing.

The way of how the critter text source is chosen (either special defined critter or by current map) is crap as well... but works for now.
It would be better to put a variable / macro / array directly into the critter script talk_p_proc. This would give a lot more control over who's able to print what text message. It's a lot work, but would only need to be done once. After that it's highly flexible.

tl;dr - it doesn't look pretty but is a working prototype.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

It is possible to make the input text in your window in text box, the only problem is the script buttons Done and Cancel (when you input text they will not be processed by Enter and Esc).

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

(or rewrite all strings to uppercase in the .msg file directly, whatever is easier to do, I guess)

I will add a case-insensitive comparison function.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

the ok/cancel buttons on the input box fake will be moved to the background after clicking anywhere on the fake image.

You did not correctly create the buttons, they should be created for the current window, not for a separate window.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

You did not correctly create the buttons, they should be created for the current window, not for a separate window.

I did it like that before, but must have done something wrong, because the buttons didn't appear at all in that case. I'll investigate again.

/Edit: Ok, fixed the buttons.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Alright, latest commit fixes and tweaks some more stuff. Guess I'm pretty much at the end of my skills now. Everything else required to be done lies outside of my programming expertise.

What I could still do is changing how the reply data is fetched (setting variables or something in critter script talk_p_proc), but this is a lot work and I don't really see a reason to do that right now. Better to tweak/ rewrite this stuff once everything else is working and is ready to roll out.

PS: I noticed there is a bug with the barter button. When starting up the dialog screen, it won't switch between up/down images. The same happens with the buttons on the party member interface. Once the interface was switched at least once (e.g. going into barter screen and back to dialog) the buttons will work.
This seems to be a Fo2 bug, because I also noticed this in the RP.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

PS: I noticed there is a bug with the barter button. When starting up the dialog screen, it won't switch between up/down images.

this is a bug of the engine, I came to the conclusion that it is not necessary to fix it, as it will require code changes in many places.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

I noticed this for the first time now after all these years, so yeah, it isn't really important.

Also, I've added multiple keyword support now. That means we can have 100 replies, but unlimited keywords. Makes it already better than the Fo1 version. \o/

Maybe we could also add a variable return, so that we can check if a specific reply has been triggered. This way it could be possible to add in hidden or quest related stuff that triggers events.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

Maybe a new get_dialog_message?

Ок. get_last_reply

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Thanks.

I noticed an interesting issue with string_split(). If I press enter in my tma script which calls generate_reply, it works perfect, but if I press the ok button which calls the same procedure, string_split only returns 0 and thus none of the keywords will work. I have no idea why this is happening - it makes no sense to me.

Tried to workaround this with using tap_key(DIK_RETURN) in the button procedure, but this doesn't change things.

/Edit: I found out what the issue is. When using the ok-button, foreach doesn't work. It's not processed at all. Thus it can't compare keywords from the array and the variable returns 0.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Alright, thanks to your help, this feature is almost complete! :o

As far as I can tell right now, only one thing is left to do: We need to be able to convert string to uppercase, for easier comparison. For the generic keywords this isn't an issue, but sadly the name-related responses won't work:
input == obj_name(critter)
^ input will never be critter name, unless the name is written in all caps.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

I already wrote above that I will add a comparison function without case.
Also need to add a function that returns the width of the text and an additional game mode of the animation interface.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

Fixed the bottom right grey line with changing create_win("tellme_interface", (Scr_Width - 320), Scr_Height, 640, 190); << it was 641 before (on purpose?)

wanted to clarify once again. the fix to 640px doesn't cause for you to crash the game?

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

No crash. Works fine and looks perfect.

PS: I tried running DeleteWin("win_input"); before / after gdialog_mod_barter() in critter script, to get rid of the button, but this will fuck up the whole barter screen. No visible items, no buttons you can click on and if you press ESC, the barter screen remains in the background like a frozen image.

Seems like it is deleting more than just win_input in this case.

Not sure if we should bother with this right now, though. It's a minor thing and if you can add a new game_mode for the animation interface, it'll be fixed that way anyway.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

Unfortunately, we cannot add the case-insensitive text comparison function, as this will not work for text in languages other than English.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

How about a toggle button then (if language == eng, ger, etc. then ignore lower/uppercase)?

I understand the reasoning, but as it stands right now, there are no languages other than english for this mod, and considering the track record of Fallout mod translations, I'm highly pessimistic about there ever being more (maybe russian language some day in the future, I guess, but I kinda see this far away as well because it seems not many folks are really interested in this project).

The way TMA work right now / will work in the future, it'll require more than a simple search&replace of language strings. You'll have to go over everything and there's going to be a lot more that needs manual translations, further decreasing the chance of someone doing this seriously.

On the other hand, having case-sensitive keywords drastically limits the functions use.
Unless we scrap lower/uppercase letters again and rewrite every keyword in the .msg files to uppercase. From a visual point of way, I'm not too much a fan of that, though. Especially because this could be prevented with a simple turn_uppercase(string) function.

/Edit:
I'm curious, why exactly does it not work with other languages? Is it because some languages don't have lower/uppercase characters? In this case, wouldn't it be enough to just duplicate the letters (same for upper/lower format)? ... Or like I wrote in the beginning, just add a language check?

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Well ok I'll add a function.

Thanks!

The project is open source, so if there really will be another translation in the future, it shouldn't be a problem to adjust the scripts accordingly.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

string_compare works perfect. Thanks again.

get_text_width is a bit confusing, probably because I don't know how exactly width is calculated.
With checking for < 240, it seems to stop correctly when writing WWWWWWWW... but as soon as I write WWWWW...Wfff it fucks up and goes beyond 240px.

Regarding "using dialog options to enter the barter screen breaks the TMA function when returning to dialog mode." - maybe it's better to go back to my old "check if dialog_obj > 0" because then we are 100% sure that the player is in dialog at all times?

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

Regarding "using dialog options to enter the barter screen breaks the TMA function when returning to dialog mode."

I tested the script so I did not understand what the problem is, "Unset TMA data" it happens only when you leave/exit the dialogue.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Everything works when using the button on the interface. For me it happens as soon as I enter the barter mode via dialog option. This breaks TMA - either the button doesn't get created anymore, or clicking the button doesn't do anything (because the array is cleared).

I would make a video about it, but don't think I have software installed right now.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Here's a video of it in action:
https://www.youtube.com/watch?v=6FCJmVKRyY0&feature=youtu.be

PS: Another tiny issue that isn't very important but still exists. I've added a _ as a typing indicator. When pressing the backspace key, the input gets erased and _ appears. When using the ok-button, the input gets erased but _ does not appear. Do you have any idea how to fix that? I thought it might be related to the "critical" procedure again, but I couldn't figure it out for real.

/Edit: More info on the TMA bug. (\06hub\allnone.ssl)

procedure Merchant01 begin
   NMessage(106);
   gdialog_mod_barter(barter_mod_initial);
   call Merchant05;
end

^ this will cause the bug.

procedure Merchant01 begin
   gdialog_mod_barter(barter_mod_initial);
   NMessage(106);
   call Merchant05;
end

^ this will not cause the bug, but now the dialog order is fucked. I guess the NMessage() macro is making the game think player left the dialog even if he didn't.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

why do you testing the game without enabled debugging window?. Enable debugging and see what happens during the transition to barter mode.
give me your saving I did try.

PS: Another tiny issue that isn't very important but still exists. I've added a _

OK. I'll watch it.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

give me your saving I did try.

You just have to start a new game, teleport to Hub Downtown and talk to Mitch. Same happens to Mrs. Stapleton (here the TMA button doesn't even get created), as well as Beth.

The only merchant that worked so far is the one in Shady Sands east side (this is how I found out about the gdialog_mod_barter() above).

why do you testing the game without enabled debugging window?

I forgot to enable the debug messages before recording the video.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

I haven't played Fallout 1 in 20 years you want me to find a trader in Shady Sands it won't be an easy quest))

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

He is near the green exit grid. :>
His script is \02shady\barter.ssl

PS: Maybe you should replay Fallout 1. :p

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

I found it) Everything is OK with it when going into barter mode from the dialog and clicking the "Tell" button again. I'll record a video. (later)
Do add a check on dialog_obj if this is causing you a problem.
But it would be necessary to understand why you have such a problem, and I do not have it.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

I could swear I've tried exactly the same and it didn't work. Welp, it works now, so yay I guess.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

For me it happens as soon as I enter the barter mode via dialog option. This breaks TMA - either the button doesn't get created anymore, or clicking the button doesn't do anything (because the array is cleared).

Does anyone else have the same problem as you?

upd:
Does it work or not?

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Doesn't work for me after using the dialog option. I posted on NMA and asked others to check. So far no response, though.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

OK. wait response.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Did you recompile the script or test with the *.int from repo? Maybe it's a compiler settings issue?

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

Recompile in sfall script editor.
I tried disabling the -s option, but that also didn't cause me a problem.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Bug was confirmed by someone other than me:

Yes, I can confirm this bug, tested all three of the mentioned NPCs. Funny thing: When I tried Mitch, the TMA button at least had the click animation and sound. With the other two, the TMA button wasn't even clickable.

/Edit:
Here is what I think happens...

(\06hub\allnone.ssl)
procedure Merchant00 begin
   Reply(101);
   NOption(102, Merchant01, 4);
   ........
end

procedure Merchant01 begin
   NMessage(106);
   gdialog_mod_barter(barter_mod_initial);
   call Merchant05;
end
  1. Player takes the option to barter, which calls Merchant01.
  2. In Merchant01, NMessage(x) runs.
  3. Unlike Reply(x), NMessage(x) auto-generates a "[Done]"-dialog option.
  4. This [Done]-option tells the game to close the dialog window(!) -> Our script clears the arrays.
  5. BUT after closing the dialog, suddenly we trigger gdialog_mod_barter(x), which opens the barter interface.
  6. The barter interface opens.
  7. Returning to the dialog interface now makes the TMA-button unusable, because we cleared the arrays in step 4.

Possible solution:
Rewrite all merchant dialog to use Reply(x) + newly added dialog option instead of NMessage(x).

This isn't really a fix, though. Rewriting the scripts is actually a really bad workaround...
NMessage(x)/GMessage(x)/BMessage(x) gets used in many, many other scripts. It is almost everywhere in Fallout 1. So TMA will break in every script where this is used. :/

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

Paste this debugging code after this line and send a log.

tmp := get_sfall_arg;
debug_msg(”=========");
debug_msg(”p.mode:" + get_sfall_arg + "/" + prev_mode);
debug_msg(”mode:" + game_mode);

Make these steps enter and exit barter.

Upd: And add code to:

procedure Merchant01 begin
debug_msg(”Merchant01 node enter");
   NMessage(106);
debug_msg(”Merchant01 enter barter");
   gdialog_mod_barter(barter_mod_initial);
debug_msg(”Merchant01 ext barter");
   call Merchant05;
end

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Here is the debug.log file.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Thanks for the update. It's working now as intended. Couldn't find any other bug, so I'd say we can consider this ticket closed. 🥇

There is still one thing that annoys me - if you enter the barter interface and return to dialog, the $x caps number in the left window disappears. But this isn't on TMA, it's a default Fo2 thing.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Ok, I actually did find another issue with the TMA button.

If you talk to potential party members for the first time, the button gets created. If they now join your party, the button is still visible in the dialog -> party dialog transition. I'm assuming this isn't covered by the "SPECIAL" game_mode?

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

If they now join your party, the button is still visible in the dialog -> party dialog transition.

???
After joining there is an automatic exit from the dialog system.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Not in (all) Fo1 party members. :) Some end in another dialog option. Same if they (re-)join you.

Personally I never liked the auto-closing of the dialog, because if you want to change ai settings or weapons and armor, you'll have to "re-talk" to the critter.

I guess I will remove that. It's not like players would notice.
/Edit: Actually I just noticed it requires a bit more effort than just a simple "remove Reply(x)" :x

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

Yes I see a bug, the button is not removed during the animation on exit/join.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

It's working now. Thanks once more!

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024
  • Miles Power Armor dialog would prevent the creation of the TMA-button (dialog starts at Message(x) reply which seems to be the cause of problems again)

Again fucking button?

  • Also, why the hell is the player money counter changing it's position by 1px randomly? Changing it in gl_tma seems to work... for a while. Then at some point it stops and is shifted by 1px again. Seems like this only affects the money counter and nothing else.

Don't get hung up on little things.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Don't get hung up on little things.

The little things are what differentiates a simple mod from a professional project. :p
I'm wondering if this is happening due to disabled window rounding. It's interesting that it doesn't appear randomly after game start. Sometimes it works for hours and then out of nowhere it doesn't anymore. Weird.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

This is the alignment of the text in the center relative to the width of the text field.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

Does the width of the text field change dynamically? If not then I don't understand why it would change position at some point. I tested this in different dialogs once the "shifting" happens, and it was the same everywhere.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

The width of the field does not change, the width of the text changes from the amount money.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

You're right, this seems to be the issue. Ugh, annoying.
I mean, there's still a possible workaround... could make the window smaller again and keep showing the original money counter, then it for sure won't happen. I will think about how much this will annoy me.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

Perhaps you need to choose a different field width for the text (I didn’t do this, I just chose a guess value)

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

The second version works perfect, thanks once more! :>
Kinda weird how complicated BI made this, instead of just fixed width + center text.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

there is nothing complicated, the value 38 is the position by X.
X is the center.

from fo1in2.

wipe2238 avatar wipe2238 commented on August 25, 2024

Turns out TMA is throwing EXCEPTION_ACCESS_VIOLATION when game is running with debugger attached (and only then), at least when using x32dbg

From this line...


...game goes to deleteWindow_, and at 0x4b7927 tries to call dword ptr ds:[_deleteWindowFunc] (aka 0x00672D84, which at the time is just a bunch of zeroes)

It can be "fixed" with scripted BlockCall, which seems to work fine so far...

write_int( 0x4B7927, 0x90909090 );
write_short( 0x4B792B, 0x9090 );

...but i have no bloody idea will it lead to new bugs or not, and is it safe to commit.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

The problem is in the script, the window has already been deleted.
Make a checking of the deleted windows.

from fo1in2.

FakelsHub avatar FakelsHub commented on August 25, 2024

Checking for zeros in the engine is available.

from fo1in2.

Lexx2k avatar Lexx2k commented on August 25, 2024

I've added a new check, but I'm not sure if that's really the case here. delete_button always only gets called when tellme_button condition is true, so technically the window still exists.

from fo1in2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.