For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Weird iteration problem

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
Raven
OldUnreal Member
Posts: 311
Joined: Fri Jun 10, 2005 5:10 am

Weird iteration problem

Post by Raven »

I'm using iterator in PreRender and I have one big problem. I'm using iterator to find dynamic corona and draw it on the screen (HUD modification allows to many kwl effects). So when DynamicCorona is too far from map center iterator returns... none.

Code: Select all

        ForEach PlayerPawn(Owner).VisibleActors(class'DynamicCorona', Other)
        {
              BroadCastMessage("Corona Found");
        }
No matter what I'm doing when I'm too far from map center foreach returns none. Another bug is that corona is drawn OVER weapon not beneath it (no matter if it's drawn in prorender/postrender/renderoverlays).
Image
Pcube

Re: Weird iteration problem

Post by Pcube »

When performing an iteration, specifically one that checks within a certain radius, the origin of the radius is defined as the location of the actor calling the iterator.

I've never tried using such syntax (foreach Playerpawn(Owner).visiblecollidingac..), but chances are that the radius checks are being drawn from the HUD's location, not the player's. Make use of the optional parameter (tracestart or whatever it's called) to clearly define where the radius checks should issue forth from. Also, you're using VisibleActors.. is the emitter hidden? That could also be the problem.
User avatar
Raven
OldUnreal Member
Posts: 311
Joined: Fri Jun 10, 2005 5:10 am

Re: Weird iteration problem

Post by Raven »

Didn't thought of that optional location :). And nope DynamicCorona is not hidden (has DrawType none - works near center of the map). Will check this tomorrow, tnx/
Image
User avatar
Raven
OldUnreal Member
Posts: 311
Joined: Fri Jun 10, 2005 5:10 am

Re: Weird iteration problem

Post by Raven »

nope - it doesn't work. and PlayerPawn(Owner).VisibleActors mens that it's checked from player's location.
Image
User avatar
Bane
OldUnreal Member
Posts: 493
Joined: Sun Mar 03, 2002 6:32 pm

Re: Weird iteration problem

Post by Bane »

VisibleActors has an optional parameter for radius, which you aren't supplying. The language reference unfortunitely doesn't say what the default behavior is when no radius is specified. I'd suggust trying it with a large radius, one that's bigger than the dimensions of the test area and see if that fixes the problem.
Author of Hide and Seek mod, and the NALIBALL mod

Hide and Seek can be downloaded from:
http://HideNSeek.5u.com
User avatar
Raven
OldUnreal Member
Posts: 311
Joined: Fri Jun 10, 2005 5:10 am

Re: Weird iteration problem

Post by Raven »

Tried that. If Radius parameter is not supplied it'll iterate through all visible (means bHidden=false) actors in the level. It's very strange behavior because normally it works fine.
Image
User avatar
Bane
OldUnreal Member
Posts: 493
Joined: Sun Mar 03, 2002 6:32 pm

Re: Weird iteration problem

Post by Bane »

Through all of them? I thought VisibleActors also did a simple trace to make sure you can see them. I could be wrong, though. I don't think I've ever actually used it.
Author of Hide and Seek mod, and the NALIBALL mod

Hide and Seek can be downloaded from:
http://HideNSeek.5u.com
User avatar
[]KAOS[]Casey
OldUnreal Member
Posts: 4497
Joined: Sun Aug 07, 2011 4:22 am
Location: over there

Re: Weird iteration problem

Post by []KAOS[]Casey »

is this in netplay? if so try setting the corona's balwaysrelevant to true, that at least prevents it from not replicating for the most part
User avatar
Raven
OldUnreal Member
Posts: 311
Joined: Fri Jun 10, 2005 5:10 am

Re: Weird iteration problem

Post by Raven »

Yes it does do a simple tracing - thats why i'm using it (no need of checking if corona is visible or not ;))
No - it's in sp...

You see when i'm walking near (~3000 uu) map center - even in corridors/small rooms everything - coronas works fine. The moment I'm going too far - for each doesn't work.
Image
User avatar
[]KAOS[]Casey
OldUnreal Member
Posts: 4497
Joined: Sun Aug 07, 2011 4:22 am
Location: over there

Re: Weird iteration problem

Post by []KAOS[]Casey »

If i remember right, a standard trace doesn't work after a long distance, try shooting the rifle/automag at the ceiling from the long pass in thesunspire, and if the foreach trace uses the same trace.. this would fall under the category to be fixed in 227, lol
Last edited by []KAOS[]Casey on Fri Oct 19, 2007 10:33 pm, edited 1 time in total.
User avatar
.:..:
OldUnreal Member
Posts: 1637
Joined: Tue Aug 16, 2005 4:35 am

Re: Weird iteration problem

Post by .:..: »

Try something like:

Code: Select all

local vector CamLoc;
local rotator CamRot;
local Actor CamAct;

PlayerPawn(Owner).PlayerCalcView(CamAct,CamLoc,CamRot);
ForEach VisibleActors(class'DynamicCorona', Other,,CamLoc)
{
      BroadCastMessage("Corona Found");
}
And see if that works.
1823223D2A33224B0 wrote:...and now im stuck trying to fix everything you broke for the next 227 release xD :P
(ಠ_ಠ)
User avatar
TCP_Wolf
Administrator
Posts: 1078
Joined: Sun Mar 03, 2002 12:04 pm

Re: Weird iteration problem

Post by TCP_Wolf »

If i remember right, a standard trace doesn't work after a long distance, try shooting the rifle/automag at the ceiling from the long pass in thesunspire, and if the foreach trace uses the same trace.. this would fall under the category to be fixed in 227, lol
If I remember correctly that's because in the code Epic put a range limit to the weapon trace function. You enter a larger parameter, it traces farther. I do believe there is an engine limit too though, so supplying trace with outrageously high values will not do much good.
-=]HONESTY PAYS[=-
User avatar
Raven
OldUnreal Member
Posts: 311
Joined: Fri Jun 10, 2005 5:10 am

Re: Weird iteration problem

Post by Raven »

doesn't work :(
Image
User avatar
Turboman.
OldUnreal Member
Posts: 898
Joined: Tue Feb 04, 2003 6:40 pm

Re: Weird iteration problem

Post by Turboman. »

this might not be of any help to you but...

if i remember the unreal 97 beta actually has dynamic coronas in a certain way, the coronas can be attached to movable objects (they are frequently used on enemy muzzle flashes infact), and they correctly respond to lighteffects like flickering or disabled lights... one can only wonder why epic disabled/broke this

Return to “UScript Board”