I have a loop that iterates through all the actors in the map, it stores the last actor into a variable so that the loop can start from that actor instead of iterating through all the actors it already checked, and there is a check if the last actor becomes None, so that the loop will start from a previous non-None actor.
The problem comes when it saves the UTTEleEffect as last actor, it becomes None cause of the LifeSpan, but when my code checks if it isn't None, it returns true and passes the check. Even the logs show the name "UTTEleEffect1", but "cheatview UTTeleEffect" doesn't work, nor "editactor name=UTTeleEffect" nand "editactor class=UTTeleEffect", so why does it still pass the check and log the name of something that is None?
None still accessible.
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: None still accessible.
Maybe the wiki article "What happens when an Actor is destroyed" explains it:
When the Destroy() function (or the replication code that cleans up obsolete replicated actors) returns, the actor object is not actually gone, it just becomes unaccessible by other objects in UnrealScript.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: None still accessible.
That's what I needed, thanks!Barbie wrote:Maybe the wiki article "What happens when an Actor is destroyed" explains it:When the Destroy() function (or the replication code that cleans up obsolete replicated actors) returns, the actor object is not actually gone, it just becomes unaccessible by other objects in UnrealScript.
I guess I can't check if an actor is actually deleted then, unless I make it returns an Accessed None exception lol. Do you think there's a way to use the constant "Deleted" from within Actor.uc, to check the latest deleted actor?
"Your stuff is known to be buggy and unfinished/not properly tested"
Re: None still accessible.
Maybe the property bDeleteMe helps you.
For example:
For example:
Code: Select all
function bool ActorValid(Actor A) {
return ! (A == None || A.bDeleteMe);
}
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: None still accessible.
Already tried it time ago, but it doesn't rly work, seems like bDeleteMe is not actually called :/ Or maybe you cannot check it because when you try doing it(even in a Tick) it's too late.Barbie wrote:Maybe the property bDeleteMe helps you.
For example:Code: Select all
function bool ActorValid(Actor A) { return ! (A == None || A.bDeleteMe); }
My code works fine because I know some safe actors that will never be None if my code won't let them, but since I tend to make the code more and more efficent I was trying to find a way to start from the very last actor, instead of a middle actor and repeating the iteration through already checked actors, but well it's oki anyway .o. So thanks, it helped much knowing about those "deleted" actors
"Your stuff is known to be buggy and unfinished/not properly tested"
- sektor2111
- Godlike
- Posts: 6411
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: None still accessible.
and it won't be called because is not a function or an event is a bool assigned shortly, see how I did such a deal with it, you might check some snippet.PrinceOfFunky wrote:Already tried it time ago, but it doesn't rly work, seems like bDeleteMe is not actually called
Then see log. I assure you it do works because it has bDeleteMe until next tick - crap happens if something tries a deal with this actor during this tiny time. Then yes, Accessed None is probably more than self explanatory - None has been Accessed when it should not be. If I recall I have such a check code into some of my Tick trackers for... learning, written in the past.UnrealScript wrote:Code: Select all
var Tracker T; ..... ..... if ( T.Owner==None) { T.Destroy(); log("Tracker "$T.Name$" pending deletion with bDeleteMe = "$T.bDeleteMe); }