UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Setting a zombies origin

broken avatar :(
Created 10 years ago
by daedra descent
0 Members and 1 Guest are viewing this topic.
2,937 views
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
How do i set all of the zombies origin? i've tried doing all of this:

Code Snippet
Plaintext
teleport_zombies()
{
if(!isdefined(level.zombie_spawns) )
{
iprintln("Critical error! No Zombie spawn points!");
return;
}
players = get_players();

if(players.size == 1)
{
zombies = getaiarray("axis");

if(zombies.size > level.zombie_spawns.size)
{
iprintln("Critical error! Not enough zombie spawn points!");
}
for(i = 0; i < zombies.size; i++)
{
for(k = 0; k < level.zombie_spawns.size; k++)
{
zombies[i] setorigin(level.zombie_spawns[i].origin);
}
}
}
}

But the zombies won't move an inch.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Are you sure the zombie_spawns are really in the array ( check with a print if it actually returns an origin for example )

Also this doesn't really make sense:

Code Snippet
Plaintext
for(i = 0; i < zombies.size; i++)
{
for(k = 0; k < level.zombie_spawns.size; k++)
{
zombies[i] setorigin(level.zombie_spawns[i].origin);
}
}

I'm missing the [k] value in here? So you either want to remove the:
Code Snippet
Plaintext
	for(k = 0; k < level.zombie_spawns.size; k++)

from there, or otherwise make it use the [k] value but doing so, that would prob move one zombie to all spawn points in the map. One after another, because the for() loop keeps going allong all spawn point's before it continues with the next zombie.. Might want to try something like this for the last part:

Code Snippet
Plaintext
                for(i = 0; i < zombies.size; i++)
                {
for(k = 0; k < level.zombie_spawns.size; k++)
{
if( isdefined( level.zombie_spawns[k] )
{
zombies[i] setorigin(level.zombie_spawns[k].origin);
break;
}
}
           }

Now this would move them all to the first spawn-point in the array prob, (because it's Always defined)  it's up to you to change the statement's to your need's or randomize the array or something..



Also according to zeroy's script reference the setorigin() is used for the players origin, dunno if it makes a difference for zomb's. You could try just doing

Code Snippet
Plaintext
zombies[i].origin = level.zombie_spawns[k].origin;

otherwise you might want to try the teleport() function to move your zombie's..
Hope this helps a bit...
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
Depending on the situation, ForceTeleport() should also be considered.

- Phil.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Are you sure the zombie_spawns are really in the array ( check with a print if it actually returns an origin for example )

Also this doesn't really make sense:

Code Snippet
Plaintext
for(i = 0; i < zombies.size; i++)
{
for(k = 0; k < level.zombie_spawns.size; k++)
{
zombies[i] setorigin(level.zombie_spawns[i].origin);
}
}

I'm missing the [k] value in here? So you either want to remove the:
Code Snippet
Plaintext
	for(k = 0; k < level.zombie_spawns.size; k++)

from there, or otherwise make it use the [k] value but doing so, that would prob move one zombie to all spawn points in the map. One after another, because the for() loop keeps going allong all spawn point's before it continues with the next zombie.. Might want to try something like this for the last part:

Code Snippet
Plaintext
                for(i = 0; i < zombies.size; i++)
                {
for(k = 0; k < level.zombie_spawns.size; k++)
{
if( isdefined( level.zombie_spawns[k] )
{
zombies[i] setorigin(level.zombie_spawns[k].origin);
break;
}
}
           }

Now this would move them all to the first spawn-point in the array prob, (because it's Always defined)  it's up to you to change the statement's to your need's or randomize the array or something..



Also according to zeroy's script reference the setorigin() is used for the players origin, dunno if it makes a difference for zomb's. You could try just doing

Code Snippet
Plaintext
zombies[i].origin = level.zombie_spawns[k].origin;

otherwise you might want to try the teleport() function to move your zombie's..
Hope this helps a bit...

Are the function arguments for teleport() and forceteleport() the same as setorigin(position)?

EDIT: neither of the teleport functions are working.
Last Edit: May 03, 2014, 01:26:03 pm by daedra descent
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
If I remember corectly, Teleport() and ForceTeleport() take angles as the second argument.

- Phil.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
If I remember corectly, Teleport() and ForceTeleport() take angles as the second argument.

- Phil.

I tried giving them an angle, adding even more structs(i didn't have all 24 before), changing the structs to origins, ETC but nothing works...

Could it be because i'm using:

Code Snippet
Plaintext
getentarray("zombie_spawn", "targetname");

instead of the struct or origin function?
Last Edit: May 03, 2014, 02:01:30 pm by daedra descent
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
You have to use GetStructArray() for script_structs, and GetEntArray() for anything else.

- Phil.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
You have to use GetStructArray() for script_structs, and GetEntArray() for anything else.

- Phil.

Well, it doesn't look like that mattered. It still doesn't work and i have no idea why. Is there any other functions that i could try?
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
The problem is most likely your script's logic, not the functions you are using.

- Phil.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
http://www.zeroy.com/script/ai/teleport.htm

Dunno, i tried using it once and didn't seem to work for me either.
Then i checked the dlc3_teleporter.gsc in raw\maps and looked how they teleported the players in there and applied that to my zombies.
Basicly they spawn a script_origin, link the player to it, set a new origin for the script_origin and then unlink the player again, and delete the script_origin.. That should work..
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
Teleport() does work. It just doesn't teleport when the player might be able to see the teleportation process. That's what ForceTeleport() is for, which is used for the dogs for example. It does work.

- Phil.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Teleport() does work. It just doesn't teleport when the player might be able to see the teleportation process. That's what ForceTeleport() is for, which is used for the dogs for example. It does work.

- Phil.

Ok, that might have been my problem. I never tried Forceteleport() be cause i didn't know it existed back then, i went straight to the dlc3 script..
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Teleport() does work. It just doesn't teleport when the player might be able to see the teleportation process. That's what ForceTeleport() is for, which is used for the dogs for example. It does work.

- Phil.

Well i'm out of ideas then unless i can get the linking method to work(which it isn't so far). I don't see why the forceteleport() isn't working, i have all the entities but they just won't move.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Well i'm out of ideas then unless i can get the linking method to work(which it isn't so far). I don't see why the forceteleport() isn't working, i have all the entities but they just won't move.

So did you try to print one of your zombie_spawns on screen to see if it actually has  an origin stored in there? Maybe that's wrong..
Last Edit: May 03, 2014, 03:59:01 pm by BluntStuffy

 
Loading ...