I am in the process of making a new HUD - It is mostly complete, but In order to finish it how I want to finish it, I need to know how to either truncate things or use less than and greater than.
I've tried using < and > but it seems to recognize them about as much as it recognizes +, -, /, and *. Because you have to type out those operators, I tried doing Truncate(), LessThan() and GreaterThan(), but I'm about as likely to stumble upon the correct one with capitalization as I am likely to win the lottery.
Any useful help is apreciated
Text MDL Commands
There's no possible way of working on MDL without Ksero's excellent MDL Documentation.
I didn't immediately see something like LessThan(), but you could use Subtract() to subtract B from A, then Max() it with 0 and compare using a SwitchX(). That is because ...
... if I'm not mistaken.
Yes, MDL sometimes is funny like that.
-- Cort
EDIT: Duh, I meant without Ksero's docs, of course!
I didn't immediately see something like LessThan(), but you could use Subtract() to subtract B from A, then Max() it with 0 and compare using a SwitchX(). That is because ...
Code: Select all
(B <= A) <=> (max(A - B, 0) = 0)Yes, MDL sometimes is funny like that.
-- Cort
EDIT: Duh, I meant without Ksero's docs, of course!
Last edited by Cortex on Wed Dec 03, 2008 12:42 pm, edited 1 time in total.

This is Sparta. Not spa. — Wurf

yes MDLing is the art of doing simple things using complex tricks
to be complete, Ksero's doc is missing 3 R4 additions :
in "gamepanes" namespace:
in 'model' namespace:
to be complete, Ksero's doc is missing 3 R4 additions :
in "gamepanes" namespace:
Code: Select all
MapPreviewPane
// MapPreviewPane(image, bshowdetails, bshowside)
// image = background image on which the preview will be rendered. So image also sets the size of the pane.
// bshowdetails = bool, if true displays map details whern the mouse is over the pane
// bshowside = bool, if true displays the side arrow(s) on the map
TextButtonBarPane
// TextButtonBarPane(ColumnOffsets, ColumnHeaders, ButtonFaces, bActAsTabs);
// ColumnOffsets = list of numbers (X offsets)
// ColumnHeaders = list of column headers (names aka strings)
// ButtonFaces = button style (one of: Button* style)
// bActAsTabs = bool, if true the bar will act as a tabbed pane
// exemple of it: gamescreen.mdl , used for the "create game" dialogCode: Select all
Camera
// Camera(zclip_near,zclip_far,FOV_in_degrees,position_vector)
// zclip_near = number, Z near clipping value
// zclip_far = number, Z far clipping value
// FOV_in_degrees = number, field of view in degrees
// position_vector = VectorValue, camera positionSo true!KGJV wrote:QUOTE (KGJV @ Dec 3 2008, 11:15 AM) yes MDLing is the art of doing simple things using complex tricks![]()
That's interesting, where is that used? Could I maybe now create a second, independent camera to show the targeting view over the map. (That's currently not possible because the map view seems to do almost nothing less than moving the camera high above the sector. And there's only one camera, so displaying the targeting view there means it will get the same camera as the map.)KGJV wrote:QUOTE (KGJV @ Dec 3 2008, 11:15 AM) in 'model' namespace:
Code: Select all
Camera // Camera(zclip_near,zclip_far,FOV_in_degrees,position_vector) // zclip_near = number, Z near clipping value // zclip_far = number, Z far clipping value // FOV_in_degrees = number, field of view in degrees // position_vector = VectorValue, camera position
-- Cort

This is Sparta. Not spa. — Wurf

Alright, managed to do it with Cort's help:
That little thing, from my HUD, will show the percent of ammo left, but if it gets to be 10% or less, it will turn red and show a more precise percent.
Code: Select all
AmmoPercent = Multiply(100, GetAmmo(Me, OnEveryFrame));
AmmoImage =
StringImage(
JustifyCenter,
250,
lgBoldVerdana,
hudColor,
ConcatinatedString(ConcatinatedString("Ammo: ", NumberString(AmmoPercent)), "%")
);
AmmoLowImage =
StringImage(
JustifyCenter,
250,
lgBoldVerdana,
Color(1, 0, 0),
ConcatinatedString(ConcatinatedString("Ammo: ", RealNumberString(AmmoPercent)), "%")
);
AmmopctImage =
SwitchImage(
Max(Subtract(AmmoPercent, 11), 0),
AmmoImage,
[
(0, AmmoLowImage)
]
);


-
badpazzword
- Posts: 3627
- Joined: Thu Jan 12, 2006 8:00 am
- Contact:
There's still no way to get real numbers instead of percentages, is there?
Have gaming questions? Get expert answers!


-frank- huzzling "... what are you talking about? command lines are that long now?"
Last edited by fufi on Tue Dec 09, 2008 1:34 pm, edited 1 time in total.
