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

Black Ops 1 - Get current origin

broken avatar :(
Created 11 years ago
by Gabrielle
0 Members and 1 Guest are viewing this topic.
3,143 views
broken avatar :(
×
broken avatar :(
Location: nlThe Netherlands
Date Registered: 23 November 2013
Last active: 4 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombie Slayer Elite
×
Gabrielle's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Gabrielle's Contact & Social LinksTutorialZoneNL
Hey,

I'm looking for a way to get the current origin of the player (just one, for solo) as I need origins for different perks. But honestly I'm clueless how to do. I got this:

Code Snippet
Plaintext
check_position()
{
players = get_players();
iPrintLn(players[0].origin[0] + "," + players[0].origin[1] + "," + players[0].origin[2]);
}

I'm using it as a level thread but now my map just crashes (it gives no error, it stays on loading screen and load image will stop animating as soon as I left click after a certain amount of seconds.
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
origin? Grab the entity using whatever method and use either ent.origin or ent GetOrigin();
broken avatar :(
×
broken avatar :(
Location: nlThe Netherlands
Date Registered: 23 November 2013
Last active: 4 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombie Slayer Elite
×
Gabrielle's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Gabrielle's Contact & Social LinksTutorialZoneNL
origin? Grab the entity using whatever method and use either ent.origin or ent GetOrigin();

With origin I mean the location yes. But I just want the location of your player, so I can stand on the position I want the perk to be, so I can the origin to spawn the model.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 2 years ago
Posts
1,186
Respect
1,332Add +1
Forum Rank
Zombie Colossus
Primary Group
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.
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 LinksBluntStuffyBluntstuffy@BluntZombieStuffyZombie
Code Snippet
Plaintext
check_position()
{
players = get_players()[0];
iPrintLn( "Origin: "+players.origin );
}


That's all
broken avatar :(
×
broken avatar :(
Location: nlThe Netherlands
Date Registered: 23 November 2013
Last active: 4 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombie Slayer Elite
×
Gabrielle's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Gabrielle's Contact & Social LinksTutorialZoneNL
Code Snippet
Plaintext
check_position()
{
players = get_players()[0];
iPrintLn( "Origin: "+players.origin );
}


That's all

And how would I call it? If I run it with level thread my map crash.
Marked as best answer by Gabrielle 11 years ago
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
×
jbird's Groups
Your map shouldn't crash with a level thread. Put the level thread under main. Also put it in a while function so it keeps printing your current location.
Code Snippet
Plaintext
check_position()
{
while(1)
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
iPrintLn(players[i].origin );
}
wait 1;
}
}
Last Edit: July 02, 2015, 05:42:47 pm by jbird
broken avatar :(
×
broken avatar :(
Location: nlThe Netherlands
Date Registered: 23 November 2013
Last active: 4 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombie Slayer Elite
×
Gabrielle's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Gabrielle's Contact & Social LinksTutorialZoneNL
Your map shouldn't crash with a level thread. Put the level thread under main. Also put it in a while function so it keeps printing your current location.
Code Snippet
Plaintext
check_position()
{
while(1)
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
iPrintLn(players[i].origin );
}
wait 1;
}
}

And that iPrintLn will only be visible with Developer on, right? I use this to enable developer:

SetDvar( "developer", "1" )

Don't know if it works or not, I'm not advanced in BO scripting (scripting in general)
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
IPrintLn is available regardless of developer setting.
That's for PrintLn, which is printed to console instead of game msg window's.

In any case to print origin for the millionth time: iPrintLn(ent.origin);
broken avatar :(
×
broken avatar :(
Location: nlThe Netherlands
Date Registered: 23 November 2013
Last active: 4 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombie Slayer Elite
×
Gabrielle's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Gabrielle's Contact & Social LinksTutorialZoneNL
Al right thanks all of you for the help  :D

 
Loading ...