Page 1 of 1

Thing Set Goal Doesn't Work from lines

Posted: Tue Jul 29, 2014 11:37 pm
by fr blood
Hi there, after working in some projects, I've noticed that "Thing Set Goal" doesn't work if it's not called from a script or directly in actor's arguments, so it's useless to set it in Line Action or "Actor Enter Sector" Action.

It doesn't work for the activator only, but it'll work for a special ID. The onlyway that I found was that:

Code: Select all

 
script 1 (int Goal) // Set here the ID of destination.
{
int NewID = random(9000,10000);
Thing_ChangeTID(0,NewID); // Giving random ID: only way that I found to make only the activator to follow the specified destination. 
Thing_Setgoal(NewID,Goal,0,1);
delay(1);
Thing_ChangeTID(NewID,ActivatorTID());
}
It gives a special ID to the activator, use this ID to give the goal only for the activator and reset the old ID, it's working very well, but I wanted to know if there is a way more simple to do that, thanks.

RE: Thing Set Goal Doesn't Work from lines

Posted: Wed Jul 30, 2014 7:18 am
by Lollipop
never test things with TIDs over 9000, never. Not even that high.
I suggest that whatever you are testing at any given time must be tested with low TIDs to be sure that isn't causing the problem.
I have personally experienced that Things break horribly if I use TID's over 1000 or so, not sure what the exact breaking point is.

RE: Thing Set Goal Doesn't Work from lines

Posted: Wed Jul 30, 2014 9:30 am
by fr blood
Lollipop wrote: never test things with TIDs over 9000, never. Not even that high.
I suggest that whatever you are testing at any given time must be tested with low TIDs to be sure that isn't causing the problem.
I have personally experienced that Things break horribly if I use TID's over 1000 or so, not sure what the exact breaking point is.
I didn't see any problem with the high TID because it's given during a short period just to make the action, and I selected it to make sure that the script won't change anything with current TIDs.

RE: Thing Set Goal Doesn't Work from lines

Posted: Wed Jul 30, 2014 9:39 am
by Klofkac
Don't use random TID like this. You still get a chance you get TID collision if you use it with different mods. Use the mythical UniqueTID function, it's widely used... Yes, I know there is native UniqueTID for ZDoom 2.7.1, but there is also zan compat version you need to copy to your code.
You have ridicolously high TID numbers too... Add 147 483 649 to the upper limit and you get signed integer overflow.

RE: Thing Set Goal Doesn't Work from lines

Posted: Wed Jul 30, 2014 10:49 am
by fr blood
I'm using this script only in maps so there is no chance of collision with other TID since this map is only for my projects.
Ok I've problem the TID, but the problem isn't resolved.