Home   Help Search Login Register  

Author Topic: Dialogue anyway to extract a $  (Read 1599 times)

0 Members and 1 Guest are viewing this topic.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Dialogue anyway to extract a $
« on: 13 Aug 2006, 11:19:26 »
Hi all and ty for any replies in advance.
 i am currently messing with ambience in ofp and would like to add some RPG ellements,
 so the question is ,whilst using dialogue,is there anyway that a string can be inputted and thus extracted.
 the only way i can explain is in vb lol sry.
 input,A$
 getA$
 if A$ ="Hello": goto "friendly.sqs"
 exit
 real sorry bout that,of course i know i can define strings in ofp such as
Code: [Select]
lads =["DeanosBeano"] 
 ? (name s1) in lads : s1 say "denocltake";exit
but other than the name player i cant find a way to create a string  by means of keyboard.
I love ofp

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Dialogue anyway to extract a $
« Reply #1 on: 13 Aug 2006, 11:42:45 »
there's a text-input control in dialogs which is what you need. everything should be explained in Vektorboson's dialog tutorial, available in the editors depot.

(hint: you're looking for RscEdit...)

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Dialogue anyway to extract a $
« Reply #2 on: 13 Aug 2006, 13:01:52 »
ah thanks i was using the dialogue maker and had not seen any ref to wha that does.
 ok i found the tut, but i think i became stuck :(.
this is the input
 
Code: [Select]
class MY_EDIT : RscEdit
  {
  idc = 104;
  x = 0.3;
  y = 0.3;
  w = 0.4;
  h = 0.04;
  };
};
this (the underlined piece) is the output)
Code: [Select]
class CLICK_ME : RscActiveText
  {
    idc = 101;
    style = ST_CENTER;
    x = 0.4;
    y = 0.65;
    w = 0.2;
    h = 0.05;
    text = "Klick Mich!";
    [u]action = "ctrlSetText [100, ctrlText 104]";[/u] <supposed to underlined but wudnt work :)
    default = true;
how can i subtract that ctrltext 104 and use it as a $,is it as simple as,(forgive my noobness here).
positiveansw=["Hello","HI","morning"]
A$= ctrlText 104
?(A$) in positiveansw:asker exec "friendlywelcome.sqs"
OR as usual am i way off the mark :) ?
Edit
i found this.
Quote
You may also read numerical values from a edit box if you "abuse" the foreach command:

_myValue = ctrlText _idc_com = format["tmp = %1", _myValue]_com foreach
  • _myValue = tmp

 

The numerical value is saved to _myValue. This way you even are able to read arrays from the edit box.
its a little out of my league ,can anyone explain how this would apply to my goal of retrieving the input ?
« Last Edit: 13 Aug 2006, 13:11:33 by DEANO »
I love ofp

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Dialogue anyway to extract a $
« Reply #3 on: 13 Aug 2006, 14:17:06 »
right then. what i would do is run a script from the button which accesses the dialog and gets the string value, along with anything else you need to do to the dialog.

i'll run up a mock dialog to show you what i mean.

edit - check attached missionette. activate the dialog using the radio. type in some text, then press continue. the text you type will replace the message. the script you want to look at is dialog_script.sqs.
« Last Edit: 13 Aug 2006, 14:28:06 by bedges »

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Dialogue anyway to extract a $
« Reply #4 on: 13 Aug 2006, 15:00:27 »
many thanks,i will go and do this now and edit this post with any questions,if you dont mind.
 however did we cope without ofpec ? it shudders the spine .

 EDIT: works like a treat ,you are a genius many thanks. will post a little vid of what i was trying to achieve later.
 
p.s @vektorbeson sorry for pm in bis forums then finding answer anyway, altho you have contributed anyway to a large degree with your tutorial ;).
Edit 2
 a quick video of where i am going with all this and destructablebuildings etc.
http://www.putfile.com/deanosbeano
checkout rpg alpha1
« Last Edit: 13 Aug 2006, 18:06:41 by DEANO »
I love ofp

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Dialogue anyway to extract a $
« Reply #5 on: 16 Aug 2006, 17:58:56 »
Hey again ,i thhought i would add this question here,because it is relevant i promise :).
 now ,i am making an RPG (role play). i have a dialog that pops up within a certain distance of a unit. but i want to know which unit the player is closest too, so i can dictate what parameters the player can use.
 that is, if he is near a woman from a certain town.her english is v.good.but if he is in a small village her english will be bad (thus learning the player a new language:)).
 so in laymans
   if nearestobject ? to player = vgoodenglish then blah
   "            "            "      "        = vbadeng        then blah diff

 how would i go about using the nearestobject ? or is there a simpler way staring me in the face ? ( iwant to use object cause, i need some ineraction with buildings later on).
  any help greatfully recieved .
        many thanks
               DB
I love ofp

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Dialogue anyway to extract a $
« Reply #6 on: 16 Aug 2006, 18:22:35 »
no need to use nearestobject. if it's a unit, the unit will have a name, so just use a distance comparison, using....

distance. also works with game logics if i recall correctly.

this is now no longer about dialogs, so if you need further help on another matter, post a new thread.