Thing Set Goal Doesn't Work from lines

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
fr blood
Frequent Poster Miles card holder
Posts: 995
Joined: Wed Mar 06, 2013 4:04 pm
Location: France

Thing Set Goal Doesn't Work from lines

#1

Post by fr blood » Tue Jul 29, 2014 11:37 pm

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.
Last edited by fr blood on Wed Jul 30, 2014 10:49 am, edited 1 time in total.

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: Thing Set Goal Doesn't Work from lines

#2

Post by Lollipop » Wed Jul 30, 2014 7:18 am

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.
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

User avatar
fr blood
Frequent Poster Miles card holder
Posts: 995
Joined: Wed Mar 06, 2013 4:04 pm
Location: France

RE: Thing Set Goal Doesn't Work from lines

#3

Post by fr blood » Wed Jul 30, 2014 9:30 am

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.

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: Thing Set Goal Doesn't Work from lines

#4

Post by Klofkac » Wed Jul 30, 2014 9:39 am

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.
Last edited by Klofkac on Wed Jul 30, 2014 9:43 am, edited 1 time in total.
𝕂𝕝𝕠𝕗𝕜𝕒𝕔

User avatar
fr blood
Frequent Poster Miles card holder
Posts: 995
Joined: Wed Mar 06, 2013 4:04 pm
Location: France

RE: Thing Set Goal Doesn't Work from lines

#5

Post by fr blood » Wed Jul 30, 2014 10:49 am

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.

Post Reply