Page 1 of 2
[SOLVED]Thing_Move issue
Posted: Sun Nov 17, 2013 6:18 am
by agaures
So i am trying to move all players to specific teleport destinations based on their tid. Thing is, they aren't teleporting.
The code.
Now before you go on and ramble about the obvious stuff, yes, i have teleport destinations with the tags 7000, 7001, 7002 etc. Also, it's a global acs script.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 6:40 am
by Mr.Man
I never did this, but if im right, you need to use teleport_other.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 6:57 am
by agaures
I have already tried teleport_other, same result.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 7:45 am
by IdeIdoom
Try Teleport(random(min,max), 0, 0) the min and max will be the lowest and the highest TID's of the Teleport destinations you want to teleport them.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 7:50 am
by agaures
IdeIdoom wrote:
Try Teleport(random(min,max), 0, 0) the min and max will be the lowest and the highest TID's of the Teleport destinations you want to teleport them.
Teleport, teleports the activator. In this case, there are no activators. But i could use the random thing for thing_move.
Edit:
Nevermind, that would only move one player.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 7:54 am
by Mr.Man
Look up that samsara port level. it had teleport_other too i think, but with a timer.
This timer kept restarting the script untill all 32 player id's came by, thats how it teleported them to the boat and land.
or you could kill everybody and change their spawn to wherever you want them :#
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 8:01 am
by agaures
I could use a loop:
Code: Select all
script 1 (void)
{
int x = 0;
until(x == playercount())
{
teleportother(random(1000, 1063), 7000+playernumber(), 1);
delay(1);
x++;
}
}
Edit:
Didn't work.
Edit2:
I added a '!' before the 'x == playercount()' and then it never stopped teleporting.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 8:16 am
by IdeIdoom
I don't think it's void. Try Enter/Open and make it just teleport and see if it works.
EDIT: Wait a minute, you have sector tags over 7000?
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 8:20 am
by Mr.Man
Why not over 9000?
You should add a counter, like (teleported++) if you know what i mean
And if (teleported==32) terminate;
You know what i mean?
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 8:24 am
by agaures
IdeIdoom wrote:
EDIT: Wait a minute, you have sector tags over 7000?
agaures wrote:yes, i have teleport destinations with the tags 7000, 7001, 7002 etc.
@Mr.Man: I will try that.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 8:28 am
by IdeIdoom
Teleport destinations? Teleport destinations use TIDs not Tags. Sectors use tags. If you already defined the teleport destinations things with TIDs, you don't need sector tags.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 8:30 am
by agaures
IdeIdoom wrote:
Teleport destinations? Teleport destinations use TIDs not Tags. Sectors use tags. If you already defined the teleport destinations things with TIDs, you don't need sector tags.
TIDs, Tags, same thing. Also, i never used a sector tag.
Edit:
Mr.Man, turns out i don't know what you mean.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 8:37 am
by IdeIdoom
Code: Select all
script 1 (void)
{
int x = teleported;
until(x == 64)
{
teleportother(random(1000, 1063), 7000+playernumber(), 1);
delay(1);
x++;
}
}
Probably what he meant.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 8:38 am
by agaures
IdeIdoom wrote:
Code: Select all
script 1 (void)
{
int x = teleported;
until(x == 64)
{
teleportother(random(1000, 1063), 7000+playernumber(), 1);
delay(1);
x++;
}
}
Probably what he meant.
I was thinking what he was trying to imply was quite like my code... which doesn't work.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 8:53 am
by Vincent(PDP)
agaures wrote:
IdeIdoom wrote:
Code: Select all
script 1 (void)
{
int x = teleported;
until(x == 64)
{
teleportother(random(1000,1063), 7000+playernumber(), 1);
delay(1);
x++;
}
}
Probably what he meant.
I was thinking what he was trying to imply was quite like my code... which doesn't work.
This should work:
Code: Select all
Script 1 ENTER
{
Delay(1);
If(GameStarted == True) //Or what you want to call it
{
Teleport(7000+PlayerNumber(), 0, 1);
Terminate;
}
Restart;
}
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 8:55 am
by IdeIdoom
Actually, replace 1000+PlayerNumber() with 7000+PlayerNumber()
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 8:57 am
by Vincent(PDP)
IdeIdoom wrote:
Actually, replace 1000+PlayerNumber() with 7000+PlayerNumber()
No, because the teleport destinations had tid 1000-1063.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 8:57 am
by agaures
Funny, i was building on a similar code just now.
Replacement for script 999:
Code: Select all
script 999 enter //Give all players unique tid
{
Thing_ChangeTID(0, 1000+PlayerNumber());
SetActorProperty(1000+PlayerNumber(), APROP_HEALTH, 100);
ACS_Execute(995, 0, 0, 0, 0);
}
script 995
Code: Select all
script 995 (void)
{
if(countdown == true)
{
Thing_Move(1000+PlayerNumber(), 7000+PlayerNumber(), 0);
terminate;
}
Delay(1);
Restart;
}
Edit:
Vincent(PDP) wrote:
IdeIdoom wrote:
Actually, replace 1000+PlayerNumber() with 7000+PlayerNumber()
No, because the teleport destinations had tid 1000-1063.
Also, sorry. IdeIdoom is right, the teleport destinations had the tids 7000-7063.
Vincent(PDP) wrote:
Ok why did he write random(1000,1063) then :S
Because the first argument in TeleportOther is the TID of the thing to teleport.
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 9:05 am
by Vincent(PDP)
Ok your script will probably not work, because no player has activated the script, so the PlayerNumber will only be 0 all the time
RE: Thing_Move issue
Posted: Sun Nov 17, 2013 9:06 am
by IdeIdoom
Watch the both codes, mate. First script has ENTER and it executes the teleporting script.