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

custom script not teleporting players

broken avatar :(
Created 7 years ago
by Big-Beautiful
0 Members and 1 Guest are viewing this topic.
2,696 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 25 May 2015
Last active: 5 years ago
Posts
31
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
i hate mei
Signature
Must be kept sacred, heavenly eggs
Mustn’t be desecrated with egg bootlegs
×
Big-Beautiful's Groups
Big-Beautiful's Contact & Social Linksfortress-of-branitude
Hello, ive created this script that gets triggered when you shoot a trigger_damage:

Code Snippet
Plaintext
function jug_tele(player)
{
self SetOrigin(GetEnt("jug_tele","targetname").origin);
IPrintLn("bonka");
wait(30);
self SetOrigin(GetEnt("bar_tele","targetname").origin);
level.jug_tele--;
}

I am able to see the bonka, but I am not teleported? Does anyone know if im using the setorigin correctly?
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
depends on how you called/threaded this function, but self is not the player prob?

Code Snippet
Plaintext
function jug_tele(player)
{
player SetOrigin(GetEnt("jug_tele","targetname").origin);
IPrintLn("bonka");
wait(30);
player SetOrigin(GetEnt("bar_tele","targetname").origin);
level.jug_tele--;
}

broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 25 May 2015
Last active: 5 years ago
Posts
31
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
i hate mei
×
Big-Beautiful's Groups
Big-Beautiful's Contact & Social Linksfortress-of-branitude
Thank you for replying. player doesn't seem to work either. The function is called by this here:

Code Snippet
Plaintext
function shootable_perk_jug(player)
{
    trig_jug = GetEnt("perktrig_jug", "targetname");
    model_jug = GetEnt("perkmod_jug", "targetname");

    trig_jug SetHintString("");
    trig_jug SetCursorHint("HINT_NOICON");
    level.shoot_juggernog=0;


    while(1)
    {
        trig_jug waittill("trigger", player);

        if (player laststand::player_is_in_laststand())
{
break;
}
else
{
if(level.shoot_juggernog == 0)
{
IPrintLn("It's not unlocked yet ya snort snort");
}
else
{
playfx(level._effect["powerup_grabbed"] ,GetEnt("perkmod_jug","targetname").origin);
level.jug_tele++;
        thread jug_tele();
player playsound("Chinese_1");

break;
}

}
    }
}

I'm pretty sure that since bonka is shown, the function is being called correctly. I feel its the SetOrigins themselves or the entities I have in radiant. I gave a script struct the jug_tele targetname and another script struct bar_tele.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
Thank you for replying. player doesn't seem to work either. The function is called by this here:

Code Snippet
Plaintext
function shootable_perk_jug(player)
{
    trig_jug = GetEnt("perktrig_jug", "targetname");
    model_jug = GetEnt("perkmod_jug", "targetname");

    trig_jug SetHintString("");
    trig_jug SetCursorHint("HINT_NOICON");
    level.shoot_juggernog=0;


    while(1)
    {
        trig_jug waittill("trigger", player);

        if (player laststand::player_is_in_laststand())
{
break;
}
else
{
if(level.shoot_juggernog == 0)
{
IPrintLn("It's not unlocked yet ya snort snort");
}
else
{
playfx(level._effect["powerup_grabbed"] ,GetEnt("perkmod_jug","targetname").origin);
level.jug_tele++;
        thread jug_tele();
player playsound("Chinese_1");

break;
}

}
    }
}

I'm pretty sure that since bonka is shown, the function is being called correctly. I feel its the SetOrigins themselves or the entities I have in radiant. I gave a script struct the jug_tele targetname and another script struct bar_tele.

In my portal script i made a while back I use SetOrigin and it works fine, if you want a look at my function heres a screenshot:


Using player instead of self would also be the right thing to do.

EDIT:
Instead of doing
Code Snippet
Plaintext
thread jug_tele(); 
do
Code Snippet
Plaintext
thread jug_tele(player);
Last Edit: November 04, 2016, 05:07:58 am by reckfullies
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 25 May 2015
Last active: 5 years ago
Posts
31
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
i hate mei
×
Big-Beautiful's Groups
Big-Beautiful's Contact & Social Linksfortress-of-branitude
i used thread jug_tele(player);, but it still does not work. I thought that maybe changing up the function a bit would work:

Code Snippet
Plaintext
function juggers(player)
{
jugport = GetEnt("jug_tele","targetname");
barport = GetEnt("bar_tele","targetname");

player SetOrigin(jugport.origin);
IPrintLn("bonka");
wait(30);
player SetOrigin(barport.origin);
level.jug_tele--;

}

still, nothing. :(

Just in case, here is what i put in radiant. The trigger_damage is targeting that struct with its targetname as jug_tele. The other targeted struct has the targetname bar_tele.


broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
i used thread jug_tele(player);, but it still does not work. I thought that maybe changing up the function a bit would work:

Code Snippet
Plaintext
function juggers(player)
{
jugport = GetEnt("jug_tele","targetname");
barport = GetEnt("bar_tele","targetname");

player SetOrigin(jugport.origin);
IPrintLn("bonka");
wait(30);
player SetOrigin(barport.origin);
level.jug_tele--;

}

still, nothing. :(

Just in case, here is what i put in radiant. The trigger_damage is targeting that struct with its targetname as jug_tele. The other targeted struct has the targetname bar_tele.


(Image removed from quote.)

If you already did this, it must be a problem with the way you setup your structs in radiant.

Make sure you are using exact targetnames and that you setup the trigger right.

I am not the one who set them up so I can't really tell you what is wrong unless I tried it myself.
Last Edit: November 04, 2016, 07:50:31 am by reckfullies
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 25 May 2015
Last active: 5 years ago
Posts
31
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
i hate mei
×
Big-Beautiful's Groups
Big-Beautiful's Contact & Social Linksfortress-of-branitude
hmm, there has been an interesting development. Instead of using a script_struct, I used a script_model as the target. For some reason, it worked and I was teleported. I'll just use models instead of the structs now.

The teleporting script now works, but I have a question about activating the zone that contains the teleporter's target. I added the script_flag kvp to the trigger like you would on doors, but didn't work and i died. How can I go about this in script?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
hmm, there has been an interesting development. Instead of using a script_struct, I used a script_model as the target. For some reason, it worked and I was teleported. I'll just use models instead of the structs now.

The teleporting script now works, but I have a question about activating the zone that contains the teleporter's target. I added the script_flag kvp to the trigger like you would on doors, but didn't work and i died. How can I go about this in script?

The thing about script_flag is, its just an empty kvp without a script. The only reason it activates zones for doors is because inside the door script it sees that it has that kvp and activates the specified zone inside the script.

You would just need to find the code that does that and apply it in your script somehow.

Look around inside _zm_blockers.gsc and if you can't find anything I'm sure someone would help you.

EDIT: There is a function inside _zm_zonemgr.gsc that allows you to activate a zone, I haven't tried this so don't take my word for it but here is how I would assume you would use it:
Code Snippet
Plaintext
#using scripts\zm\_zm_zonemgr; // Must include this script so that you can use it's functions!

function somefunctionname() // This would be your function you are already using.
{
zm_zonemgr::zone_init(<zone_name>, <zone_tag>); // Change <zone_name> to the targetname of your zone eg: "start_zone". I don't know what zone_tag does but I would assume it isn't required.
}
Last Edit: November 04, 2016, 11:44:06 am by reckfullies

 
Loading ...