View Full Version : hello and need help
legacy-register
08-18-2003, 06:56 PM
Hello i'm new to these forums and am an unrealscript noob, so please excuse my ignorance. I have only been looking at unrealscript for a couple of days now and started thinking about a mutator, a mod, some other stuff and have come up with a couple of questions.
1. The allactors function, if i tell it to iterate over class type 'parent' will it return me all instances of the type parent and all children classes or only the parent? If it doesn't is there a way you can get it or another function to 'get' all classes and sub-classes of said class.
2. I was thinking about a damage modifier and started to digging through the source but couldn't find what i want. I wanted to modify the damage based upon distance traveled or something similar but i couldn't find a way to find a projectile's spawn position, any ideas?
3. Any good tutorial specific to 2k3 out and about i already got the powerpoint and source tut's over at sega500, and got a few on UT but i'd prefer a few on 2k3. Also any tutorials on embeding code in levels would be nice.
4. All advice or suggestions, i've got the source, uncodex, 2225 patched 2k3 install notepad and the aforementioned tutorials any thing else i should look into?
Thanks for any help
legacy-inio
08-21-2003, 02:32 AM
Sometimes questions fall through the cracks. We here at the only-need-4-more-posts-till-i-can-set-a-face show like to catch those questions for a segment we call, back in sorta dark aquash green.
Originally posted by register
1. The allactors function, if i tell it to iterate over class type 'parent' will it return me all instances of the type parent and all children classes or only the parent? If it doesn't is there a way you can get it or another function to 'get' all classes and sub-classes of said class.It wouldn't be very OO-Friendly if it only did objects of exactly that class. Yes, for example AllActors(class 'Actor',theActor) will give you every single actor in the map (because everything in the map descends from Actor). You may want to look into DynamicActors instead, as it's significantly faster if it provides what you need.
2. I was thinking about a damage modifier and started to digging through the source but couldn't find what i want. I wanted to modify the damage based upon distance traveled or something similar but i couldn't find a way to find a projectile's spawn position, any ideas?What about using the distance to the instigator instead?
legacy-CorDharel
08-21-2003, 08:05 AM
Sorry if I bother your discussion, but I would like to ask a question. I'm a big script newbie, and I want to ask: If I want to get a list of all actors, what do I have to take for "theActor"? Do I have to give over an actor? And, if yes, why? :weird:
legacy-inio
08-21-2003, 08:17 AM
I'm not quite sure what you're asking, but AllActors (and DynamicActors) are "iterators". You use them like this:
local Actor A;
foreach(AllActors(class'Actor', A)) {
// loop code here
// gets run once for each actor, with A set to that actor
}
legacy-[BIO]Tech
08-21-2003, 09:58 AM
You need a local instance of actor to use as a holder for the matches the function returns. This isn't just limited to actors though, both functions mentioned can be used to return a list of pawns, actors, controllers, movers etc because they are all subclasses of actor.
ForEach DynamicActors(class'Mover', M)
Looks at the entire list of actors that are not static and only returns the actors that are movers to the instance variable M, one per iteration of course.
Hope that helps.
legacy-register
08-23-2003, 11:06 PM
Thanks for replying to my post, i was pondering using the log function to figure this out. Now that i know about the function i think i will be using it alot.
Inio in regards to using the distance to the instigator, i didn't want to do this because the instigator might have moved from when he fired, especially in the case of rockets. If i can't get the spawn position directly is there a way i could get its velocity and how long its been 'alive'? (From this i can approximate the distance and if i can get its orientation)
legacy-Angelus
08-25-2003, 01:50 PM
Get the instigator's location at the time of fire and save it in a variable somewhere. At least I imagine that would be the easiest way to do it.
Sir_Brizz
08-27-2003, 02:20 PM
allactors is slow if you are looking for visible actors or something...
you can also use CollidingActors, VisibleActors, and some others i believe...
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.