The laptop

Post your mods for Hired Guns here.
Post Reply
Tidus97
Posts: 1
Joined: Wed Mar 25, 2009 10:54 am

The laptop

Post by Tidus97 »

phew, talk about a constructive first post.

before i start, a TL;DR version:
we're on our way to do awesome stuff with the browser. just need to learn a little bit more.

heres the whole thing. enjoy. (typed it all up in 3 hours, go me).

The laptop

ive been fiddeling with the laptops files and have figured out how parts of it work. Im going to post up my findings here and also post questions to be answered. Im mainly concearned about the laptops browser right now. Figuring out its inner workings will certainly give modders some nice flexabillities – custom web pages showing modders name and mod information and perhaps just some additional pages to add to the feel of the mods story line. (like the AIM history page – pointless in functionality, just adds to the feel of it all). Not only this, but there is evidance of incomplete and unimplemented web pages. One main one is the “H.E.R.K” website, which is activateable, but blank.

Image
I am guessing this was the website to be used to purchase the 9 (?) “hidden” freelancers.

There are some other hidden buttons with no functionality at all (unlike the H.E.R.C. Button which does take you to a website.) but I wont go through those.

Files associated with the browser
The following files make the browser work to some extent. (they seem to be the “HTML” files of the websites if you will – no functionality).

All the following files can be found in “C:\Tri Synergy\Hired Guns\basis\scripts\ui”

LaptopBrowser.txt – controls what you see in the internet window. Not the sites themselves, just the book marks panel and close button (the red X that closes the browser, top right hand side).
SiteAim.txt – is never visited. This is the Aim websites equivelent of the H.E.R.C. Website image above.
SiteAimAlumni.txt – Adverts page on the aim website.
SiteAimContact.txt – The popup box for when you are hiring a merc on the aim website (with close/hire/w equipment buttons).
SiteAimData.txt – The page with the list of mercs available for hire with their stats on the RHS.
SiteAimHistory.txt – history page on the aim website.
SiteAimPolicy.txt – policy page on the aim website.
SiteBobby.txt – The side bar on Dickie jay website. His website is split into two – sidebar and content. The content changes according to what you press on the side bar. Default is the one below.
SiteBobbyHome.txt - home page on Dickie jay (the image and title only)
SiteBobbyBasket.txt – The purchase page.
SiteBobbyShowcase.txt – Any page where you can buy stuff – knifes, pistols, etc)
SiteImp.txt - is never visited. This is the IMP websites equivelent of the H.E.R.C. Website image above.
The other IMP files are self explanotory (SiteImp*.txt)
SiteMerc.txt – the website you see in the screen shot above.
SiteWeapons.txt - ? dont know. The contents suggest it will be displayed as H.E.R.C. Website does but I dont know what it may have been intended for.

Images for all these websites can be found at “C:\Tri Synergy\Hired Guns\basis\ui\pictures\Laptop”.

The strings (Words) within these websites are all stored in “C:\Tri Synergy\Hired Guns\basis\locale\usa\scripts\strres\ui.xml”

Some things ive noticed
Most sites have a page that isnt visited at all, and its the same for all of them. SiteName.txt contains an image of a wooden button (?) that fills the whole pages. The AIM and IMP sites ones (SiteImp, SiteAim) is never seen and seems to the correct home page 'redirect' to SiteAimHome.txt and SiteImpLogin.txt.

Things we need to figure out
Allthough the txt files do msot the work, there is still some functionality that isnt available to us though the txt files. For example, I have extended the number of mercs visible on the Aim site to 6 more, but these slots are never filled. Almost as if something is telling it to do a certain amount only! Also, buttons functions are external as well. I can copy the contents of the entire aim home page to the herc page, but even though itll look the same, the buttons wont work at all.

