What are labels? & How do i customize tool tips?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
fasty
1st Lieutenant
1st Lieutenant
Posts: 438
Joined: Thu Apr 15, 2010 4:17 am
Projects :: Server modding
Games I'm Playing :: SWBF2
Contact:

What are labels? & How do i customize tool tips?

Post by fasty »

1) What exactly are "labels?" You can set them in ZE and also the stock game has some in the ODF's, I was wondering what they are good for.
2) Is it possible to set custom tool tips? I know if you have your tool tips set to auto, you will get a messege when you go near command posts, but is it possible to have one for when you go near other objects and can I have them say what I want?
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Two quick questions

Post by THEWULFMAN »

1: Labels are just that, labels. They serve no purpose other than helping developers keep track of things.

2: As far as I know, no. It's probably hardcoded into the exe. But I haven't really ever cared about it enough to look, so what do I know?
Last edited by THEWULFMAN on Wed Jan 04, 2012 11:40 pm, edited 1 time in total.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Two quick questions

Post by Marth8880 »

I am almost completely positive I saw the localization for tool tips somewhere a few days ago. I'll have to get back to you on this...
User avatar
Firefang
Major
Major
Posts: 518
Joined: Mon Nov 15, 2010 8:55 pm
Location: California

Re: Two quick questions

Post by Firefang »

Marth8880 wrote:I am almost completely positive I saw the localization for tool tips somewhere a few days ago. I'll have to get back to you on this...
I can confirm this. Though, I don't believe you can edit the stock levels, only custom. But they are in the localize tool.
User avatar
Cerfon Rournes
Master Bounty Hunter
Master Bounty Hunter
Posts: 1558
Joined: Thu Jul 08, 2010 5:53 pm
Projects :: WIP. I will reveal what it is later on..
Games I'm Playing :: SWBF2-SWRC
xbox live or psn: No gamertag set
Location: New York, USA
Contact:

Re: What are labels? & How do i customize tool tips?

Post by Cerfon Rournes »

ifelem_helptext wrote:Code to create & modify 'helptext' -- a button icon and associated
-- text.
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- Code to create & modify 'helptext' -- a button icon and associated
-- text.

-- Code to make a new helptext. In the template, pass in the following:
--
-- Template.ScreenRelativeX, .ScreenRelativeX, .x, .y -- self-explanatory
-- Template.buttonicon = "btna" -- texture for button
-- Template.string = text to show.
-- Template.bRightJustify . nil = left, 1 = right justify

function NewHelptext(Template)
local TextW = 460

local ret = NewIFContainer {
ScreenRelativeX = Template.ScreenRelativeX,
ScreenRelativeY = Template.ScreenRelativeY,
y = Template.y, -- just above bottom
x = Template.x,

icon = NewIFImage {
ZPos = 200, -- behind most.

texture = Template.buttonicon,
localpos_l = Template.bRightJustify and -gHelptextIconWidth or 0,
localpos_t = gHelptextIconHeight * -0.5,
localpos_r = Template.bRightJustify and 0 or gHelptextIconWidth,
localpos_b = gHelptextIconHeight * 0.5,
-- inert = 1, -- Delete this out of lua once created (we'll never touch it again)
},

helpstr = NewIFText {
string = Template.string,
font = "gamefont_small",
textw = TextW,
x = Template.bRightJustify and -TextW-20 or 20,
y = -8,
ColorR = gHelptextTextColor[1], ColorG = gHelptextTextColor[2], ColorB = gHelptextTextColor[3], alpha = gHelptextTextAlpha,
halign = Template.bRightJustify and "right" or "left",
nocreatebackground = 1,
},
} -- end of ret

return ret
end

-- Helper function for right-justified icon + text containers. Each
-- container must have a .icon and a .helpstr field.
function gHelptext_fnMoveIcon(Container)
-- local fLeft, fTop, fRight, fBot = IFText_fnGetDisplayRect(Container.helpstr)
-- local TextW = fRight - fLeft + 10
-- IFImage_fnSetTexturePos(Container.icon,-TextW -gHelptextIconWidth, gHelptextIconHeight * -0.5, -TextW, gHelptextIconHeight * 0.5)
end

[/code]
Try this code out, it just may work. :wink:
Located in: C:\BF2_ModTools\data_***\Common\scripts
User avatar
Dakota
Field Commander
Field Commander
Posts: 991
Joined: Mon Dec 06, 2010 8:21 pm
Projects :: making random weapon assets
Games I'm Playing :: SWBF2 and more
xbox live or psn: PS3 beats xbox
Location: at a computer desk floating around in space

Re: Two quick questions

Post by Dakota »

THEWULFMAN wrote:1: Labels are just that, labels. They serve no purpose other than helping developers keep track of things.

2: As far as I know, no. It's probably hardcoded into the exe. But I haven't really ever cared about it enough to look, so what do I know?
@2: as the others have said i have seen custom tool tips, just look at what it says when you get near a medic droid in one of dann's maps.
fasty
1st Lieutenant
1st Lieutenant
Posts: 438
Joined: Thu Apr 15, 2010 4:17 am
Projects :: Server modding
Games I'm Playing :: SWBF2
Contact:

Re: What are labels? & How do i customize tool tips?

Post by fasty »

Yes but can I create a tool tip for a custom object?
Post Reply