UE1 - UT Making class/arrays work together?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Danjun1

New Member
Jul 15, 2010
15
0
0
Hello!

Right, I'm not cleared on how this kind of stuff works, I was wondering if someone can help me what can I do to make stuff like this happen, see this code for an example:-

Code:
Var() class<DeusExCarcass> CarcassClass[32];
var DeusExCarcass Carcass;
var() config bool bIsOn;

function Tick(float deltaTime)
{
local int i;

    if(bIsOn)
    {
        if(CarcassClass[i] != None)
        {
            foreach allActors(class'DeusExCarcass',Carcass)
            {
                  Carcass(CarcassClass[i]).bQueuedDestroy = False;
            }
        }
    }

  Super.Tick(deltaTime);
}

defaultproperties
{
     CarcassClass(0)=Class'KarkianCarcass'
     CarcassClass(1)=Class'KarkianBabyCarcass'
     CarcassClass(1)=Class'GreaselCarcass'
}

As you see of what I'm trying to do is.. that Carcass accesses the CarcassClass and only do stuff AT the carcassclass, which is carcass, but those specific classes on the CarcassClass on defaultproperties ONLY.. This code isn't legitimate, it's just kinda an example.. to try explain what I need..

So anyway, help anyone, please? thanks!
 
Last edited:

Danjun1

New Member
Jul 15, 2010
15
0
0
What I'm trying to do is.. well..

You have this array of class, Carcass, for example, and they're like array of 32... and then you can add these to your default properties, only 32, ofcourse.

Next, what I want to do is that ONLY the classes named/listed on the DefaultProperties get some of their bool edited.. Specific right, Example could be something like.. let's say I'm willing to change some weapon's default properties.. I want their ammo to be changed. I want it to do from a mutator so that even when someone spawns this weapon ingame does have it's default properties changed, too. So what I do is make a mutator with a tick, has an array of class, I add this weapon classname to my default properties, and bingo, It gets it ammo changed every tick.

Hope that example helps? :O
 

brold9999

New Member
Apr 5, 2009
142
0
0
In that case, you probably want to use a regular for loop rather than foreach, which is going to iterate over all instances of a class.

I don't remember if there is a syntax for setting default properties from a class reference but it seems plausible that there is.
 

Danjun1

New Member
Jul 15, 2010
15
0
0
I want to do for every class existing? what do you mean use a loop-method? :S

Well, if there is, anyone can help me here? :$

or any source-free mods that do the same stuff so I can look up?