You are not logged in.    Login    New User    Forum Home    Search

Location:
JBPLAY  \  Meteor 2  \  Help and Guidance  \  Button missing?

Back to Threads

Viewing Thread: Button missing?

 

VR_Rat

Joined: 20 January 2006
Posts: 396
25 February 2006 17:54 (UK time)

I've been wondering about htis for a while, why does the game keep saying error loading something from base/graphics/buttons/folder.txt
Am I missing a file?

You need to login to create posts in this thread.

nyasudah
 Official Sponsor

Joined: 06 February 2005
Posts: 832
25 February 2006 18:15 (UK time)

I got this too at the startup screen. i wonder how it can load an image from .txt file anyway.
nyasudah / masuda / mp / PetiX / PtX


You need to login to create posts in this thread.

mike323
Joined: 23 January 2005
Posts: 745
26 February 2006 01:56 (UK time)

I believe this is cause M2 is trying to read folder.txt as an image. Perfectly normal behavior.

You need to login to create posts in this thread.

me_mantis

Joined: 26 September 2003
Posts: 1152
26 February 2006 05:42 (UK time)

There are no button images, but since the folder should be there for buttons, the folder.txt is there to keep the folder.

If you wish, you may delete it.

You need to login to create posts in this thread.

VR_Rat

Joined: 20 January 2006
Posts: 396
26 February 2006 15:37 (UK time)

If I wanted custom buttons what would I need to name them for it to work?

You need to login to create posts in this thread.

mike323
Joined: 23 January 2005
Posts: 745
26 February 2006 17:56 (UK time)

You can name them anything, as long as the extension is .PCX


You need to login to create posts in this thread.

nyasudah
 Official Sponsor

Joined: 06 February 2005
Posts: 832
26 February 2006 18:27 (UK time)

what kind of button images should be there? the normal menu buttons like save, load etc.. ??
nyasudah / masuda / mp / PetiX / PtX


You need to login to create posts in this thread.

me_mantis

Joined: 26 September 2003
Posts: 1152
27 February 2006 04:13 (UK time)

You can't really save and load, but you can run script triggers. The toolbar will auto resize the .pcx images, so you can use standard sprites.

You need to login to create posts in this thread.

arezey

Joined: 16 June 2005
Posts: 1599
27 February 2006 05:49 (UK time)

I have extracted the normal toolbar buttons...

I will place them (zipped and rared) here.

I did this by taking a few screenies and cropping them off.

BTW you can do separators by adding
SC_AddToolbarButton(0, "", BUTTON_SEPERATOR, "", 0);

Edited: 27 February 2006 05:59


You need to login to create posts in this thread.

VR_Rat

Joined: 20 January 2006
Posts: 396
27 February 2006 14:13 (UK time)

Don't know what I'd use it for, but thanks.

You need to login to create posts in this thread.

nyasudah
 Official Sponsor

Joined: 06 February 2005
Posts: 832
27 February 2006 15:49 (UK time)

So i can make my very own toolbar?!
Cool!
nyasudah / masuda / mp / PetiX / PtX


You need to login to create posts in this thread.

arezey

Joined: 16 June 2005
Posts: 1599
27 February 2006 18:57 (UK time)

