Jump to content
Sign in to follow this  
maruk

New editing options in resistance

Recommended Posts

Resistance introduces some new powerful editing features. There's no documentation available at the moment and updated command reference will follow later. However, you can download this simple sample mission to find out some of the new features:Interactive Vehicle Creation Dialog

Use Radio Alpha (0-0) to activate a dialog. In Resistance, you can define own active dialogs and other controls for your custom missions.

Enjoy.

Share this post


Link to post
Share on other sites

What types of controls do we have to choose from?

In the sample mission there is a listbox type demonstrated! Do we have Radiobuttons and checkboxes and sliders a.s.o?

Also, we have the ability to use custom p3d-files for our dialogs as I saw in the description.ext! How is this being handled?

Share this post


Link to post
Share on other sites

Thanks Maruk, I am having trouble making vehicles stay dead in between 2 campaign mission.

I am using this script to detect the vehicles that have been destroyed.

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

; -------- Vehicles - BIS script ---------

_veh = [Tank1, Tank2];

_j = 0;

_i = count _veh;

#LOOPVehicles

? _j >= _i : goto "ENDVehicles"

_who = _veh select _j;

_do = false

? (alive _who) and (_who distance aP < 400) and  ((side (driver _who) == resistance) or ((driver _who != driver _who))) : _do = true;

? not (_do) : goto "LOOPVehIn"

? _who == T80 : GLB_T80 = true; saveVar "GLB_T80"; goto "LOOPVehIn"

? _who == BMP : GLB_BMP = true; saveVar "GLB_BMP"; goto "LOOPVehIn"

#LOOPVehIn

_j = _j + 1;

goto "LOOPVehicles"

#ENDVehicles

exitmis = 1

--------------------------------------------

<span id='postcolor'>

It does not come up with any errors, so I assume it must be the script I use to get the data into the next mission.

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

; ------------- Vehicles  - BIS script---------------

GLB_NUMBER = 2;

GLB_T80 = true;

GLB_BMP = true;

_who = [GLB_T80, GLB_BMP]

_a = 0;

_b = count _who;

_tanks = 0;

#LOOPVehlImport

? _a >= _b : goto "ENDVehlImport"

? _who select _a : _tanks = _tanks + 1; goto "JMPVehlImport"

deleteVehicle (_who select _a);

#JMPVehlImport

_a = _a + 1;

goto "LOOPVehlImport"

#ENDVehlImport

---------------------------------------------

<span id='postcolor'>

That should delete the tank/tanks that has been destroyed in the last mission.

But the result is that both the tanks will stay there no matter it they were destroyed in the last mission.

I can only assume that it has something to do with the "GLB_T80" and "GLB_BMP" var. I am not sure the data that will be saved from the vehicles, so I named the vehicles in the mission editor the same for both the missions.

Any help on this would be useful, Maruk if you read this (probably not) it would be a great help.

Thanks,

RED

Share this post


Link to post
Share on other sites

Hi Maruk!

That new features are awesome! I found myself that we have checkboxes and all the other stuff, but does there exist another demomission beside this one?

I would really like to test all that stuff like sliders and edit fields a.s.o.! I tried to incorporate them myself, but I failed to find out the properties.

I.e. I got a 3DSTATIC in the description.ext without errors, but the desired text didn't appear on the laptop.

I hope you get the reference as soon finished as possible, I have already one thousand ideas!

Share this post


Link to post
Share on other sites

Whee nice feature... And this thread got buried this deep already? wow.gif

Share this post


Link to post
Share on other sites

Well,

I don't understand it either. I think that this is the most revolutionary feature in OFP! You can set all controls that you see in the ingame-Menu and the start-menu!

Share this post


Link to post
Share on other sites

Whee nice feature indeed... I used it to make a spectating script, so after you die in multiplayer you can watch other people play from a "chase cam" view. Theres next and prev buttons to cycle between players.

Looks like this:

http://koti.mbnet.fi/kegetys/flashpoint/screenshots/spectate2.jpg

http://koti.mbnet.fi/kegetys/flashpoint/screenshots/spectate3.jpg

It works well, but theres one bug... whenever the mission ends (admin does #reassign for example) that spectating menu wont disappear... Unless there is a function to check if the game has ended and then terminate that menu, it is an OFP bug I think smile.gif

Edit: the bug looks like this: http://koti.mbnet.fi/kegetys/flashpoint/screenshots/spectatebug.jpg tounge.gif

Share this post


Link to post
Share on other sites

Here's a test version if anyone wants to see how it works: http://koti.mbnet.fi/kegetys/flashpoint/spectatetest.intro.zip

Extract to users/whatever/spectatetest.intro directory, and preview it in the editor. Radio alpha (0-0-1) initiates the spectating script, and you can then cycle through the AI players. It also works in multiplayer so you can export it, there the scripts get also activated when you die so you dont need to use that radio command.

Share this post


Link to post
Share on other sites

Well there is the command

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

closeDialog 0

<span id='postcolor'>

which closes the Dialog!

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Unless there is a function to check if the game has ended and then terminate that menu<span id='postcolor'>

Keg;

I think, there's no feature to check, wether the mission

is still running or not.

But you could go around that by changing a variable,

once your end-detect trigger became activated.

E.G: where you change the state of your last objective

to done/failed, just change another variable (diagvar=1)

and check in the cam script ?diagvar == 1, to force it to an

end.

:edit - doh wow.gif - just saw that you mean to ask for the end

of mission, if abborted by admin - hmm dunno how to check

this one.

~S~ CD

Share this post


Link to post
Share on other sites

I don't know much about MP-Editing, but in the Res-Campaign everywhere is a exit.sqs similar to init.sqs!

I didn't check whether the exit.sqs is automatically called, but this would be a solution!

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bigpoppa @ July 09 2002,18:53)</td></tr><tr><td id="QUOTE">Well there is the command

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

closeDialog 0

<span id='postcolor'>

which closes the Dialog!<span id='postcolor'>

Yes, I tried that, in exit.sqs but it didnt work.

Share this post


Link to post
Share on other sites

Two questions at you Kegetys, as Maruk doesn't answer or monitor this thread!

There are lots of different control types; therefore I got two questions:

Did you try to get a slider working?

And did you try to get an edit field working?

Share this post


Link to post
Share on other sites

Well, I got a slider and a textbox working, but I have no idea how to read values from them... or how to set max values for the slider.

Share this post


Link to post
Share on other sites

Well, the same to me! And one problem: I can see the textbox but can't type in in the text box! Could you post the part where you define the textbox in your description.ext?

Share this post


Link to post
Share on other sites
Guest

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bigpoppa @ July 02 2002,16:06)</td></tr><tr><td id="QUOTE">What types of controls do we have to choose from?<span id='postcolor'>

From the description.ext

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

// Control types

CT_STATIC

CT_BUTTON

CT_EDIT

CT_SLIDER

CT_COMBO

CT_LISTBOX

CT_TOOLBOX

CT_CHECKBOXES

CT_PROGRESS

CT_HTML

CT_STATIC_SKEW

CT_ACTIVETEXT

CT_TREE

CT_3DSTATIC

CT_3DACTIVETEXT

CT_3DLISTBOX

CT_3DHTML

CT_3DSLIDER

CT_3DEDIT

CT_OBJECT

CT_OBJECT_ZOOM

CT_OBJECT_CONTAINER

CT_OBJECT_CONT_ANIM

CT_USER

// Static styles

ST_HPOS

ST_LEFT

ST_RIGHT

ST_CENTER

ST_UP

ST_DOWN

ST_VCENTER

ST_TYPE

ST_SINGLE

ST_MULTI

ST_TITLE_BAR

ST_PICTURE

ST_FRAME

ST_BACKGROUND

ST_GROUP_BOX

ST_GROUP_BOX2

ST_HUD_BACKGROUND

ST_TILE_PICTURE

ST_WITH_RECT

ST_LINE

ST_SHADOW

ST_NO_RECT

ST_TITLE

ST_TITLE_BAR + ST_CENTER

// Predefined controls

IDC_OK

IDC_CANCEL

<span id='postcolor'>

Share this post


Link to post
Share on other sites

@denoir

I know them already myself! I even managed to draw them on the laptop! But I can't type into the "edit" (textbox), and therefore I only need the correct resource declaration for either CT_EDIT or CT_3DEDIT!

Share this post


Link to post
Share on other sites

I wonder if there is a way to make an "resource addon", as in an addon PBO that would add a new dialog resource... If it were possible, I could make a thing that would replace the default seagull view with this spectating script, so people who like this could use it without needing to edit all missions.

I tried adding the description.ext stuff to an addon config.cpp but it didnt work... and it seems that a resource.cpp from an addon pbo is not loaded...

Also and having a resource.bin sourcecode would be a very helpful example on how to do things with this... (hint hint BIS wink.gif )

Share this post


Link to post
Share on other sites

Does anyone (but me) think we need a complete listing of available resources and .p3d objects you can use?

Even if most of the ppl who are using this kind of scripting knows most of that stuff it's nice to have a reference to peak in whenever you are unsure about something.

Lemme know if any of you guys start on such a thing, I'll help ya.

You can contact me on ICQ or e-mail:

ICQ# 95734666

Tomas_Landin@Hotmail.com

Cheers, KTottE

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Kegetys @ July 09 2002,19:15)</td></tr><tr><td id="QUOTE">Well, I got a slider and a textbox working, but I have no idea how to read values from them... or how to set max values for the slider.<span id='postcolor'>

to read the value of a textbox try

_returnedText = ctrlText _idc;

in your action script, where _idc is the reference number of the textbox object in the description.ext

Share this post


Link to post
Share on other sites

edit: doh, misread... Yes, that propably works for textboxes but dunno about sliders.

Share this post


Link to post
Share on other sites

Anyone trying to figure all this out... here are some commands u can try

lbSetColor

lbColor

lbSetPicture

lbPicture

lbSetValue

lbValue

lbSetData

lbData

lbText

lbDelete

lbAdd

lbClear

lbSetCurSel

lbCurSel

lbSize

buttonSetAction

buttonAction

ctrlSetText

ctrlText

ctrlEnable

ctrlShow

ctrlEnabled

ctrlVisible

I'm still not sure about the slider......

Share this post


Link to post
Share on other sites

i am testing with replacing the "notebook" with something else.. so far it just crashed the game when i call the dialog.. is there anyone that find anything on what to do?

EDIT: Well, when i looked on my post i understand not many will understand wink.gif

okey, what i did was open the description.ext and change the:

model = "notebook.p3d";

to another p3d.. it crashed when i tested, so i did some tweaking, still it crash, so now i wonder, has anyone managed to put their p3d on screen, or just replace it?

2nd question, you guys know/think if i can change it while watching, lets say the on the one maruk did, if i had clicked jeep and then ok, is there anyway i could have stay in that menu and the pic for the jeep changed? this would be kinda easy to test, but clock is 04.40 in the morning and i am heading for bed wink.gif

thanks for ALL and i do mean all information i can get..

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (GranQ @ July 11 2002,03:59)</td></tr><tr><td id="QUOTE">i am testing with replacing the "notebook" with something else.. so far it just crashed the game when i call the dialog.. is there anyone that find anything on what to do?<span id='postcolor'>

May I kindly direct you to this thread in the OFPEC forums. You'll find a sample mission with some other objects that can be used as a 'canvas' for dialog elements. There are even more...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×