Jump to content

Enabling UaW's Human Military faction


  • Please log in to reply
69 replies to this topic

#1 Mike.nl

Mike.nl

    Mad Computer Scientist

  • Global Moderator
  • 1,611 posts
  • Gamertag:RationalMike
  • Fav.Game:
  • Gender:Male
  • Location:The Netherlands

Posted 07 May 2008 - 12:55 PM

After reading about the Universe at War Expanded Edition Mod, which replaced Novus with the Human Military, I wondered if it would be possible to get the Military working as a seperate, stand-alone faction, so I decided to try some stuff.

After some success, I figured that it might be educational for modders, both new and experienced, to see how this is done, and thus gain a glimpse into how to mod for UaW. So, in this topic I will describe, as I progress, my quest towards the goal of getting Military working as a faction in skirmish, for all game modes and options, eventually including research.

At this point I don't know if I will succeed or not, or how easy it will be. But either way, it will educational and possibly entertaining (if you like seeing me slave over XML and Lua :mellow:).

Now, in case you've tried to create a mod for UaW (with patch 2) yourself, you might know that the game crashes when you hit the "Live" button, so enabling Military for multiplayer is not being considered right now as I can't test it. I'll get to that when the game is patched.

I will now post the prefix and chapter 1, so do let me know what you think of this idea and if I'm being clear enough, or perhaps if you want more details.

Note: this is NOT a tutorial on the syntax of XML or Lua. I assume you know how to use both of these. This tutorial will deal purely with figuring out what values to set where to get the behavior we want.


Prefix - Getting Started

First, the administrative business of setting up the mod:
  • Created a directory "Mods" in C:\Program Files\Sega\Universe At War Earth Assault which will house all mods.
  • In Mods, created a directory "Military" which will contain this Military mod.
  • In Military, created a Launch.bat file with "..\..\LaunchUAW.exe MODPATH=Mods\Military" which will launch the mod.
  • In Military, created a directory "Data" which will house all the data files of the mod.
For this mod, I will mainly be modifying the game's XML and Lua files, both of which can be found in the Mod Tools. However, as the final Mod Tools aren't released yet, you won't be able to repeat my actions, so you'll just have to read and get inspired :)

Also, for future reference, when I talk about modifying some value in some file, I mean copying that file into the proper subdirectory in Mods\Military\Data, and then modifying the value in the copy.
So, for example, when I say I changed XML\Factions.xml, I mean I copied XML\Factions.xml from the mod tools to Mods\Military\Data\XML\Factions.xml and then changed the copied file. The same goes for Lua files (which live in the Scripts directory).

A more advanced tip, one that is very useful, is grep. It's a Linux tool that allows one to search through many files (even in multiple directories) for the occurance of some text. I use this to find definitions, references or usages of objects or names I might encounter.
As grep is not supplied on a Windows system, you can either install Cygwin, or get Grep for Windows. I can recommend the former if you have Linux shell experience.

So, with the framework set, it's time to enable the Military faction.


Chapter 1 - Enabling Military

As you might know, the Military faction has been developed by Petroglyph, but just disabled and left unfinished as the game design changed. My hope was that enabling the faction was a quick and straightforward process.

The first thing I did was take a look at XML\Factions.xml. Here I found the Military faction. It has its <Is_Human_Playable> property set to No, so I changed it to Yes and checked the game. No luck, still just three factions in the skirmish setup dialog.

With UaW's move to more Lua, I figured that there must be some Lua code that fills these selection boxes with a list of factions, so I looked in Scripts\GUI and, as expected, found a file Skirmish_Setup_Dialog.lua (there seems to be a file for every dialog in the game). In the initialization code I noticed event handlers for the user clicking the "up" and "down" button for a faction scroller:
this.Register_Event_Handler("Ready_Clicked", nil, On_Ready_Clicked)
this.Register_Event_Handler("Player_Faction_Up_Clicked", nil, On_Player_Faction_Up_Clicked)
this.Register_Event_Handler("Player_Faction_Down_Clicked", nil, On_Player_Faction_Down_Clicked)
this.Register_Event_Handler("Player_Team_Up_Clicked", nil, On_Player_Team_Up_Clicked)
this.Register_Event_Handler("Player_Team_Down_Clicked", nil, On_Player_Team_Down_Clicked)
this.Register_Event_Handler("Player_Color_Up_Clicked", nil, On_Player_Color_Up_Clicked)
this.Register_Event_Handler("Player_Color_Down_Clicked", nil, On_Player_Color_Down_Clicked)
this.Register_Event_Handler("Player_Difficulty_Up_Clicked", nil, On_Player_Difficulty_Up_Clicked)
this.Register_Event_Handler("Player_Difficulty_Down_Clicked", nil, On_Player_Difficulty_Down_Clicked)

The "up" handler (the function On_Player_Faction_Up_Clicked) contained, among others, the following code:
-- THE BIG FACTIONS
PG_FACTION_ALL		= Declare_Enum(1)
PG_FACTION_NOVUS	= Declare_Enum()
PG_FACTION_ALIEN	= Declare_Enum()
PG_FACTION_MASARI	= Declare_Enum()
PG_FACTION_MILITARY	= Declare_Enum()
PG_FACTION_NEUTRAL	= Declare_Enum()

PG_SELECTABLE_FACTION_MIN = PG_FACTION_NOVUS
PG_SELECTABLE_FACTION_MAX = PG_FACTION_MASARI

-- String form factions for networking
PG_FACTION_NOVUS_STRING = "Novus"
PG_FACTION_ALIEN_STRING = "Alien"
PG_FACTION_MASARI_STRING = "Masari"
PGFactionStringLookup = {}
PGFactionStringLookup[PG_FACTION_NOVUS] = PG_FACTION_NOVUS_STRING
PGFactionStringLookup[PG_FACTION_ALIEN] = PG_FACTION_ALIEN_STRING
PGFactionStringLookup[PG_FACTION_MASARI] = PG_FACTION_MASARI_STRING

-- Localized wide strings for user display.
PGFactionLocalizedLookup = {}
PGFactionLocalizedLookup[PG_FACTION_NOVUS] = Get_Game_Text("TEXT_FACTION_NOVUS")
PGFactionLocalizedLookup[PG_FACTION_ALIEN] = Get_Game_Text("TEXT_FACTION_ALIEN")
PGFactionLocalizedLookup[PG_FACTION_MASARI] = Get_Game_Text("TEXT_FACTION_MASARI")
PGFactionLocalizedLookup[PG_FACTION_MILITARY] = Get_Game_Text("TEXT_FACTION_MILITARY")
PGFactionLocalizedLookup[PG_FACTION_NEUTRAL] = Get_Game_Text("TEXT_FACTION_NEUTRAL")

-- Textures
PGFactionTextures = {}
PGFactionTextures[PG_FACTION_NOVUS] = "i_logo_novus.tga"
PGFactionTextures[PG_FACTION_ALIEN] = "i_logo_aliens.tga"
PGFactionTextures[PG_FACTION_MASARI] = "i_logo_masari.tga"
	
-- Maria 07.03.2007
PGFactionNameToFactionTexture = {}
PGFactionNameToFactionTexture["NOVUS"]	= PGFactionTextures[PG_FACTION_NOVUS]
PGFactionNameToFactionTexture["ALIEN"]	= PGFactionTextures[PG_FACTION_ALIEN]
PGFactionNameToFactionTexture["MASARI"]	= PGFactionTextures[PG_FACTION_MASARI]
I changed PG_SELECTABLE_FACTION_MAX from PG_FACTION_MASARI to PG_FACTION_MILITARY. It immediately followed Masari in the list, so the four factions would still form a contiguous range, which is important, otherwise you'd get other factions in the selection box.

