Scripts / Question About Projectile Events

Author
Message
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 28th Oct 2024 15:09
Does anyone have any idea of to use the following global variables?

-- Globals to track projectile explosion event
g_projectileevent_explosion = 0
g_projectileevent_name = ""
g_projectileevent_x = 0
g_projectileevent_y = 0
g_projectileevent_z = 0
g_projectileevent_radius = 0
g_projectileevent_damage = 0
g_projectileevent_entityhit = 0

For instance if a rocket man shoots a rocket, could I then determine where that rocket exploded? Do we set any of these variables directly to identify which projecile we are tracking? Any documentation about the above would be helpful.
Store Assets - Store Link
Free GGC Resource - Resource Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
J_C
17
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 28th Oct 2024 17:41 Edited at: 28th Oct 2024 17:46
Hi Teabone glad to see you are still around..
It's along time since I used GG Classic but I remember having a play with these variables for projectile system..
I have attached a lua script file I used to play with..

I think the variables are set by the projectile system and you read them and use them
hopefully you will see in the attached lua script.. I think I attached the script to a fire decal
and then I would fire rocket at some barrels then the projectile variables would activate and I would place the fire particle
at the (hit) barrel object.

Attachments

Login to view attachments
PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 28th Oct 2024 23:23
Was able to get some return values. It is sad that I'm only discovering this now. It should have been documented years ago.

if g_projectileevent_explosion > 0 then
SetPosition ( e, g_projectileevent_x, g_projectileevent_y, g_projectileevent_z )
g_projectileevent_explosion = 0
end
Store Assets - Store Link
Free GGC Resource - Resource Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
fabrieno80
2
Years of Service
User Offline
Joined: 5th Feb 2022
Location:
Posted: 19th Nov 2024 10:21 Edited at: 21st Nov 2024 11:11
Consider the symmetry of projectile motion. The y velocity will be 0 when the projectile reaches its peak. This is half the flight time.



https://kodi.onl/
PM

Login to post a reply

Server time is: 2024-12-21 15:58:19
Your offset time is: 2024-12-21 15:58:19