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

SP zones

HOT
broken avatar :(
Created 12 years ago
by daedra descent
0 Members and 1 Guest are viewing this topic.
9,223 views
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 30 March 2013
Last active: 12 years ago
Posts
24
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Coder
Signature
PROxFTW
×
blackbird431's Groups
blackbird431's Contact & Social LinksPROxFTWiso4lif3PROxFTWJTAGxHACKER
Ok didn't see that you changed it but my thinking is it is something with this
Code Snippet
Plaintext
if(level.zone.volumes.is_active)
{
       level.zone_spawners.count = 9999;
       level.zone_spawners dospawn();
       iprintln("AI spawned");
}
1 being volumes is not doing anything. Possibly could be messy something up, not sure what it could be replaced with however.
2 being the if statement. Should be based off how I learned code should be if(level.zone.volumes.is_active == true)
Sorry if this doesn't help of has been said but just things I see as of now
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
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
Ok didn't see that you changed it but my thinking is it is something with this
Code Snippet
Plaintext
if(level.zone.volumes.is_active)
{
       level.zone_spawners.count = 9999;
       level.zone_spawners dospawn();
       iprintln("AI spawned");
}
1 being volumes is not doing anything. Possibly could be messy something up, not sure what it could be replaced with however.
2 being the if statement. Should be based off how I learned code should be if(level.zone.volumes.is_active == true)
Sorry if this doesn't help of has been said but just things I see as of now

I saw something in _zombiemode_zone_manager.gsc that had had .volumes in it, like this:

Code Snippet
Plaintext
level.zone.volumes.is_active

Do you think that mades a difference?

I think the IF statement is correct because i see alot of code where Treyarch declares a variable true or false and then does an IF statement the exact same way, so i assume the IF statement checks for true if not defined.
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 6 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
i dont know if the true stuff in the if statement really mattters but it doesnt hurt you if you add it anyway xD
i changed some things and one of the to [e] to see if that is the problem

Code Snippet
Plaintext
begin_zone_think()
{
    if(!isdefined(level.zones) )
    {
        level.zones = [];
        level.zones[ level.zones.size ] = "initial_zone";
level.zones[ level.zones.size ] = "zone2";
level.zones[ level.zones.size ] = "zone3";
    }
    while(1)
    {
        players = get_players();

        zone = GetArrayKeys( level.zones );

        for( i=0; i<zone.size; i++ )
        {

            for( e=0; e<players.size; e++ )
            {

                if(players[i] istouching(zone[e]) )
                {
                    level.zone[i].is_active = true;
                    level.zone_spawners = get_zone_specific_spawners(zone[i]);

                    iprintln("Player in zone");
                }
                else if(!players[i] istouching(zone[e]) )
                {
                    level.zone.is_active = false;
                    iprintln("player not in zone");
                }
            }
        }
       
        wait(.5);
   
        if(level.zone.volumes.is_active == true)
        {
            level.zone_spawners.count = 9999;
            level.zone_spawners dospawn();
            iprintln("AI spawned");
        }
        wait(1);
    }
}
get_Zone_specific_spawners(zone)
{
    if(!isdefined(zone.volumes) )
    {
        zone = undefined;
    }
   
    zone_spawners = zone.target;

    return zone_spawners;

    iprintln("Got spawners");
}
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 30 March 2013
Last active: 12 years ago
Posts
24
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Coder
×
blackbird431's Groups
blackbird431's Contact & Social LinksPROxFTWiso4lif3PROxFTWJTAGxHACKER
I saw something in _zombiemode_zone_manager.gsc that had had .volumes in it, like this:

Code Snippet
Plaintext
level.zone.volumes.is_active

Do you think that mades a difference?

I think the IF statement is correct because i see alot of code where Treyarch declares a variable true or false and then does an IF statement the exact same way, so i assume the IF statement checks for true if not defined.
Yah I dont think the if would do anything but like jjbradman says doesnt hurt to try but my thinking would still be the volumes but I can check through some of the code soon to double check
i dont know if the true stuff in the if statement really mattters but it doesnt hurt you if you add it anyway xD
i changed some things and one of the to [e] to see if that is the problem

Code Snippet
Plaintext
begin_zone_think()
{
    if(!isdefined(level.zones) )
    {
        level.zones = [];
        level.zones[ level.zones.size ] = "initial_zone";
level.zones[ level.zones.size ] = "zone2";
level.zones[ level.zones.size ] = "zone3";
    }
    while(1)
    {
        players = get_players();

        zone = GetArrayKeys( level.zones );

        for( i=0; i<zone.size; i++ )
        {

            for( e=0; e<players.size; e++ )
            {

                if(players[i] istouching(zone[e]) )
                {
                    level.zone[i].is_active = true;
                    level.zone_spawners = get_zone_specific_spawners(zone[i]);

                    iprintln("Player in zone");
                }
                else if(!players[i] istouching(zone[e]) )
                {
                    level.zone.is_active = false;
                    iprintln("player not in zone");
                }
            }
        }
       
        wait(.5);
   
        if(level.zone.volumes.is_active == true)
        {
            level.zone_spawners.count = 9999;
            level.zone_spawners dospawn();
            iprintln("AI spawned");
        }
        wait(1);
    }
}
get_Zone_specific_spawners(zone)
{
    if(!isdefined(zone.volumes) )
    {
        zone = undefined;
    }
   
    zone_spawners = zone.target;

    return zone_spawners;

    iprintln("Got spawners");
}
You need to change the variables around. zones should have the variable i and players should have the variable e based on how you set it up
Last Edit: March 03, 2014, 02:49:58 am by blackbird431
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
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
i dont know if the true stuff in the if statement really mattters but it doesnt hurt you if you add it anyway xD
i changed some things and one of the to [e] to see if that is the problem

Code Snippet
Plaintext
begin_zone_think()
{
    if(!isdefined(level.zones) )
    {
        level.zones = [];
        level.zones[ level.zones.size ] = "initial_zone";
level.zones[ level.zones.size ] = "zone2";
level.zones[ level.zones.size ] = "zone3";
    }
    while(1)
    {
        players = get_players();

        zone = GetArrayKeys( level.zones );

        for( i=0; i<zone.size; i++ )
        {

            for( e=0; e<players.size; e++ )
            {

                if(players[i] istouching(zone[e]) )
                {
                    level.zone[i].is_active = true;
                    level.zone_spawners = get_zone_specific_spawners(zone[i]);

                    iprintln("Player in zone");
                }
                else if(!players[i] istouching(zone[e]) )
                {
                    level.zone.is_active = false;
                    iprintln("player not in zone");
                }
            }
        }
       
        wait(.5);
   
        if(level.zone.volumes.is_active == true)
        {
            level.zone_spawners.count = 9999;
            level.zone_spawners dospawn();
            iprintln("AI spawned");
        }
        wait(1);
    }
}
get_Zone_specific_spawners(zone)
{
    if(!isdefined(zone.volumes) )
    {
        zone = undefined;
    }
   
    zone_spawners = zone.target;

    return zone_spawners;

    iprintln("Got spawners");
}

Still nothing. The IF statement still isn't working properly because its still saying i'm in the zone when i'm not.

EDIT: Screeny
Last Edit: March 03, 2014, 02:56:16 am by daedra descent
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 6 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
EDIT:
you're right, and i think theres aproblem having "zone" here   
Code Snippet
Plaintext
iprintln("player not in zone");
printed :/
try with this to see if it gets printed correctly, if it doesnt all the script is useless
Code Snippet
Plaintext
begin_zone_think()
{
    if(!isdefined(level.zones1) )
    {
        level.zones1 = [];
        level.zones1[ level.zones1.size ] = "initial_zone";
level.zones1[ level.zones1.size ] = "zone2";
level.zones1[ level.zones1.size ] = "zone3";
    }
    while(1)
    {
        players = get_players();
player  = undefined;

        zonea = GetArrayKeys( level.zones );

        for( i=0; i<zonea.size; i++ )
        {
                if(player istouching(zonea[e]) )
                {
                    level.zonea[i].is_active = true;
                    level.zone_spawners = get_zone_specific_spawners(zonea[i]);

                    iprintln("Player in zone");
                }
                else if(!player istouching(zonea[e]) )
                {
                    level.zonea.is_active = false;
                    iprintln("player not in zone");
                }
        }
       
        wait(.5);
   
        if(level.zonea.volumes.is_active == true)
        {
            level.zone_spawners.count = 9999;
            level.zone_spawners dospawn();
            iprintln("AI spawned");
        }
        wait(1);
    }
}
get_Zone_specific_spawners(zonea)
{
    if(!isdefined(zonea.volumes) )
    {
        zonea = undefined;
    }
   
    zone_spawners = zonea.target;

    return zone_spawners;

    iprintln("Got spawners");
}
Last Edit: March 03, 2014, 04:02:53 am by jjbradman
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
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
EDIT:
you're right, and i think theres aproblem having "zone" here   
Code Snippet
Plaintext
iprintln("player not in zone");
printed :/
try with this to see if it gets printed correctly, if it doesnt all the script is useless
Code Snippet
Plaintext
begin_zone_think()
{
    if(!isdefined(level.zones1) )
    {
        level.zones1 = [];
        level.zones1[ level.zones1.size ] = "initial_zone";
level.zones1[ level.zones1.size ] = "zone2";
level.zones1[ level.zones1.size ] = "zone3";
    }
    while(1)
    {
        players = get_players();
player  = undefined;

        zonea = GetArrayKeys( level.zones );

        for( i=0; i<zonea.size; i++ )
        {
                if(player istouching(zonea[e]) )
                {
                    level.zonea[i].is_active = true;
                    level.zone_spawners = get_zone_specific_spawners(zonea[i]);

                    iprintln("Player in zone");
                }
                else if(!player istouching(zonea[e]) )
                {
                    level.zonea.is_active = false;
                    iprintln("player not in zone");
                }
        }
       
        wait(.5);
   
        if(level.zonea.volumes.is_active == true)
        {
            level.zone_spawners.count = 9999;
            level.zone_spawners dospawn();
            iprintln("AI spawned");
        }
        wait(1);
    }
}
get_Zone_specific_spawners(zonea)
{
    if(!isdefined(zonea.volumes) )
    {
        zonea = undefined;
    }
   
    zone_spawners = zonea.target;

    return zone_spawners;

    iprintln("Got spawners");
}

Still not working
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 6 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter Elite
My Groups
More
×
YaPh1l's Groups
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
Well, in your zone array, you just have the names of the zones. You cannot check if a player is touching a 'name of a zone'. You need to actually acquire the info_volume entities somewhere in your code to be able to use the for the touch check.

- Phil.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
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
Well, in your zone array, you just have the names of the zones. You cannot check if a player is touching a 'name of a zone'. You need to actually acquire the info_volume entities somewhere in your code to be able to use the for the touch check.

- Phil.

You mean get the entity in the game with getEntarray();, right? i still have that in my code:

Code Snippet
Plaintext
begin_zone_think()
{
if(!isdefined(level.zones) )
{
level.zones = [];
level.zones = getEntarray("initial_zone", "targetname");
}
while(1)
{
players = get_players();

zone = GetArrayKeys( level.zones );

for( i=0; i<zone.size; i++ )
{
for( j=0; j<players.size; j++ )
{

if(players[j] istouching(zone[i]) )
{
level.zone[i].is_active = true;
level.zone_spawners = get_zone_specific_spawners(zone[i]);

iprintln("Player in" +zone[i]);
}
else if(!players[J] istouching(zone[i]) )
{
//iprintln("player not in zone");
level.zone.is_active = false;
}
}
}

wait(.5);

if(level.zone.volumes.is_active == true)
{
for( i=0; i<level.zone_spawners.size; i++ )
{
level.zone_spawners[i].count = 9999;

level.zone_spawners[i] dospawn();
iprintln( level.zone_spawners[i] + "spawned at" + level.zone_spawners.origin);
}
}
wait(1);
}
}
get_Zone_specific_spawners(zone)
{
if(!isdefined(zone) )
{
zone = undefined;
}

check_zone = getEntarray(zone, "targetname");

zone_spawners = check_zone.target;

iprintln("Got spawners");

return zone_spawners;
}
Last Edit: March 03, 2014, 01:13:13 pm by daedra descent
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 6 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter Elite
My Groups
More
×
YaPh1l's Groups
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
Yes, you do have it there. But you don't use the volume entity for the IsTouching() check, instead you use the zone's name, which won't work, obviously.

- Phil.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
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
Yes, you do have it there. But you don't use the volume entity for the IsTouching() check, instead you use the zone's name, which won't work, obviously.

- Phil.

Then what do i use exactly? I see in Treyarch scripts that they do practically the same thing, unless i'm missing something.

broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 6 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter Elite
My Groups
More
×
YaPh1l's Groups
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
You obviously don't do the same, as I have explained. And I have also explained what you need to do: You need to use the info_volume entity (entities) of the zone and check if the player is touching that (them).

- Phil.

 
Loading ...