The following modifications on this code were also done on the principle that "it was done for the other three playable factions, so I'd better do it for Military as well":
  • Defined PG_FACTION_MILITARY_STRING as "Military"
  • Put PG_FACTION_MILITARY_STRING in the PGFactionStringLookup array.
  • Added "i_logo_military.tga" to the PGFactionTextures array. I checked Art\Textures\MT_CommandBar.mtd to confirm that this file exists.
  • Finally, I also added Military to the PGFactionNameToFactionTexture array.
So, what would these modifications result in?

Posted Image
Aha! We can now select Military as a faction. But would the game actually start?

Posted Image
Promising! I wonder what happens next!

Posted Image
Success! Note that we have a complete Military command bar! It seems we start with 3 Humvees instead of a command center of sorts, but at least we can play Military.


Next chapter I'll try to get it to start with a command center of sorts and see if we can build stuff!


(Do let me know if you're interested or if I'm wasting my time)
Million-to-one chances occur nine times out of ten!

#2 Strategist

Strategist

    Defiler! Fetch!

  • Global Moderator
  • 3,405 posts
  • Gamertag:Strat N8
  • Fav.Game:
  • Gender:Male
  • Location:Habitat Walker #887

Posted 07 May 2008 - 01:04 PM

Mike.nl said:

(Do let me know if you're interested or if I'm wasting my time)

I find it interesting, please continue it. :)

Edited by The Stratigest, 07 May 2008 - 01:05 PM.

Posted Image

#3 willh_879

willh_879

    Banned

  • Banned
  • PipPipPip
  • 385 posts
  • Gamertag:hattmaniac69
  • Gender:Male

Posted 07 May 2008 - 01:43 PM

the command gui doesn't support alot of thing's it's better just editing novus's commandbar or masari's.

lua looks tricky

#4 Kelathin

Kelathin

    Petro Leader

  • Community Supporter
  • PipPipPipPipPipPip
  • 7,174 posts
  • Gamertag:Kelathin
  • Fav.Game:
  • Gender:Male

Posted 07 May 2008 - 02:21 PM

View Postwillh_879, on May 7 2008, 01:43 PM, said:

the command gui doesn't support alot of thing's it's better just editing novus's commandbar or masari's.

lua looks tricky
Mike.nl has the GUI editor.
Posted Image
Personal opinions are supported by personal beliefs alone. Did you know my duck avatar makes me eviler than you?
Posted Image

#5 A13W

A13W

    Follower

  • Members
  • PipPip
  • 292 posts
  • Gamertag:A13W
  • Fav.Game:
  • Gender:Male
  • Location:Somewhere in the Bay Area

Posted 07 May 2008 - 04:22 PM

Ah, yes, I was sure that enabling the military faction would be in the luas. Thanks for the info and nice tutorial :D . Cant wait for the mod tools so my "team" can atcualy start coding the real stuff.

Quote

Fluffeh Kitteh: rawr~


#6 clue

clue

    Ascended Petrotopian

  • Members
  • PipPipPipPipPip
  • 2,601 posts
  • Gamertag:majortheta
  • Fav.Game:
  • Gender:Male
  • Location:Naos

Posted 07 May 2008 - 04:31 PM

interesting, please continue
Posted Image

#7 MightyGOD

MightyGOD

    Follower

  • Members
  • PipPip
  • 104 posts
  • Gamertag:MightyGOD
  • Location:Behind you with a chainsaw...

Posted 07 May 2008 - 06:59 PM

Awesome, please continue! Then make it into a mod! Woo! =D!
Posted Image

"Gods don't die."

Look me up! Just don't annoy me.

Quagmire: "Its not rape, Its surprise sex!"

Im also know as "Funnyhalo" on other websites.

#8 Vlamic

Vlamic

    Acolyte

  • Members
  • Pip
  • 48 posts
  • Gamertag:Blamic
  • Gender:Male

Posted 07 May 2008 - 07:27 PM

Awesome. I'm looking forward to reading the next part.

i had been wondering how you could add a 4th faction...

#9 ChessRules

