Home   Help Search Login Register  

Author Topic: Create stuff at runtime from user input  (Read 1053 times)

0 Members and 1 Guest are viewing this topic.

Offline Wheelz456

  • Members
  • *
  • I'm a llama!
Create stuff at runtime from user input
« on: 03 Jan 2010, 10:41:10 »
Hi guys, been awhile.

Maybe you could give some advise, In run time id like the user to input data in some form of input textbox. then use that data to create the unit requested.

eg.
User ask for: Lieutenant, soldier, at marker g4,Named - e7 etc...

userdata$ = ["Text from user,,,,"]
userdata$  createunit [getpos g4, east2, "e7 = this", 1, "LIEUTENANT"]

i know the above will not work it's only an example..
mind the syntax

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Create stuff at runtime from user input
« Reply #1 on: 03 Jan 2010, 12:53:04 »
Sounds like you'll need to use dialogs.

I don't think free-text fields exist in dialogs. What you'd need is a series of pre-defined drop-down menus for unit type, rank, group, etc.

I'd recommend a series of pre-defined drop-down menus for unit type, rank, group, etc. to avoid spelling mistakes...

I did this (to a certain extent) in DTools, feel free to de-pbo it and take a look.
« Last Edit: 03 Jan 2010, 17:19:13 by bedges »

Offline Wheelz456

  • Members
  • *
  • I'm a llama!
Re: Create stuff at runtime from user input
« Reply #2 on: 03 Jan 2010, 14:48:59 »
Sorry for time waster, solved my problem.
I have to create a dialog with input box and use the string to create my unit.
the problem was Createunit, camcreate, createvehicle, need to use the correct one with sliders.
eg. to create a bmp from user input:

user input is "Bmp"
; use the text from the control idc - 100 (user input) in the dialog menu
_myValue = ctrlText 100

use the slider control to determine type of object eg. vehicle, unit or object etc...

; Assign the text to a variable, createvehicle for vehicle, creatunit for units and camcreate for objects etc....
Newunit = _myValue createvehicle getpos B1

this is now usefull in the following scenario:

i have loaded hundreds of addons eg. weapons, tanks, units etc.
now by knowing the name i can spawn any of my addons straight at runtime, very handy for me.
I can play with all my vehicles (addons) without adding each of them in the editor.

MP beware...

Tnx anyway...
« Last Edit: 03 Jan 2010, 14:55:29 by Wheelz456 »