Jump to content
The Dark Mod Forums

GUI - Creating guicode for login screen


freyk

Recommended Posts

As you maybe know, I am working on several GUIs for a scifi fm for the dark mod.

At this moment I am working on a loginscreen.

I would like that the player input is a word-string, instead of numbers.

 

So I would like to find a way to compare strings.

Is there a way to compare a string using an if-statement, instead of using a float (or a gui_param)?

Or do i have to use a script? please give an example.

Or do i just have to use numbers, floats and gui_param?

 

code in the spoiler

 

 

//define password
#define LS_pwd "freyk"

//editdef for entering password
editDef ePassword
{
rect	137,50,123,18
visible	1
text	""
textscale	0.2
backcolor	1,1,1,1
shadow		1
hovercolor	0,0,0,1
}

//button to check.
windowDef btnLogin
{
rect	212,72,48,21
visible	1
bordersize	1
bordercolor	0,0.25098041,0,1
forecolor	1,1,1,1
text	"Login"
textscale	0.2
textalign	1
backcolor	0.50196081,0.50196081,0.50196081,1

onAction {
if ("ePassword::text" == LS_pwd ) { 
set "iFirmLogo::text" "ok" ;
} else {
set "iFirmLogo::text" "error" ;
}
}

}
}

 

Edited by freyk

Info: My portfolio and darkmod graphical installer
Amnesty for Bikerdude!

Link to comment
Share on other sites

I guess you will need a script for this, as the gui does not provide a native implementation for this feature. I could take a look at this (if I don't forget it :) ).

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

So I have taken a look at it. It is possible to run a script when the OK button is pressed to compare the input to the desired password. The problem is that you can't use your keyboard to directly type the password. Unfortunately I haven't found a way to bypass this. It is possible in the menu (see savegame name field for example) and you can type if you call the gui via testgui, but it seems not possible ingame. :(

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Thanks for looking in to it.

 

I have not tested the gui ingame and not tested the keyboardinput correctly.

So i did not noticed that the keyboardinput not work. because the keys are used for playermovement.

Is there a way to disable them using a script?

And how does a script that compares editdef-text looks like?

 

As a workarounds

  • I can create a touchkeyboard, but touching in the credentials will take long.
  • i can display the logininterface fullscreen (like the ingame mainmenu),
    but then the player loses the ingame atmosphere. (when like reading letters in Thief 1 til 3)

Or use two nummeric editdefs, 1 for the username and 1 for the password.

Edited by freyk

Info: My portfolio and darkmod graphical installer
Amnesty for Bikerdude!

Link to comment
Share on other sites

Touchkeyboard is fine. Fullscreen is not needed.

 

The text gets written to a gui parameter which can be accessed via script. Comparision is done using the script. If you need a demo I can set it up for you.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 4 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...