ChessRules

    Ringo... Mogire... BEAM!

  • Members
  • PipPipPipPipPip
  • 1,293 posts
  • Gamertag:AvTorch

Posted 07 May 2008 - 09:20 PM

I'd definitely like to see this continue.  I'd wanted an underpowered-but-viable Military faction for some tinkering around in the map editor (when it comes out) anyways.

Edited by ChessRules, 07 May 2008 - 09:20 PM.

Posted Image

"I don't think you fully appreciate the situation, Private!  The only thing standing between these things and your family is me, you, and ten thousand rounds of ammo!"

#10 Thundertactics

Thundertactics

    Gentle Manne of Leisure

  • Members
  • PipPipPipPipPip
  • 2,490 posts
  • Gamertag:Thundertactics
  • Fav.Game:
  • Gender:Male
  • Location:The Netherlands

Posted 08 May 2008 - 06:44 AM

Yay!
I've been fiddling with those things myself too...
Only I ended up with Military selectable, but when I started the skirmish all I got was an empty map...
(And also, no command bar, just nothing on it...)

Yes! Continue indeed!
Posted Image

#11 Mike.nl

Mike.nl

    Mad Computer Scientist

  • Global Moderator
  • 1,611 posts
  • Gamertag:RationalMike
  • Fav.Game:
  • Gender:Male
  • Location:The Netherlands

Posted 09 May 2008 - 03:36 PM

Chapter 2 - Creating a builder unit

Last thing I did was getting Military playable with 3 humvee's at skirmish start.

Changing the starting units

In order to replace those with something else, I had to find where the starting forces are defined.
In UaW, each unit has it's own XML file, so the Humvee's file was easy to find: XML\Units\Military_Veh_Hummer.xml. This file contains the base humvee unit and several related and derived units such as death clones and props. The main humvee unit's name is "Military_Hummer". That gave a me an object name to search for. A quick grep later and I found that Scripts\Story\DefaultLandScript.lua defines each faction's starting forces in the aptly-named function, Define_Starting_Forces:
function Define_Starting_Forces()
	StartingForces = { 
		[Find_Player("Alien").Get_Faction_Name()] = {
			"ALIEN_ARRIVAL_SITE",
			"ALIEN_GLYPH_CARVER",
		},
		[Find_Player("Novus").Get_Faction_Name()] = {
			"NOVUS_REMOTE_TERMINAL",
			"NOVUS_CONSTRUCTOR",
		},
		[Find_Player("Masari").Get_Faction_Name()] = {
			"MASARI_FOUNDATION",
			"MASARI_ARCHITECT",
		},
		[Find_Player("Military").Get_Faction_Name()] = {
			"MILITARY_HUMMER",
			"MILITARY_HUMMER",
			"MILITARY_HUMMER",
		},
	}
end
So, I could now make the Military start with whatever I liked. The next question was: with what? For that I needed to do an inventory of the Military's units and their capabilities. A look over all the Units and Structures XML files gave me a list of objects. I looked those up in ProductionDependencies.xml, which contains an entry for every way a unit can be produced, or every dependency it has. This gave me the following list of units, object names, and their production objects:

Built from Military_Barracks:
- Military_Team_Flamethrower
- Military_Team_Marines
- Military_Medic
- Military_Team_Rocketlauncher
- Military_Team_Science

Build from Military_Motor_Pool:
- Military_AbramsM2_Tank
- Military_Defender_APC
- Military_Hummer

Built from Military_Aircraft_Pad:
- Military_Apache
- Military_Dragonfly_UAV
- Military_Maverick_Jet

Not buildable:
- Military_Hero_Randal_Moore
- Military_Hero_Tank ("Thumper")
- Military_Artillery (uses same model as Military_AbramsM2_Tank)
- Military_Dragoon_MTRV
- Military_Builder_Rig (uses same model as Military_Dragoon_MTRV)
- Military_Aircraft_Pad
- Military_Supply_Depot
- Military_Motor_Pool
- Military_Drop_Zone
- Military_Barracks
- Military_Turret_Ground

