Home   Help Search Login Register  

Author Topic: READ this - VERY interesting. Need help with it.  (Read 1307 times)

0 Members and 1 Guest are viewing this topic.

GodHatesUsAll

  • Guest
READ this - VERY interesting. Need help with it.
« on: 18 Apr 2003, 10:02:15 »
Alright.

I just played an MP mission which had a custom weapon and ammo selection screen thing.

Now, you had a certain amount of ammo/equipment slots, and you had to assign your ammo/equipment wisely to each slot, as there were a limited amount of slots.

Well, what i need is a similar interface for my mission.

But, what id like is to have a skill point/money/weapon buying system. I know this is possible, but i dont know how to do it.

For example:

This is a Single Player mission BTW. Anyway:

You start the mission off with a Glock, and very poor aiming, health, endurance and a small amount of ammo.

Now, this is a hosatge rescue mission, so for example you save hostage 1 in under 2 mins, then you earn $100, 5 skill points and 2 equipment slots.

Next time round you save him in under 1 minute, so you get awarded skillpoints/cash/slots accordingly to the time in which you did this.

And as you accumulate more points/money/slots you can upgrade you character mid-game, or next time you play.

For example:

Upgradeable Skills Are:

*Aiming
*Endurance/Health
*Stealth

How will the Stealth work? Well, as you upgrade your Stealth, enemy awareness is lowered, therefor giving the effect of you being more stealthy.

How will aiming work? By lowering setdammage.

How will Health/Endurance work? Same as above.

Now, with cash you earn, you can buy guns, ammo, equipment, weapon upgrades.

How can there be upgrades? Simple. The XM Aussault rifle has no scope. But there is a version of it WITH a scope. So if you upgrade, youre really getting the XMS.

The Glock standardly has no silencer, but there is one availiable.

Slots. More slots you earn, more stuff you can carry around.

Now heres the biggest question of all:

Is it possible that the mission can save player Stats?

So if you finish it once, you can go back and play it again to earn more things, therefor giving extra replayability. For example, all the guns/points/slots wont be availiable first time you play, but the more you play, the more you earn stuff, and can try the mission different ways.

I also want to have it so you can buy Save's.

I know that it is all possible (apart from the last questiom, which i have no idea if its possible).

I have already finished the mission. It was actually completed a while ago (its called Davidian). But now that OFP has more functions availiable, i want to incorporate them into this great mission, to make it unique and more fun to play.

Thanks. I hope someone will take the time to help me.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:READ this - VERY interesting. Need help with it.
« Reply #1 on: 18 Apr 2003, 11:27:54 »
Do you want others to do the work for you, or do you
want to know how to do that?

If you wanna know how to do that then i'd suggest you to
read, read, read AND read thru the forums/tutorials then
try, try, try AND try again, until you got all together what you
need. If you encounter any problems in there ask at the forums.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

GodHatesUsAll

  • Guest
Re:READ this - VERY interesting. Need help with it.
« Reply #2 on: 18 Apr 2003, 13:11:20 »
Both.

In a way....

The best way would be if there was a template of the interface, with detailed, but EASY to read instructions on what each function does, and waht you can replace with your own custom stuff.

That would be cool.

It would also be hepful if people on the forum could give give me examples of code snippets, and explanations on how to set it up.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:READ this - VERY interesting. Need help with it.
« Reply #3 on: 18 Apr 2003, 16:07:23 »
Why don't you just ask the creator of the interface if you can borrow it?    As long as you give them proper credit its unlikely that they will mind.

And in any event you should un-pbo the mission and see how it worked.

If you want examples of code snippets with explanations then I suggest you start reading some tutorials.   I would guess that there are several dozen tutes which have some kind of scripting in them, with explanations.

There are I don't know how many scripts in the Snippets section of the Ed Depot, most have an explanation of how they work.

Just get stuck in. ;)
Plenty of reviewed ArmA missions for you to play

GodHatesUsAll

  • Guest
