Cockpit help

For developmental things relating to the graphics of the game.
Post Reply
gawdzilla
Liz of the many names
Posts: 1124
Joined: Sun Jul 20, 2008 11:13 am

Cockpit help

Post by gawdzilla »

No clue how to do this myself, I'm a coding n00b so.. look:

Image

Simply put, I want a rubber NEEDLE (2.8 default) instead of the rubber BAR. Can anyone give me the simple code to replace it with? :<

Original cockpit file:
http://www.sendspace.com/file/24m90l
Word
Reverse Adjust Outside Corner Grinder
Posts: 4258
Joined: Wed Jan 07, 2009 6:13 pm

Re: Cockpit help

Post by Word »

Code: Select all

 <!-- rubber meter -->
        <NeedleGauge usetemplate="ng">
            <DataSet>
                <AtomicData field="source" source="player_rubber" />
                <AtomicData field="minimum" source="0" />
                <AtomicData field="maximum" source="cycle_rubber" />
            </DataSet>
            <Position x="-0.48" y="0." />
            <Caption location="bottom">
                <Text value="0xffff33Rubber" />
            </Caption>
        </NeedleGauge>
gawdzilla
Liz of the many names
Posts: 1124
Joined: Sun Jul 20, 2008 11:13 am

Re: Cockpit help

Post by gawdzilla »

Thanks for trying but then I get an error + it looks like this... :/

Image
Word
Reverse Adjust Outside Corner Grinder
Posts: 4258
Joined: Wed Jan 07, 2009 6:13 pm

Re: Cockpit help

Post by Word »

try to download this file and put it in C:\programs\Armagetron Advanced\resource\included\AATeam (it should already be there)
http://dl.dropbox.com/u/8361041/cockpit-0.3.1-c.dtd
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Re: Cockpit help

Post by dlh »

You must define the "ng" WidgetTemplate. Look at the classic cockpit resource that comes with the game.

Code: Select all

	<WidgetTemplate id="ng">
            <Position x="0." y="-0.9" />
            <Size height="0.175" width="0.175" />
            <ShowCurrent value="true" />
            <ShowMaximum value="true" />
            <ShowMinimum value="true" />
            <Foreground>
                <Solid>
                    <Color r="1." g="1." b="1." alpha="1." />
                </Solid>
            </Foreground>
	</WidgetTemplate>
User avatar
Van-hayes
Round Winner
Posts: 398
Joined: Sat Mar 04, 2006 1:15 am
Location: The Maritimes

Re: Cockpit help

Post by Van-hayes »

Code: Select all

<NeedleGauge camera="*">
           <DataSet>
               <AtomicData field="source" source="player_speed" />
               <AtomicData field="minimum" source="0" />
               <AtomicData field="maximum" source="max_speed" />
           </DataSet>
           <Position x="-0.165" y="-0.9" />
           <Size height="0.15" width="0.15" />
           <ShowCurrent value="true" />
           <ShowMaximum value="true" />
           <ShowMinimum value="true" />
           
               <Text value="Speed" />
           
           <Foreground>
               <Solid>
                   <Color r="1." g="0." b="0." alpha="1." />
               </Solid>
           </Foreground>
       </NeedleGauge>
That's the example one for speed on the wiki, http://wiki.armagetronad.net/index.php? ... t_Tutorial, you can just make it a Needlegauge instead of a template if you only want one. Just change the atomicdata source=player_speed to player_rubber and max_speed to cycle_rubber. Change the text value to rubber or just remove it if you don't want a label iirc, might be thinking of something else, haven't used a needle gauge in a while.
You've gone too far, turn back!
gawdzilla
Liz of the many names
Posts: 1124
Joined: Sun Jul 20, 2008 11:13 am

Re: Cockpit help

Post by gawdzilla »

Yeah, I don't understand any of this and I keep running into errors, like I said I'm a code n00b. If anyone is kind enough to download the orginal cockpit and put the needle there instead of the meter/bar, then I WILL CHERISH IT FOREVER.
User avatar
Discosuperstar
On Lightcycle Grid
Posts: 21
Joined: Thu Dec 31, 2009 6:14 am

Re: Cockpit help

Post by Discosuperstar »

This is what I use:

Code: Select all

		<NeedleGauge>
            <DataSet>
                <AtomicData field="source" source="player_rubber" />
                <AtomicData field="minimum" source="0" />
                <AtomicData field="maximum" source="cycle_rubber" />
            </DataSet>
            <Position x="-0.55" y="-0.9" />
            <Size height="0.15" width="0.15" />
            <ShowCurrent value="true" />
            <ShowMaximum value="true" />
            <ShowMinimum value="true" />
			<Caption location="bottom">
                <Text value="Rubber" />
            </Caption>
            <Foreground>
                 <Gradient orientation="value">
                    <Color r="0." g="1." b="0." alpha="1." at="0." />
                    <Color r="1." g="1." b="0." alpha="1." at="0.5" />
                    <Color r="1." g="0." b="0." alpha="1." at="1.0" />
                </Gradient>
            </Foreground>
        </NeedleGauge>
The color of the needle goes from green to red as rubber gets low. You can mess with the position and size because it's kind of small (0.2.8 style).
User avatar
teen
Round Winner
Posts: 390
Joined: Mon May 21, 2007 2:27 am

Re: Cockpit help

Post by teen »

If you have 3.0, in the resource you will see wrtlprnft folder and inside is the "classic" rubber meter.

In your settings.cfg, right under where it says map_file i wrote "COCKPIT_FILE wrtlprnft/classic-0.0.1.aacockpit.xml"
Image
gawdzilla
Liz of the many names
Posts: 1124
Joined: Sun Jul 20, 2008 11:13 am

Re: Cockpit help

Post by gawdzilla »

Thank you, it finally worked.

Image
Post Reply