If we can figure this out, it could mean some great things. Custom, fully functional websites and weapon stores. Most importantly, custom websites for merc hiring (Come visit Tidus97's Store and hire the finest mercs on the web!). A website can be created for the existing 9 (?) “Hidden” mercs that have no where to go right now. All this can be done without touching the existing AIM website. If you havnt picked up on it yet, this means we can have an infiniate amount of mercs in a mod.

Making your own webpage (Or modding the HERC one to make it yours :p )
Its pretty simple really. Open up SiteAIMHome.tga found in the laptop images folder “C:\Tri Synergy\Hired Guns\basis\ui\pictures\Laptop”. Now design your own webpage. Add text, images, ETC to it. Save it as whatever you like in the laptop folder (“C:\Tri Synergy\Hired Guns\basis\ui\pictures\Laptop”.). Now, open up SiteMerc.txt in “C:\Tri Synergy\Hired Guns\basis\scripts\ui”. Here is what you will see:

Code: Select all

name	type	region	link	tip	property	value
 		 0, 0, 769, 475				
 					image	laptop\merc.tga

Ill run you through some basic stuff. I havnt experimented enough to see what works with what but heres an overview:

name: The name of this object.

Type: what it is, maybe be widget, text, button, and some other stuff.

Region: where it goes. From left to right the numbers mean: X co-ordinate, Y co-ordinate, width, height. 769 is the laptops width, and 475 is its height. Cool.

Link: This one excites me the most, mainly because of what I know what the work link means in web terms and that it just might be the same here. Unfortunatly, I have no idea how to use it, and the other webpages dont use it either (again, their linking is done in the backend somehow). Some of the other txt files do use it but have a weird value like “right|bottom”.

Tip: its the short name for the string you wish to place in the tool tip. (strings are stored in “C:\Tri Synergy\Hired Guns\basis\locale\usa\scripts\strres\ui.xml”)

Property: there is a whole lot of properties I wont go through them.

Value: value of this specific property. For example, property may be “color”, and value will be “0xff000000” (black). Can have multiple values.

Heres an example of a button:

Code: Select all

MyButton	text_button	 347, 384, 445, 408				
 					align	hcenter|vcenter
 					line_mode	single_line
 					image_normal	laptop\siteaimhomebutton_1.tga
 					image_selected	laptop\siteaimhomebutton_2.tga
 					image_pressed	laptop\siteaimhomebutton_3.tga
 					sound_selected	ui\click_in
 					sound_pressed	ui\but_click
 					mode	normal
 					text	aim_policy_button
 					font	arial_8_regular
 					color	0xff000000
most are self explantory, but a few still need to be figured out. I will try and put together a full list later. One main thing you might need to know is that the value of “Text” is the shortname for the string in the xml file with all the strings. (“C:\Tri Synergy\Hired Guns\basis\locale\usa\scripts\strres\ui.xml”).

The background of a website seems to be defined by this:

Code: Select all

 name	type	region	link	tip	property	value
 		 0, 0, 769, 475				
 					image	laptop\image_name.tga

No name, no type and only an image property/value. Region does not have to be 0, 0, 769, 475 (whole page) but its the background so thats usualy the idea.

Copy the name of the file you have saved, and replace merc.tga in SiteMerc.txt with it. (full file name, extension and all). Now it will be showing your image/website. The only problem left is actualy navigating to the page. Luckly, the button is already there on the laptop browser book marks, but its placed well out of view so you cant press it. Open up LaptopBrowser.txt and look for the section named Merc. Replace the region with 423, 3, 528, 23 to bring it back into view and into the right spot (like in my screen shot). Wonderful. Now test it out.

What we want to change now is the tool tips that pop up and the button name. Open up the file that stores the strings (“C:\Tri Synergy\Hired Guns\basis\locale\usa\scripts\strres\ui.xml”) and navigate down to the “TOOLTIPS_Laptop” row (its black). Remember to not do this in openoffice spreadsheet as it doesnt work well and ruins the file I heard. As you can see, “tooltip_laptop_browser_merc_link” is what handles the default tool tip for the bookmark button. Lets add another row in there. Call it “tooltip_laptop_browser_mysite_link” and give it a string - “Come visit my website!”. Now find “laptop_merc_button”. This gives us the buttons name in the browser. Its value is H.E.R.C.. not what we want. So make a new entry “laptop_mysite_button” and give it a value - “My site!”. Cool.

Last thing we need to do is make sure the button responsible to taking us to our home page is reading the right tool tip. (right now, its not.) Open up LaptopBrowser.txt again, and go back down to the merc section. In the properties column, edit the value of the “Text” property to whatever you put for the buttons name in the string xml file. (in our case, its “laptop_mysite_button”). Do the same for the section under tip – "tooltip_laptop_browser_merc_link" should be “tooltip_laptop_browser_mysite_link”.



Thats it! Enjoy your site. :)

Image

hope you all found this useful. Feed back welcomed, and any additional info welcomed. Mods are welcomed to use this method in the way I suggested (own mod page, ETC) by overwriting the H.E.R.C. Page until we find a way to link sites up. Just throw a little credit my way >_> :D

User avatar
blemishednicely
Posts: 38
Joined: Sat Mar 14, 2009 9:32 pm
Location: }8-]![#= Hither & Yon (it has a GIFT shop, even!)
Contact:

RE: The laptop

Post by blemishednicely »

This is very interesting (if not a mildly daunting read-tho doubt it's really possible for much simpler listing, real or virtual, setting up a webpage is bound to be tecchy to a degree).
This will be something I'll have to check out...have a few ideas on mercs being added w/o placeholders...one just using the avail list mercs, pending results I'll later look into
more of the 'many mercs' possblts. Will be a while tho as my own project goal will pop this on backburn by def. Will shout back later if I dig nyt'g up.

You do webwork for real or was this all hobby/research? Good find/quite thorough either way


"They told me to pick a nice, round #...too bad I opted for Zero"
I mean think about it, the Y chromosome is really just an incomplete X...
User avatar
Reinforce
Posts: 197
Joined: Wed Dec 10, 2008 11:33 pm

RE: The laptop

Post by Reinforce »

Nice find Tidus97 always wondered how the web worked in this.


Much love,
Reinforce
Post Reply

Return to “Mods”