Special:
- Military_Supply_Drone auto-spawns from Military_Supply_Depot by Lua code.
So, there are quite a few units that can be used, and given that the game already has a designated Builder Rig, that seemed a logical choice for a builder unit. So, I replaced those three Humvee lines with a line with the Builder Rig's object name:
[Find_Player("Military").Get_Faction_Name()] = {
	"MILITARY_BUILDER_RIG",
},
and checked in-game (always check often if you're not sure if a change will have effect):
Posted Image

The search for builder selection

Okay, so the unit is there, but it's missing a tooltip and has the Marine Squad selection audio. Those two issues can be fixed later (it's wise to put this kind of stuff on a list when you come across them, so you don't forget), but first I had to get this unit to build stuff because as you might have noticed, the unit is selected, but there is no build menu. Even worse, the unit wasn't even recognized as a builder. Pressing Z (next idle builder) did not select the unit. Regardless of whether it had anything to build, it should be recognized as a builder, I figured. So in order to find how UaW determines the next idle builder, I grepped for Idle_Builder, which resulted in Scripts\GUI\KeyboardGameCommands.lua, which contained the following:
["COMMAND_FIND_BUILDER"] = 
{
   text_id = "TEXT_UI_TACTICAL_IDLE_BUILDER_BUTTON",
   display = true,	
   can_be_re_assigned = true,
   sort_order = 3
},
Supposing that COMMAND_FIND_BUILDER was the internal name for the command, I grepped for that term and found Scripts\GUI\KeyboardMappingsHandler.lua, which contained:
elseif game_command == COMMAND_FIND_BUILDER then 
	-- single press selects builder, double press selects builder and points camera at selected builder.
	Find_Builder(is_double_key_press)
The Find_Builder function was in the same file:
function Find_Builder(is_double_key_press)
	if not is_double_key_press then
		Select_Next_Builder()
	else
		Point_Camera_At_Next_Builder()
	end
end
So, as Select_Next_Builder wasn't in that file, I grepped it. This resulted in only one other hit,
Scripts\GUI\Tactical_Command_Bar_Common.lua:
function Select_Next_Builder()
	-- this check is needed since we may be trying to select a builder via a hot key!
	if not TestValid(BuilderButton) or BuilderButton.Get_Hidden() == true then 
		-- no builders to select!
		return
	end
	
	Send_GUI_Network_Event("Networked_Select_Next_Builder", { Find_Player("local"), Get_Cursor_World_Position(), Is_Shift_Key_Down() })	
end
So, maybe the unit was a builder after all, but the UI simply didn't have this BuilderButton or it was hidden. Searching for that word led me to the initialization function, which contained this fragment:
if TestValid(this.CommandBar.BuilderButton) then
	BuilderButton = this.CommandBar.BuilderButton
Using the GUI Editor, I checked if the Military Commandbar had a button called "BuilderButton". It didn't. Aha, time to add it.

Changing the Military's UI

I simply made a copy of the Novus' button for the time being. Once it works, the art can be changed. After looking at GUI\Novus_Tactical_Command_Bar.bui, I saw that the BuilderButton was a reference to Novus_Building_Button.bui, so I copied GUI\Novus_Building_Button.bui to GUI\Military_Building_Button.bui and added a reference to it in GUI\Military_Tactical_Command_Bar.bui. I also noticed that the button contained the icon of a Novus plane, and not a Constructor, so I figured there must be some Lua code that sets the icon. Back in Tactical_Command_Bar_Common.lua I looked for uses of BuilderButton and found this:
-- Set the proper texture for this button!.
BuilderButton.Set_Texture( PlayerToIdleBuilderTexturesMap[LocalPlayer.Get_Faction_Name()])
Looking for PlayerToIdleBuilderTexturesMap, I found this:
function Init_Idle_Builder_Textures()
	PlayerToIdleBuilderTexturesMap = {}
	PlayerToIdleBuilderTexturesMap[Find_Player("Alien").Get_Faction_Name()] = "i_icon_a_idle_builder.tga"
	PlayerToIdleBuilderTexturesMap[Find_Player("Novus").Get_Faction_Name()] = "i_icon_n_idle_builder.tga"
	PlayerToIdleBuilderTexturesMap[Find_Player("Masari").Get_Faction_Name()] = "i_icon_m_idle_builder.tga"
end
So I added Military to that array. In MT_CommandBar_Military_MegaTexture.mtd there was no equivalent builder button, so I took i_icon_n_idle_builder.tga from MT_CommandBar_Novus_MegaTexture.mtd and inserted it as i_icon_m_idle_builder.tga in MT_CommandBar_Military_MegaTexture.mtd. Note that because the textures are taken from different MTD files, the military's icon can have the same name as the Masari's icon.

Registering the builder

After this however, the button still did not appear in-game. After finding some other uses of BuilderButton, I came across this code in an update function:
if TestValid(BuilderButton) then 
	local player_script = LocalPlayer.Get_Script()
	local hide_builder_button = true
	if player_script and player_script.Get_Async_Data("BuildersCount") > 0 then
		hide_builder_button = false
	end
	
	if hide_builder_button ~= BuilderButton.Get_Hidden() then 
		BuilderButton.Set_Hidden(hide_builder_button)
	end
end
This code seems to show or hide the BuilderButton depending on "BuildersCount" being zero. Made sense. No builders, no need to have a button to select one. BuildersCount is taken from the player script, which would be Scripts\Miscellaneous\Military_Player.lua, as indicated by the following code in the Military's entry in Factions.xml:
<Lua_Script>Military_Player</Lua_Script>
However, "BuildersCount" did not appear in that Lua file. After comparing with the Novus_Player.lua file, I found that Military_Player.lua was severely lacking in functionality. Most notably, Military_Player.lua contained the following:
function Get_Builders_Count()
	return 0 
end
which seems to hardcode the number of builders at zero. It also did not include, like the three other factions' Luas do, Player_Common.lua. So, I removed the senseless Get_Builders_Count function from Military_Player.lua, added require("Player_Common") and added a call to Common_Player_Definitions() in the Definitions function, to initialize Player_Common.lua, just like the other Luas do.

Still, however, the button did not show up. I looked where this "BuildersCount" count variable was set, and found it was managed by TacticalBaseBuildersManager.lua, which was included by Player_Common.lua. I found that that file defined several functions to manage builder units:
function Add_Builder(builder)
function On_Builder_Destroyed(builder)
function Remove_Builder(builder)
function Update_Builders_List()
fucntion Select_Next_Idle_Builder(target_position, select_all)
I grepped Add_Builder to see where it was called and found it was called from TacticalBaseBuilder.lua:
local function Behavior_First_Service()
	-- Tell the builder management system that we're around
	if TestValid(Object) and OwnerScript then 
		OwnerScript.Call_Function("Add_Builder", Object )
	end
end
Grepping for TacticalBaseBuilder resulted only in the XML files for the three factions' builder units. This looked promising! Looking in ALIEN_INF_Glyph_Carver.xml, I found its use here:
<BehaviorType Name="LuaScriptBehaviorType">
  <Lua_Land_Behaviors> TacticalBaseBuilder </Lua_Land_Behaviors>
  <Lua_Script_Data>
	BUILDER_DATA = {}
	BUILDER_DATA.ABILITY_NAME = "Alien_Tactical_Build_Structure_Ability"
  </Lua_Script_Data>
</BehaviorType>
In hindsight, it's obvious. This LuaScriptBehaviorType behavior links a Lua script to the object. The lua script registers the builder to the player script, and the number of registered builders is also used to show or hide the builder button.

I copied the behavior to the Builder_Rig's XML and checked. Finally, the "Select Idle Builder" button showed up, and clicking it selected the Builder Rig.

Fixing the textures

However, the button was completely white. Something went wrong there. Looking at GUI\Military_Building_Button.bui, I saw that it used textures such as i_novus_bulding_notselected_notover_notclicked.tga, which contain the various border around the button for various selection, clicked, etc states. These textures were not present in MT_CommandBar_Military_MegaTexture.mtd, so the game used a white texture. I solved this by extracting all used textures (six of them) from Novus' command bar MTD and inserting them into the Military's command bar MTD. Checking in-game, I now had a fully functional "Find Builder" button:

Posted Image

Obviously, it's location and art would be changed later.


Next chapter, I hope to have the builder actually able to build stuff!
Million-to-one chances occur nine times out of ten!

#12 MightyGOD

MightyGOD

    Follower

  • Members
  • PipPip
  • 104 posts
  • Gamertag:MightyGOD
  • Location:Behind you with a chainsaw...

Posted 09 May 2008 - 11:49 PM

Wow, Mike.nl, nice job!

Good job so far! GOOD LUCK! Please continue! I could never learn Lua...heh.

Edited by MightyGOD, 09 May 2008 - 11:55 PM.

Posted Image

"Gods don't die."

Look me up! Just don't annoy me.

Quagmire: "Its not rape, Its surprise sex!"

Im also know as "Funnyhalo" on other websites.

#13 Freno

Freno

    Disciple of Petroglyph

  • Retired Staff
  • PipPipPip
  • 339 posts
  • Gender:Female
  • Location:Australia

Posted 10 May 2008 - 02:36 AM

Great job, please continue. :) This is really quite interesting.

#14 Thundertactics

Thundertactics

    Gentle Manne of Leisure

  • Members
  • PipPipPipPipPip
  • 2,490 posts
  • Gamertag:Thundertactics
  • Fav.Game:
  • Gender:Male
  • Location:The Netherlands

Posted 10 May 2008 - 04:29 AM

Great man!
Please continue!
Posted Image

#15 Raptor 4000

Raptor 4000

    Petrotopian

  • Members
  • PipPipPipPip
  • 714 posts
  • Gamertag:AeroBlitzWing
  • Gender:Male
  • Location:Waging war in a far off location.

Posted 21 June 2008 - 04:44 AM

Question: When i look at something like that in notepad (\SCRIPTS\STORY\DEFAULTLANDSCRIPT.XML) or even FileBig, i get a load of senseless gibberish that looks like this:
LuaQp			 	       @@ @ 
         	@   	@   	   	@   	   	@   	   	@   	   	@   	   	@   	   	@   	   	@   	   	@   	   	@   	   	@   	   	@   	   	@   	   	@   	   	@  @  A @  A 	 @  A@	 @  A	 @  A	 @  A 
 @  A@
 @  A
 @  A
 @  A  @ $   @ $@   $   $     $  @  $@   $   $  
 $  @
 $@ 
 $ 
 $   $  @ $@  $  $   $  @ $@  $  $   $  @ $@  $  $   $  @ $@  $  $   $  @ $@  $  $   $  @ $@  $  $   $ 	 @ $@	  $	  $	   $ 
 @ $@
  $
  $
   $  @ $@  $  $   $   @ $@   $   $    $ 
 @ $@
  $
  $
   $  @ $@    g      LuaGlobalCommandLinks    @A  C  BC   B  C  B   @  A  B  B  A  B  B  TB  8B  B   C  `A  B  dB  ?  PB  A  C  B  B  C  B   A  LB	   LUA_PREP    require    PGStateMachine    PGMovieCommands    PGAchievementAward    PGOnlineAchievementDefs    PGVictoryConditionDefs 
   PGObjectives    PGHintSystemDefs 
   PGHintSystem    Story_Campaign_Hint_System 
   UIControl    Define_Starting_Forces    Radar_Map_Left_Clicked    Radar_Map_Right_Clicked    Map_Mouse_Wheel_Rotate    Map_Mouse_Wheel_Zoom    Map_Mouse_Wheel_Press    Map_Right_Click_Scroll    Create_Forces    Look_At_Starting_Marker 	Setup_Teams    Set_Player_Alliances    Setup_Teams_For_Campaign_Game    Cache_Walkers    Network_Game_Setup    Get_Random_Table_Value 	Definitions    Close_All_Huds 
   movie_thread    Run_Cinematic_Benchmark #   Initialize_Persistence_Based_State    Strategic_Spy_FOW_Reveal    State_Init    Initialize_Game *   Thread_Masari_Story_Campaign_Limit_Income /   Thread_Masari_Story_Campaign_Limit_Income_Loop %   Masari_Story_Campaign_Tactical_Hints *   Masari_Story_Campaign_Attribute_Modifiers    Initialize_Medals    Apply_Medal_Effects    Initialize_DEFCON !   Notify_Player_Defcon_Level_Start    Service_DEFCON    Set_Multiplayer_Client_Models    Objectives_Test    Callback_Alien_Hero_Killed    Callback_Novus_Hero_Killed    Force_Victory 	Show_Earned_Achievements_Thread 	End_Mission    Skirmish_Game_End_Thread    Announce_Game_End_Thread    Process_GC_Data    Process_GC_Endgame    Is_Scenario_Campaign    Validate_GC_Data    Is_GC_Globe_Conquered    Clear_GC_Globe    Lose_GC_Regions    Initialize_Victory_Monitoring    On_Construction_Complete    On_Victory_Object_Killed    Test_For_Victory_Event_Based    Test_For_Victory_Periodic    Is_Victory_Relevant    Notify_Faction_Eliminated    Pre_Save_Callback    Post_Load_Callback    Kill_Unused_Global_Functions :	   _   s   	     
  J      b@ 

how do you translate this?
Raptor 4000,ready to wage war!

My forum!

Posted Image

#16 Valdez

Valdez

    (・ ω ・)

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,633 posts
  • Gamertag:GFWL Valdez
  • Fav.Game:
  • Gender:Male
  • Location:Singapore

Posted 21 June 2008 - 05:06 AM

have you tried Wordpad instead of Notepad? I can view XML files in Wordpad.

Posted Image


#17 Mike.nl

Mike.nl

    Mad Computer Scientist

  • Global Moderator
  • 1,611 posts
  • Gamertag:RationalMike
  • Fav.Game:
  • Gender:Male
  • Location:The Netherlands

Posted 21 June 2008 - 07:26 AM

First, why is this in this thread?

Second, you don't. This is a compiled Lua file. You can't edit those. I was working with the Lua source that came with the Mod Tools beta.
Million-to-one chances occur nine times out of ten!

#18 A13W

A13W

    Follower

  • Members
  • PipPip
  • 292 posts
  • Gamertag:A13W
  • Fav.Game:
  • Gender:Male
  • Location:Somewhere in the Bay Area

Posted 21 June 2008 - 04:51 PM

Thanks for the Tutorials Mike. Just a suggestion, it might be better to use the MV_BUILDBOT_ARMS.alo model. It looks much more like a military builder.

Quote

Fluffeh Kitteh: rawr~


#19 Mike.nl

Mike.nl

    Mad Computer Scientist

  • Global Moderator
  • 1,611 posts
  • Gamertag:RationalMike
  • Fav.Game:
  • Gender:Male
  • Location:The Netherlands

Posted 21 June 2008 - 06:12 PM

Well, whatever I use, I'm still stuck on getting stuff buildable :(
Million-to-one chances occur nine times out of ten!

#20 A13W

A13W

    Follower

  • Members
  • PipPip
  • 292 posts
  • Gamertag:A13W
  • Fav.Game:
  • Gender:Male
  • Location:Somewhere in the Bay Area

Posted 22 June 2008 - 03:12 AM

Have you given the builder unit the build abbility? How are you stuck?

Edited by A13W, 22 June 2008 - 03:21 AM.

Quote

Fluffeh Kitteh: rawr~





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users