I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX
Difference between revisions of "User:OlympusMons/UTData FactoryReplacer"
From Unreal Wiki, The Unreal Engine Documentation Site
OlympusMons (Talk | contribs) (New page: ==Introduction== ==Code== {{Infobox class | class = UTData_FactoryReplacer | game = UT3 | engine = UE3 | custom = yes | parent1 = UTData | parent2 = Object }} ==Enums== ====Factor...) |
m |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | {{Template:Delete}} | ||
==Introduction== | ==Introduction== | ||
Line 4: | Line 5: | ||
==Code== | ==Code== | ||
{{Infobox class | {{Infobox class | ||
+ | | package = MutatorFramework | ||
| class = UTData_FactoryReplacer | | class = UTData_FactoryReplacer | ||
| game = UT3 | | game = UT3 | ||
Line 37: | Line 39: | ||
; [[string]] Map : Settings for this Map Named. | ; [[string]] Map : Settings for this Map Named. | ||
− | ; [[array]]<[[UTData_FactoryReplacer# | + | ; [[array]]<[[UTData_FactoryReplacer#FactoryReplacer]]> FactoriesToReplace : Number of channels that are available in this slot. |
==Functions== | ==Functions== | ||
Line 47: | Line 49: | ||
{{code|function '''AddDummyMapEntry''' ([[string]] '''CurrentMap''')}} | {{code|function '''AddDummyMapEntry''' ([[string]] '''CurrentMap''')}} | ||
====AddPerMapEntry==== | ====AddPerMapEntry==== | ||
− | {{code|function '''AddPerMapEntry''' ([[int]] '''iMap''', {{ | + | {{code|function '''AddPerMapEntry''' ([[int]] '''iMap''', {{cl|PickupFactory}} '''Factory''')}} |
====UpdatePerMapEntry==== | ====UpdatePerMapEntry==== | ||
− | {{code|function '''UpdatePerMapEntry''' ([[int]] '''iMap''', {{ | + | {{code|function '''UpdatePerMapEntry''' ([[int]] '''iMap''', {{cl|UE3:PickupFactory|NavigationPoint}} '''Factory''')}} |
− | + | {{tl}} | |
==Source== | ==Source== | ||
<uscript> | <uscript> | ||
Line 145: | Line 147: | ||
local int iFactory; | local int iFactory; | ||
− | if(Factory | + | if(Factory != None) return; |
iFactory = PM_FactorySet[iMap].FactoriesToReplace.Find('ReplacedFactory', Factory.Name); | iFactory = PM_FactorySet[iMap].FactoriesToReplace.Find('ReplacedFactory', Factory.Name); |
Latest revision as of 01:28, 12 January 2010
This page has been proposed for deletion. If you think this page should be kept, please state a reason on its talk page. |
Introduction
Code
- Package:
- MutatorFramework
Enums
FactoryType
Enum to set the type of factory we are dealing with.
- FT_None
- Factory does not have a type.
- FT_Health
- FT_Armour
- FT_Powerup
- FT_SPowerup
- FT_Weapon
- FT_SWeapon
- FT_Vehicle
- FT_SVehicle
Structs
FactoryReplacer
Global Factories to replace.
- FactoryType FactoryGroup
- name ReplacedFactory
- name ReplacedWithFactory
- string ReplacedWithFactoryPath;
MapFactoryReplacerSet
Factories to replace on a Per Map basis - Get from global when not found.
- string Map
- Settings for this Map Named.
- array<UTData_FactoryReplacer#FactoryReplacer> FactoriesToReplace
- Number of channels that are available in this slot.
Functions
Length
function int Length ()
SetupPerMapData
AddDummyMapEntry
function AddDummyMapEntry (string CurrentMap)
AddPerMapEntry
function AddPerMapEntry (int iMap, PickupFactory Factory)
UpdatePerMapEntry
function UpdatePerMapEntry (int iMap, NavigationPoint.UE3:PickupFactory Factory)
[[#{{{1}}}|{{{1}}}]]
Source
//=================================================== // Class: UTData_FactoryReplacer // Creation date: 11/08/2008 15:39 // Last updated: 16/12/2008 00:26 // Contributors: OlympusMons(/d!b\) //--------------------------------------------------- //=================================================== class UTData_FactoryReplacer extends UTData Config(FactoryReplacer); /** Factory Group */ enum FactoryType{ FT_None, FT_Health, FT_Ammo, FT_Armour, FT_Powerup, FT_SPowerup, FT_Weapon, FT_SWeapon, FT_Vehicle, FT_SVehicle }; /** Factories to replace on a Per Map basis - Get from global when not found*/ struct FactoryReplacer{ var FactoryType FactoryGroup; var name ReplacedFactory; var name ReplacedWithFactory; //TODO: ReplaceWith=None var string ReplacedWithFactoryPath; //var name NextFactory, LastFactory; };var config array<FactoryReplacer> ReplacerFactories; /** Global Factories to replace */ struct MapFactoryReplacerSet{ var string Map; var array<FactoryReplacer> FactoriesToReplace; //TODO: Linked list of struct? };var config array<MapFactoryReplacerSet> PM_FactorySet; var bool bCheckMapFactoryList; /// Map is not found on the list, create a new entry in the ini using the defaults. var config bool bUsePerMapSettings; /// This mutator uses Per Map Setting from the FactoryReplacer //--------------------------------------------------- function int Length(){ if(ReplacerFactories.Length > 0) return(ReplacerFactories.Length); else return(PerMapFactorySet.Length); } //TODO: Function which outs ReplacerFactories to ReplaceWith() in GameExpansion //TODO: Parse commandline options for this? function SetupPerMapData(int MapIndex, out optional string Options){ local int iFactory; iFactory = MapFactorySettings[iMap].FactoriesToReplace.Find('ReplacedFactory', Factory.Name); if(iFactory == INDEX_NONE) { //Moves Per Map Settings to the Global Array for use. ReplacerFactories[iFactory].ReplacedFactory = PM_FactorySet[iMap].FactoriesToReplace[iFactory].ReplacedFactory; ReplacerFactories[iFactory].ReplacedWithFactory = PM_FactorySet[iMap].FactoriesToReplace[iFactory].ReplacedWithFactory; ReplacerFactories[iFactory].ReplacedWithFactoryPath = PM_FactorySet[iMap].FactoriesToReplace[iFactory].ReplacedWithFactoryPath; } SaveConfig(); } /** Adds Map Name only entry if none is found! */ function AddDummyMapEntry(string CurrentMap){ local MapFactoryReplacementSettings NewPerMapFactorySet; NewPM_FactorySet.Map = CurrentMap; PM_FactorySet.AddItem(NewPerMapFactorySet); // bCheckMapFactoryList = True; SaveConfig(); } function AddPerMapEntry(int iMap, PickupFactory Factory){ local FactoryReplace NewFactoriesToReplace; if(Factory == None) return; //Factory is not in the list, add it! `logd("FactoryList: "$Factory.Name$" added to Per Map Factory List!",,'FactoryReplacer'); NewFactoriesToReplace.ReplacedFactory = Factory.Name; PM_FactorySet[iMap].FactoriesToReplace.AddItem(NewFactoriesToReplace); SaveConfig(); } function UpdatePerMapEntry(int iMap, PickupFactory Factory){ local int iFactory; if(Factory != None) return; iFactory = PM_FactorySet[iMap].FactoriesToReplace.Find('ReplacedFactory', Factory.Name); if(iFactory == INDEX_NONE) { //Factory is in the list... Change it? :S `logd("FactoryList: "$Factory.Name$" Changed!",,'FactoryReplacer'); PM_FactorySet[iMap].FactoriesToReplace[iFactory].ReplacedFactory = Factory.Name; } SaveConfig(); }