Yes, you can build toolbar script (I'm specialized in that, so if help needed just mail me) with script.

Implented functions:

<hr>

<b>int SC_CreateToolbar( int ToolbarNumber, char *title, int x, int y, int docked, int LocalOnly);</b>
Creates a new toolbar. Toolbars can be placed anywhere on the game screen and can contain any number of buttons. A script trigger can be placed behind each button. Toolbars are visible until they are destroyed using SC_DestroyToolbar.

Up to 5 toolbars may be used at any one time. These are accessed by a toolbar number ranging from 0 to 4 (not 1 to 5).

Parameters
ToolbarNumber = The toolbar's number from 0 to 4
title = The title displayed above the toolbar
x and y = The initial screen coordinates of the toolbar
docked = The docked flag, 1 means the user can not move the toolbar, 0 means they can.
LocalOnly = Set to 1 for the toolbar to only appear on the activating player's machine during multiplayer games. Set to 0 to appear on all machines. This value is essentially ignored in single player games.

Return Values
1 = success, 0 = fail

Notes
Toolbars will not be displayed until one or more buttons have been added using SC_AddToolbarButton.

Example
SC_CreateToolbar( 0, "This is my toolbar", 10, 20, 1);

<hr>

<b>void SC_DestroyToolbar( int ToolbarNumber, int LocalOnly);</b>
Destroys the specified toolbar and stops its being drawn.

Parameters
ToolbarNumber = The toolbar's number from 0 to 4
LocalOnly = (see SC_CreateToolbar)

Notes
You don't need to worry about destroying any toolbars/buttons at the end of the map as Meteor will deal with this for you.

Example
SC_DestroyToolbar(0);
<hr>
<b>void SC_AddToolbarButton( int ToolbarNumber, char *caption, char *ImageFilename, char *TriggerText, int LocalOnly);</b>
Adds a new button or separator to the end of a toolbar.

Parameters
ToolbarNumber = The toolbar's number from 0 to 4
caption = The text for the button (displayed in a mouse tip)
ImageFilename = The button's icon image, this is the filename of an image in the base\images folder (i.e. "objects\\sheep01_01.pcx";)
TriggerText = The code to run when this button is pressed, this is exactly the same format as a sector trigger.
LocalOnly = (see SC_CreateToolbar)

Notes
All images are resized down to 18 by 18 no matter what their original dimensions. (all my zip's images [I think they are best to go to graphics\buttons] are at 18 by 18 so no resizing is done for these)

Examples (add buttons)
SC_AddToolbarButton( 0, "Button 1", "objects\\sheep01_01.pcx", "run BuySheep", 0);
SC_AddToolbarButton( 0, "Button 1", "objects\\sheep01_01.pcx", "SC_GameMessage(\"baa\";);", 0);

Example (add seperator)
SC_AddToolbarButton( 0, "", BUTTON_SEPERATOR, "", 0);

<hr>

As you might guess, the TriggerText parameter usually is "run Trigger". Here is an example that creates an toolbar with a number of 0 with a "Run Map" function and an exit button.

#title "Toolbar Help"
#author "aleksanteri"

#include meteor2

export OnMapStart;
export RunAMap;

void OnMapStart()
{
    SC_CreateToolbar(0, "Help Toolbar", 0, 0, 0, 1); // toolbar create
    SC_AddToolbarButton(0, "Run a Map", "buttons\open.pcx", "run RunAMap", 1); // runmap button
    SC_AddToolbarButton(0, "", BUTTON_SEPERATOR, "", 1); // separator
    SC_AddToolbarButton(0, "Quit", "buttons\quit.pcx", "SC_DestroyToolbar(0, 1);";);
}

void RunAMap()
{
    if(SC_ConfirmBoX("Really run a map?";)) // if the user presses yes
    {
        SC_PassToConsole("map";);
    }
}


Edited: 27 February 2006 19:01


You need to login to create posts in this thread.

me_mantis

Joined: 26 September 2003
Posts: 1152
27 February 2006 20:52 (UK time)


That will work in single player, but the SC_ConfirmBox is converted to SC_GameMessage in multiplayer.


btw... Thatoolbar picture is from a map that is the reason for toolbars(had I not made the map with 100 SC_ConfirmBoxs we wouldn't have toolbars now). =D Its not released yet, but I will release it soon on meteormods.com.



You need to login to create posts in this thread.

VR_Rat

Joined: 20 January 2006
Posts: 396
27 February 2006 21:18 (UK time)

100 confirm boxes, that will be something to see.

You need to login to create posts in this thread.

me_mantis

Joined: 26 September 2003
Posts: 1152
28 February 2006 17:15 (UK time)

It convinced James to implement toolbars, so it was a complete sucess. The confirm boxes when like this...

Would you like to buy weapons
Would you like to buy a shotgun
Would you like to buy a flamethrower
Would you like to buy.... all the other weapons
Would you like to buy ammo?
Would you like to buy bullets?
Etc...
Would you like to buy Hp?

Its awesome to have the toolbars now.

I also used the onentervehicletype script stuff, so there may be a universal script coming out for my toolbars.

You need to login to create posts in this thread.

mike323
Joined: 23 January 2005
Posts: 745
28 February 2006 23:55 (UK time)

You will see many toolbars in Gunmetal for directing troops, calling for backup, selecting missions, etc.

You need to login to create posts in this thread.



Forums system (C) 1999-2023 by James Bunting.

Terms of Use