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

[FUNCTION] objectFloat()

broken avatar :(
Created 8 years ago
by daedra descent
0 Members and 1 Guest are viewing this topic.
2,530 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
Another function that some may find useful. This utility function will let you easily make an object float from its groundPos(). Might be handy if you need an easier way to set the height of an model or brushmodel from the ground for something your scripting.

Function:

Code Snippet
Plaintext
objectFloat(height)
{
if(!isDefined(self) || !isDefined(height))
return undefined;

self moveTo(self groundPos(self.origin) + (0,0,height), .001);
}

Example usage:

Code Snippet
Plaintext
self objectFloat(45); // gun model floats 45 units in the air

Edit, if you want you can also change the other coordinate values as well by adding more function arguments.
Last Edit: November 05, 2015, 05:16:58 am by daedra descent
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
like powerups spawning in the floor for example?
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
like powerups spawning in the floor for example?

Maybe. Its possible a powerup might spawn under the floor if the zombie dies fast enough in which case this would be no good.

Edit: on second thought, if you do self.origin + (0,0,60) or something like that then it might work since its returns the origin of the powerup as if it was 60 units higher. Untested though, just an idea.
Last Edit: November 05, 2015, 05:22:39 am by daedra descent
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Maybe. Its possible a powerup might spawn under the floor if the zombie dies fast enough in which case this would be no good.
can they not set it quite a bit up on the Z axis, then use your function to bring it back down to the ground and level out at a decent height?

EDIT - looks like we both just had the same thought
Last Edit: November 05, 2015, 05:23:42 am by Harry Bo21
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
can they not set it quite a bit up on the Z axis, then use your function to bring it back down to the ground and level out at a decent height?

EDIT - looks like we both just had the same thought

Yeah  ;D

I don't really think that the height of the powerup from the ground matters too much in most cases, but if you do something like kill a zombie as he falls from a ledge and he drops a powerup this could stop that from happening.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Yeah  ;D

I don't really think that the height of the powerup from the ground matters too much in most cases, but if you do something like kill a zombie as he falls from a ledge and he drops a powerup this could stop that from happening.
Could have been useful for my shields placement, but i ended up using a bullet trace for that in the end, ah well, next time
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Signature
Hey if you had tons of fun on playing my maps please DONATE :)

play ESTATE now, and claim your mansion back from the undead!
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
in shadows of evil I saw that powerups float down if the zombie is killed high above ground. (maybe ill use that for my ziplines)

 
Loading ...