Hi all!
This is my first thread on this forum and sorry for my bad English...
I planning to make my first mutator, but I haven't any experiences in UScript, only in C++ and Java. This mutator will bring back the PipedSwitchWeapon for UT3...
So, my first problem is that dont know how to verify does desired weapon has any ammo or not, because if hasn't then don't change the active weapon to desired one. (Does it possible to change to an empty weapon?)
The second is that down know which variable type is 'weapon'. I read in an article that IsActiveWeapon function is waiting for weapon variable to compare does the Pawn's active weapon is the desired weapon or not.
Here is the uncompleted code (maybe it's totally wrong, but I'm a n00b in this issue
):
If it will work, do I can call it from console by:
..or use it as bind?
I wish to lean the UScript but not in that way to read many articles. I more like trial by error...
This is my first thread on this forum and sorry for my bad English...
I planning to make my first mutator, but I haven't any experiences in UScript, only in C++ and Java. This mutator will bring back the PipedSwitchWeapon for UT3...
So, my first problem is that dont know how to verify does desired weapon has any ammo or not, because if hasn't then don't change the active weapon to desired one. (Does it possible to change to an empty weapon?)
The second is that down know which variable type is 'weapon'. I read in an article that IsActiveWeapon function is waiting for weapon variable to compare does the Pawn's active weapon is the desired weapon or not.
Here is the uncompleted code (maybe it's totally wrong, but I'm a n00b in this issue
![Laugh :lol: :lol:](/styles/smilies/laugh.gif)
Code:
class mpsw3 extends UTMutator;
//MutPipedSwitchWeapon3
bool bMajor = false; //If true then blocks the following piped switches
string ConsoleCommand = "";
function Switch(byte WeaponNumber)
{
if(IsActiveWeapon(WeaponNumber))
{
bMajor = false;
}
else
{
//Here need to check does the desired weapon has any ammo or not
//If hasn't then don't do anything
bMajor = true;
ConsoleCommand = "SwitchWeapon" + " " + WeaponNumber;
//Does it correct? How can I send a console command?
command(ConsoleCommand);
}
}
function Piped(byte WeaponNumber)
{
if(!bMajor)
{
//Here need to check does the desired weapon has any ammo or not
//If hasn't then don't do anything
bMajor = true;
ConsoleCommand = "SwitchWeapon" + " " + WeaponNumber;
//Does it correct? How can I send a console command?
command(ConsoleCommand);
}
}
function Best()
{
if(IsActiveWeapon(GetBestWeapon()))
{
bMajor = false;
}
else
{
//Here need to check does the desired weapon has any ammo or not
//If hasn't then don't do anything
bMajor = true;
ConsoleCommand = "SwitchToBestWeapon";
//Does it correct? How can I send a console command?
command(ConsoleCommand);
}
}
DefaultProperties
{
//What do I need to write here?
}
If it will work, do I can call it from console by:
Code:
;mpsw3 = MutPipedSwitchWeapon3
mutate mpsw3 switch 9 | mutate mpsw3 piped 6 | mutate mpsw3 piped 2
..or use it as bind?
I wish to lean the UScript but not in that way to read many articles. I more like trial by error...