logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Class<actor> to actor (Read 3849 times)
SFJake
Full Member
***
Offline


Oldunreal member

Posts: 248
Joined: Aug 15th, 2010
Gender: Male
Class<actor> to actor
Mar 9th, 2013 at 11:46pm
Print Post  
Can't wrap my brain around that one. I'm trying to access class<actor> of certain other actors (like CreatureFactory), and get info out of these just like anything else.

However typecasting don't work on class<> the same way and some things (like IsA checks) don't work, which ruins the idea.

If A is actor and C is class<actor>, A=C doesn't work, and neither does typecasting.

So how do I just get A= whatever C is? I don't need to modify C, just know the actual class so I can do checks on it.
  
Back to top
 
IP Logged
 
Bleeder91[NL]
Betatester
Offline


Personal Text:

Posts: 1018
Location: Location, Location, Location.
Joined: Oct 4th, 2009
Gender: Male
Re: Class<actor> to actor
Reply #1 - Mar 10th, 2013 at 12:20am
Print Post  
SFJake wrote on Mar 9th, 2013 at 11:46pm:
A is actor and C is class<actor>

if(A.Class==C);
  
Back to top
 
IP Logged
 
SFJake
Full Member
***
Offline


Oldunreal member

Posts: 248
Joined: Aug 15th, 2010
Gender: Male
Re: Class<actor> to actor
Reply #2 - Mar 10th, 2013 at 1:06am
Print Post  
I don't understand how that is useful?

I just lost 3 hours of work on corrupted script files because I couldn't figure this out... <-< Nevermind, I kept a lucky backup.

I've seen that A = spawn(C) works, but only if C is spawned successfully. Which means I can't use it.

Hey, I just found out that 227 adds SpawnAct, which has a bool to spawn regardless of collision, which makes this usable for checks. Yes! I think that works just fine.
« Last Edit: Mar 10th, 2013 at 2:08am by SFJake »  
Back to top
 
IP Logged
 
GreatEmerald
Oldunreal MasterPoster
*
Offline


The Great Emerald

Posts: 5361
Location: Vilnius, Lithuania
Joined: May 21st, 2007
Gender: Male
Re: Class<actor> to actor
Reply #3 - Mar 10th, 2013 at 8:14am
Print Post  
This is confusing. Are you trying to get a class from an actor, or an actor from a class? And what checks do you need? If you have a class, you can already check all of its default properties.
  
Back to top
WWW  
IP Logged
 
SFJake
Full Member
***
Offline


Oldunreal member

Posts: 248
Joined: Aug 15th, 2010
Gender: Male
Re: Class<actor> to actor
Reply #4 - Mar 10th, 2013 at 4:35pm
Print Post  
Class to actor.

Default properties, yes. I could not check what it was, however. I could not perform IsA check and tell what class it is like I normally can + subclasses. Which meant the only way I could have done that is have an If for every single class specifically or something, unless I missed something.
  
Back to top
 
IP Logged
 
GreatEmerald
Oldunreal MasterPoster
*
Offline


The Great Emerald

Posts: 5361
Location: Vilnius, Lithuania
Joined: May 21st, 2007
Gender: Male
Re: Class<actor> to actor
Reply #5 - Mar 10th, 2013 at 9:39pm
Print Post  
If you have a class, then checking what class it is... is kind of redundant? Trying to do so - casting a class to its parent class - will earn you some harsh words from ucc. It's pointless to do so. What exactly do you want to do with that check?
  
Back to top
WWW  
IP Logged
 
[]KAOS[]Casey
Developer Team
Betatester
Offline


nedm

Posts: 3189
Joined: Aug 7th, 2011
Gender: Male
Re: Class<actor> to actor
Reply #6 - Mar 10th, 2013 at 11:15pm
Print Post  
Class<Actor> A;
...


if(ClassIsChildOf(A,Class'SkaarjWarrior'))
log("A is a subclass of SkaarjWarrior");
else log("crappity smack THIS!");
  
Back to top
 
IP Logged
 
SFJake
Full Member
***
Offline


Oldunreal member

Posts: 248
Joined: Aug 15th, 2010
Gender: Male
Re: Class<actor> to actor
Reply #7 - Mar 10th, 2013 at 11:37pm
Print Post  
See now that is something I didn't know about.

But I've got it down, SpawnAct worked for my purposes and this is not for common gameplay, so I don't mind it being messy.
  
Back to top
 
IP Logged
 
DocHoliday
New Member
*
Offline


Oldunreal member

Posts: 20
Joined: Jun 29th, 2012
Gender: Male
Re: Class<actor> to actor
Reply #8 - Dec 6th, 2013 at 4:35am
Print Post  
casting --->   Weapon(Inventory(Actor)).whatever

You want to use casting, but idk if that is how you do it in Unreal 1 yet...
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo