Home   Help Search Login Register  

Author Topic: Pass String to Data: Need Solution for CTRLText Command  (Read 2576 times)

0 Members and 1 Guest are viewing this topic.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Pass String to Data: Need Solution for CTRLText Command
« Reply #15 on: 05 May 2005, 00:23:31 »
Well, I'm no expert scripter but the link below is a little thing I was playing with earlier today.

Try it out and see what you think.......it isn't perfect but it traps most invalid input.


Planck
I know a little about a lot, and a lot about a little.

Offline Kundich

  • Members
  • *
  • "Habit is the daily battleground of character."
Re:Pass String to Data: Need Solution for CTRLText Command
« Reply #16 on: 05 May 2005, 02:13:47 »
The coding looks so simple.  Why couldn't I come up with something like that?  Ought to work nicely.  I will check it out and let you know.  Only one thing, though.  You've got:

_dir2 foreach


I don' t actually know why that's in there.  I mean, I understand the forEach command, but I don't get how it's being used there.  Is it a reference to PLAYER id?

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Pass String to Data: Need Solution for CTRLText Command
« Reply #17 on: 05 May 2005, 19:54:33 »
I have only looked at the script, not run the mission.  What happens if the player enters: I am a burk  or sadferfgud  or any other non-numeric character?

I suppose you could crudely simulate an azimuth wheel by placing a lot of small buttons in a circle

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Pass String to Data: Need Solution for CTRLText Command
« Reply #18 on: 05 May 2005, 20:03:27 »
It is only a very simple check for valid input.

It will detect if the input is less than 0 or greater than 360.

If you enter 'I am a burk', then it will pop the hint 'Invalid Input'.

If you enter '2I am a burk' it will still pop the hint, but, it will also produce a script error message.

In short, if the first element is a number followed by an alphabetic then a script error will appear as well as the hint.

If the first element is an alphabetic then it will pop the hint and there will be no script error message.


Planck
I know a little about a lot, and a lot about a little.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Pass String to Data: Need Solution for CTRLText Command
« Reply #19 on: 05 May 2005, 21:47:23 »
I hate having to give a user a text field to input - you just have no idea what they will think of putting in it.

35 degrees please.

Has anyone got time to create an azimuth wheel? - I think one with 720 buttons might be quite usable
« Last Edit: 05 May 2005, 22:16:19 by THobson »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Pass String to Data: Need Solution for CTRLText Command
« Reply #20 on: 05 May 2005, 21:57:52 »
Hmmmmmm..............I wonder if using a horizontal or vertical slider would work?

Then again the result would probably still be a string.


Planck
« Last Edit: 05 May 2005, 21:58:17 by Planck »
I know a little about a lot, and a lot about a little.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Pass String to Data: Need Solution for CTRLText Command
« Reply #21 on: 05 May 2005, 22:17:08 »
I have not use sliders yet - if they return a string at least it will be a predictable srting.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Pass String to Data: Need Solution for CTRLText Command
« Reply #22 on: 05 May 2005, 22:21:20 »
I think I might have a play with this tomorrow   ;D ;D


Planck
I know a little about a lot, and a lot about a little.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Pass String to Data: Need Solution for CTRLText Command
« Reply #23 on: 05 May 2005, 22:46:45 »
I will be in the office :'( :'(
« Last Edit: 05 May 2005, 22:46:57 by THobson »

Offline Kundich

  • Members
  • *
  • "Habit is the daily battleground of character."
Re:Pass String to Data: Need Solution for CTRLText Command
« Reply #24 on: 06 May 2005, 01:21:00 »
Even if the sliders return a string, we should be able to convert it to data as with the CALL command, right?  Actually, I suspect the slider will only return a string if you set the value of the slider's data to be a string, but then again I'm shooting from the hip on this one.

And Thobson, I will be in the office also.  TGIF, right?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Pass String to Data: Need Solution for CTRLText Command
« Reply #25 on: 06 May 2005, 19:26:21 »
Ok, I made another little dialog which uses the horizontal slider.

Try it out and see if it is what you need.

The dialog is not started from the players init field with this one, you can start the dialog from the action menu.......repeatedly.

EDIT:  I'm getting forgetful in my young age.

Clicking on the arrows on either end of the slider will increase/decrease the bearing by 1, clicking on the scale portion of the slider will increase/decrease the bearing by 10.

Sliding the slider itself will increase the bearing more rapidly, but also introduces a decimal portion to the bearing....under 100 you get a number to 4 decimal places......over 100 it is reduced to 3 decimal places.



Planck
« Last Edit: 06 May 2005, 21:07:49 by Planck »
I know a little about a lot, and a lot about a little.

Offline Kundich

  • Members
  • *
  • "Habit is the daily battleground of character."
Re:Pass String to Data: Need Solution for CTRLText Command
« Reply #26 on: 09 May 2005, 16:07:57 »
Planck, I will check this sucker out and let you know how it works.


Thanks,
ADM