Raised This Month: $ Target: $400
 0% 

get ground Z from an origin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Siveroo
Junior Member
Join Date: Apr 2020
Old 10-13-2020 , 07:39   get ground Z from an origin
Reply With Quote #1

I don't know how to phrase the title correctly, so im going to explain my problem here.

Basically i just wanna make a function that spreads flame in random coordinate in the spesific radius. I managed to do that, but the problem is that, if the flame spreads on air, the "fire" sprites are also floating on air, to fix this, i think im going to modify the sprite's origin so that it will show the sprites on the ground. (The x and y axis is fine, just need to modify the z axis)

So, my question is that how do i get from a normal origin to the new origin that is actually placed on the ground.

I think it's like "EngFunc_DropToFloor" but for an origin instead of an entity

This is the actual code
Code:
stock random_fire(iOrigin[3], max_radius, count) {         for(new i = 0; i < count; i++){                 new Float:rand_coord[2]         new Float:theta         new Float:r         new Float:rand[2]                 new randomSize = random_num(7,12)                 rand[0] = random_float(0.0, 1.0);         rand[1] = random_float(0.0, 1.0);         r = max_radius * rand[0]         theta = rand[1] * 7         rand_coord[0] = r*floatcos(theta, radian)         rand_coord[1] = r*floatsin(theta, radian)                 message_begin(MSG_BROADCAST, SVC_TEMPENTITY);         write_byte(TE_SPRITE);         write_coord(iOrigin[0] + floatround(rand_coord[0]));         write_coord(iOrigin[1] + floatround(rand_coord[1]));         write_coord(iOrigin[2]);         write_short(firespr);         write_byte(randomSize);         write_byte(255);         message_end();     } }
Siveroo is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode