Hmm now you have got me re-thinking if it's a string or not. It's a name of a class so maybe int is better? I think you're better off asking another just incase.
class HaloPawn extends SRHumanPawn;
var array<Frag> haloFragWpns;
var int currFragIndex;
simulated exec function SwapGrenade() {
local int nextFragIndex;
local Inventory inv, prevInv;
nextFragIndex= currFragIndex + 1;
if (nextFragIndex >= haloFragWpns.Length) {
nextFragIndex= 0;
}
for(inv= Inventory; inv != none; inv= inv.Inventory) {
if (inv == haloFragWpns[currFragIndex]) {
log("Replacing"@haloFragWpns[currFragIndex].ItemName@"with"@haloFragWpns[nextFragIndex].ItemName);
if (prevInv != none) {
prevInv.Inventory= haloFragWpns[nextFragIndex];
} else {
Inventory= haloFragWpns[nextFragIndex];
}
haloFragWpns[nextFragIndex].Inventory= haloFragWpns[currFragIndex].Inventory;
currFragIndex= nextFragIndex;
break;
}
prevInv= inv;
}
}
defaultproperties {
RequiredEquipment(2)="HaloPackageName.HaloFragWeapon"
}
Something like this:
class HaloPlayerController extends KFPCServ;
var array<Frag> HaloGrenadeNum;
var int currFragIndex;
simulated exec function SwapGrenade()
{
local int nextFragIndex;
local Inventory inv, prevInv;
nextFragIndex = currFragIndex + 1;
if (nextFragIndex >= HaloGrenadeNum.Length) {
nextFragIndex = 0;
}
for(inv= Inventory; inv != none; inv= inv.Inventory) {
if (inv == HaloGrenadeNum[currFragIndex]) {
log("Replacing"@HaloGrenadeNum[currFragIndex].ItemName@"with"@HaloGrenadeNum[nextFragIndex].ItemName);
if (prevInv != none) {
prevInv.Inventory = HaloGrenadeNum[nextFragIndex];
} else {
Inventory = HaloGrenadeNum[nextFragIndex];
}
HaloGrenadeNum[nextFragIndex].Inventory = HaloGrenadeNum[currFragIndex].Inventory;
currFragIndex = nextFragIndex;
break;
}
prevInv = inv;
}
}
exec function ThrowGrenade()
{
HaloPawn(Pawn).ThrowGrenade();
}
defaultproperties
{
HaloGrenadeNum(0)=Class'HaloTC_Core.HaloGrenade'
HaloGrenadeNum(1)=Class'HaloTC_Core.HaloGrenade'
PawnClass=Class'HaloTC_Core.HaloPawn'
}
Appears the code above fails, will always return a bad cast in class error
var class<Object> varA
var Object varB
Yes because you are assigning values of the wrong type. If you do not understand the difference between:
andCode:var class<Object> varA
then you need to take a step back and review your UnrealScript.Code:var Object varB
HaloGrenadeNum(0)=Class'KFMod.Frag'
HaloGrenadeNum(1)=Class'KFMod.Frag'
ObjectProperty HaloTC_Core.HaloPlayerController.HaloGrenadeNum.HaloGrenadeNum: bad cast in 'Class'KFMod.Frag''
ObjectProperty HaloTC_Core.HaloPlayerController.HaloGrenadeNum.HaloGrenadeNum: bad cast in 'Class'KFMod.Frag''
Sounds great, is it cause of that what you said to me on steam ? c:
var array<HaloGrenade> HaloGrenadeType;
var int currFragIndex;
simulated exec function SwapGrenade()
{
local int nextFragIndex;
local Inventory inv, prevInv;
nextFragIndex = currFragIndex + 1;
if (nextFragIndex >= HaloGrenadeType.Length) {
nextFragIndex = 0;
}
for(inv= Inventory; inv != none; inv= inv.Inventory) {
if (inv == HaloGrenadeType[currFragIndex]) {
log("Replacing"@HaloGrenadeType[currFragIndex].ItemName@"with"@HaloGrenadeType[nextFragIndex].ItemName);
if (prevInv != none) {
prevInv.Inventory = HaloGrenadeType[nextFragIndex];
} else {
Inventory = HaloGrenadeType[nextFragIndex];
}
HaloGrenadeType[nextFragIndex].Inventory = HaloGrenadeType[currFragIndex].Inventory;
currFragIndex = nextFragIndex;
break;
}
prevInv = inv;
}
}
exec function ThrowNade()
{
if (HaloGrenadeType[currFragIndex] != none && HaloWeapon(Pawn.weapon).IsWeaponReady())
{
if ( HaloGrenadeType[currFragIndex].GrenadeAmount > 0 && bZooming)
EndZoom();
HaloGrenadeType[currFragIndex].ThrowGrenade();
}
}
Overlay animations (When you turn the weapon moves slightly depending on the movement parameters in the overlay animation, somewhat like free-aim but more realistic)
Vehicle overlay animations (Same as above except applied to the unit inside the vehicle, like you hit a turn and he leans in the opposite direction)
Moving Animations (Not confirmed impossible yet)
Secondary, and Micro detail maps (used by most levels. Example: BloodGulch, IceFields, Timperland, Deathisland)
Make the pawn play a death animation then turn it into a ragdoll (Not confirmed to be impossible yet)
Sniper zoom distortion (Unknown how to do this, not impossble I'm sure)
Any kind of overlay animation can't be done sadly as far as I know. (All weapons and vehicles use them. Example: the shake that plays when you charge up the plasma pistol, moving animations, and units within vehicles (Plays a overlay animation for left-right, up-down, forward-back))
What is the function of these 'micro detail maps' in halo levels?
I know Detail textures exist in KF however if I recall correctly they are not applied to staticmeshes or terrain. You could possibly apply them with projectors to get extra detail on your terrain.
Personally I would maybe use the Stalkers system for this. I would make it replace the textures you want to both arms, character and weapon. Far easier to implement through a probably a bool and a check for each of the types (so if you made the bool in the controller (maybe better in the pawn thinking of it), the weapon etc would have to be able to access it's return and then give the answer back to them).