Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

gunshot event

Here you can find ScriptAPI suggestions implemented in the game.
Forum rules
By using the forum you agree to the following rules.
Locked
User avatar
Danger Ross
Superfighter
Superfighter
Posts: 154
Joined: Thu Mar 31, 2016 12:56 am
Title: Dangerous
SFD Alias: Danger Ross
Started SFD: 14 june 2012 (launch day)
Location: California
Gender:
Age: 23

gunshot event

Post by Danger Ross » Sat Aug 03, 2019 4:27 am

My suggestion is to add an on creation event for projectiles so that scripters can alter their properties immediately as they are born. Although timers do the same job, they are sometimes unreliable. One example of this issue is when a player is too close to the origin of the bullet and gets hit by it instead of the substitute projectile that the script was meant to create.
Overall this is more of a quality of life improvement.
3 x
sorry bucko, you can't punch with swords 8-)

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Sat Aug 03, 2019 12:50 pm

I'm not sure this is possible. Once a projectile is created it does some tunneling checks you can't override and if the tunneling check hits something the projectile can't really be read from the ScriptAPI at all in any update as it's created and destroyed pretty much immediately. You can only listen on the ProjectileHit event. It would be dangerous to allow the script to change the position for example during this phase. I will take the suggestion into consideration though.
0 x
Gurt

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Sun Aug 11, 2019 11:39 am

Update:
Events.ProjectileCreatedCallback will come after v.1.3.0b. This is run before the projectile's first update cycle. See viewtopic.php?f=22&t=3770 for details.
0 x
Gurt

Locked