Re:READ this - VERY interesting. Need help with it.
« Reply #4 on: 18 Apr 2003, 16:34:04 »
I dont know who made that mission. My computer crashes whenever i play MP, when the action heats up a litte. I shot a shilka with an RPG and my Pc crashed.  >:(

Anyway..

I have Vektorbosons Tutorial.

Ive learnt how to change what the text says, and change colour schemes.

His tutorial is very advanced for me, but i figured out the basics.

What id like to know is this:

A dialog box pops up, and it comprises of a Close Button, Drop Down Menu and a Select Button.

Now say i click on "Stealth" in the drop down menu, then click the select Button, how do i make a second Dialog box pop up, called "Stealth"?

Also, the stealth box has a Slider, and you can slide it up to a number of 10, then click the "Select" button.

Say i slide it to 3, then click select, how can i make it execute a script called.... stealth3.sqs?

And have a script for each different number selected? (equalling 10 scripts)

Thats all i need to know for NOW.

EDIT:

How do i chuck text from one description.ext to the other without ofp crashing? Same with CreatDialog.sqs?

Heres Description.ext 1:

Code: [Select]
#define FontM "tahomaB36"
#define FontHTML "CourierNewB64"

#define ST_LEFT       0
#define ST_RIGHT      1
#define ST_CENTER     2
#define ST_FRAME      64

#define CT_STATIC     0
#define CT_BUTTON     1
#define CT_EDIT       2
#define CT_COMBO      4
#define CT_LISTBOX    5
#define CT_ACTIVETEXT 11

class RscText
{
        type = CT_STATIC;
        idc = -1;
        style = ST_LEFT;
        colorBackground[] = {1, 1, 1, 0};
        colorText[] = {1, 0, 0, 0};
        font = FontM;
        sizeEx = 0.04;
};

class RscActiveText
{
      type = CT_ACTIVETEXT;
      idc = -1;
      style = ST_LEFT;
        color[] = {1, 1, 1, 1};
        colorActive[] = {1, 0, 0, 1};
        font = FontM;
        sizeEx = 0.04;
        soundEnter[] = {"ui\ui_over", 0.2, 1};
        soundPush[] = {, 0.2, 1};
        soundClick[] = {"ui\ui_ok", 0.2, 1};
        soundEscape[] = {"ui\ui_cc", 0.2, 1};
        default = false;
};

class RscButton
{
        type = CT_BUTTON;
        idc = -1;
        style = ST_CENTER;
        colorText[] = {1, 0, 0, 1};
        font = FontHTML;
        sizeEx = 0.025;
        soundPush[] = {, 0.2, 1};
        soundClick[] = {"ui\ui_ok", 0.2, 1};
        soundEscape[] = {"ui\ui_cc", 0.2, 1};
        default = false;
};

class RscEdit
{
       type = CT_EDIT;
       idc = -1;
       style = ST_LEFT;
       font = FontHTML;
       sizeEx = 0.02;
       colorText[] = {1, 0, 0, 1};
       colorSelection[] = {1, 1, 1, 1};
       autocomplete = false;
       text = ;
};

class RscLB_C
{
        style = ST_LEFT;
        idc = -1;
        colorSelect[] = {0, 0, 0, 1};
        colorSelectBackground[] = {1, 1, 1, 1};
        colorText[] = {1, 0, 0, 1};
        colorBackground[] = {0, 0, 0, 1};
        font = FontHTML;
        sizeEx = 0.025;
        rowHeight = 0.04;
};

class RscListBox : RscLB_C
{
        type = CT_LISTBOX;
};

class RscCombo : RscLB_C
{
        type = CT_COMBO;
        wholeHeight = 0.3;
};

class Main
{
  idd = -1;
  movingEnable = true;
  controlsBackground[] = { MY_BACKGROUND, MY_FRAME };
  class MY_BACKGROUND : RscText
  {
     colorBackground[] = {0, 0, 0, 1};
     text = ;
     x = 0.2;
     y = 0.1;
     w = 0.6;
     h = 0.7;
  };
  class MY_FRAME : RscText
  {
      idc = 103;
      style = ST_FRAME;
     colorText[] = {1, 0, 0, 1};
     text = "Character Setup";
     font = FontHTML;
     sizeEx = 0.025;
     x = 0.22;
     y = 0.12;
     w = 0.56;
     h = 0.66;
  };
  objects[] = { };
  controls[] = { HELLO_WORLD, CLICK_ME, MY_BUTTON, MY_LIST };
  class HELLO_WORLD : RscText
  {
    idc = 100;
    style = ST_CENTER;
    x = 0.4;
    y = 0.45;
    w = 0.2;
    h = 0.1;
    text = "Weapon Select";
  };
  class CLICK_ME : RscActiveText
  {
    idc = 101;
    style = ST_CENTER;
    x = 0.4;
    y = 0.65;
    w = 0.2;
    h = 0.05;
    text = "Click To Select";
    action = "ctrlSetText [100, lbData[104, lbCurSel 104]]";
    default = true;
  };
  class MY_BUTTON : RscButton
  {
     idc = 102;
     x = 0.4;
     y = 0.25;
     w = 0.2;
     h = 0.04;
     text = "Done";
     action = "closeDialog 0";
  };
  class MY_LIST : RscCombo
  {
     idc = 104;
     x = 0.4;
     y = 0.3;
     w = 0.2;
     h = 0.04;
  };
};

Create Dialog 1:

Code: [Select]
_ok = createDialog "Main"
?(!_ok): hint "Fehler!"; exit

_index = lbAdd [104, "Weapons"]
lbSetData [104, _index, "Weapons"]
_index = lbAdd [104, "Health"]
lbSetData [104, _index, "Health"]
_index = lbAdd [104, "Endurance"]
lbSetData [104, _index, "Endurance"]
_index = lbAdd [104, "Stealth"]
lbSetData [104, _index, "Stealth"]
_index = lbAdd [104, "Nothing"]
lbSetData [104, _index, "Nothing"]
lbSetCurSel [104, 0]

Description.ext 2 (stealth dialog box):

Code: [Select]
#define FontM "tahomaB36"
#define FontHTML "CourierNewB64"

#define ST_HPOS       0x0F
#define ST_LEFT       0
#define ST_RIGHT      1
#define ST_CENTER     2
#define ST_FRAME      64

#define CT_STATIC     0
#define CT_BUTTON     1
#define CT_EDIT       2
#define CT_SLIDER     3
#define CT_COMBO      4
#define CT_LISTBOX    5
#define CT_ACTIVETEXT 11

class RscText
{
        type = CT_STATIC;
        idc = -1;
        style = ST_LEFT;
        colorBackground[] = {0, 0, 0, 1};
        colorText[] = {1, 0, 0, 1};
        font = FontM;
        sizeEx = 0.04;
};

class RscActiveText
{
      type = CT_ACTIVETEXT;
      idc = -1;
      style = ST_LEFT;
        color[] = {1, 0, 0, 1};
        colorActive[] = {1, 0, 0, 1};
        font = FontM;
        sizeEx = 0.04;
        soundEnter[] = {"ui\ui_over", 0.2, 1};
        soundPush[] = {, 0.2, 1};
        soundClick[] = {"ui\ui_ok", 0.2, 1};
        soundEscape[] = {"ui\ui_cc", 0.2, 1};
        default = false;
};

class RscButton
{
        type = CT_BUTTON;
        idc = -1;
        style = ST_CENTER;
        colorText[] = {1, 0, 0, 1};
        font = FontHTML;
        sizeEx = 0.025;
        soundPush[] = {, 0.2, 1};
        soundClick[] = {"ui\ui_ok", 0.2, 1};
        soundEscape[] = {"ui\ui_cc", 0.2, 1};
        default = false;
};

class RscEdit
{
       type = CT_EDIT;
       idc = -1;
       style = ST_LEFT;
       font = FontHTML;
       sizeEx = 0.02;
       colorText[] = {1, 0, 0, 1};
       colorSelection[] = {1, 0, 0, 1};
       autocomplete = false;
       text = ;
};

class RscLB_C
{
        style = ST_LEFT;
        idc = -1;
        colorSelect[] = {1, 0, 0, 1};
        colorSelectBackground[] = {1, 0, 0, 1};
        colorText[] = {1, 0, 0, 1};
        colorBackground[] = {1, 0, 0, 1};
        font = FontHTML;
        sizeEx = 0.025;
        rowHeight = 0.04;
};

class RscListBox : RscLB_C
{
        type = CT_LISTBOX;
};

class RscCombo : RscLB_C
{
        type = CT_COMBO;
        wholeHeight = 0.3;
};

class RscSliderH
{
       type = CT_SLIDER;
       style = ST_HPOS;
       color[] = {1, 0, 0, 1};
       idc = -1;
       sizeEx = 0.025;
};

class Stealth
{
  idd = -1;
  movingEnable = true;
  controlsBackground[] = { MY_BACKGROUND, MY_FRAME };
  class MY_BACKGROUND : RscText
  {
     colorBackground[] = {0, 0, 0, 1};
     text = ;
     x = 0.2;
     y = 0.1;
     w = 0.6;
     h = 0.7;
  };
  class MY_FRAME : RscText
  {
      idc = 103;
      style = ST_FRAME;
     colorText[] = {1, 0, 0, 1};
     text = "Skills: Stealth";
     font = FontHTML;
     sizeEx = 0.025;
     x = 0.22;
     y = 0.12;
     w = 0.56;
     h = 0.66;
  };
  objects[] = { };
  controls[] = { HELLO_WORLD, CLICK_ME, MY_BUTTON, MY_SLIDER };
  class HELLO_WORLD : RscText
  {
    idc = 100;
    style = ST_CENTER;
    x = 0.4;
    y = 0.45;
    w = 0.2;
    h = 0.1;
    text = "Stealth";
  };
  class CLICK_ME : RscActiveText
  {
    idc = 101;
    style = ST_CENTER;
    x = 0.4;
    y = 0.65;
    w = 0.2;
    h = 0.05;
    text = "Upgrade";
    action = "ctrlSetText [100, lbData[104, lbCurSel 104]]";
    default = true;
  };
  class MY_BUTTON : RscButton
  {
     idc = 102;
     x = 0.4;
     y = 0.25;
     w = 0.2;
     h = 0.04;
     text = "Done";
     action = "closeDialog 0";
  };
  class MY_SLIDER : RscSliderH
  {
     idc = 104;
     x = 0.25;
     y = 0.3;
     w = 0.5;
     h = 0.04;
  };
};

Creatdialog 2 (stealth dialog box):

Code: [Select]
_ok = createDialog "Stealth"
?(!_ok): hint "Error!"; exit

#loop
_oldPos = sliderPosition 104
@(_oldPos != sliderPosition 104) || !ctrlVisible 104
?!ctrlVisible 104: exit

ctrlSetText [100, format["Slider: %1", sliderPosition 104]]
goto "loop"

Cheers.
« Last Edit: 18 Apr 2003, 16:40:06 by GodHatesUsAll »

Kinnon

  • Guest
Re:READ this - VERY interesting. Need help with it.
« Reply #5 on: 18 Apr 2003, 17:20:08 »
Get the source-code of OpFlash, Planet of War, also look at Chain of Command, which is available for download here at OFPEC. Both have extensive menu-manipulation.

GodHatesUsAll

  • Guest
Re:READ this - VERY interesting. Need help with it.
« Reply #6 on: 19 Apr 2003, 02:50:57 »
Thanks dude, but i DESPISE CoC's menu manipulation.

Im talking about Dialog Boxes, not radio commands etc.