Give us your input on how we may improve the ScriptAPI in the game in future versions.
-
NearHuscarl
- Superfighter

- Posts: 97
- Joined: Thu Feb 07, 2019 4:36 am
Post
by NearHuscarl » Sun Mar 01, 2020 1:18 pm
Can you add a fifth parameter in IGame.SpawnProjectile() to show the explode effect when the bullet is out of the barrel?
Can you add the exploding barrel effect when bullet is going out of the barrel?

Last edited by
NearHuscarl on Tue Mar 10, 2020 4:07 am, edited 2 times in total.
0 x
-
Mr Argon
- Fighter

- Posts: 56
- Joined: Sat Mar 09, 2019 2:22 am
- SFD Account: Argón (steam)
- SFD Alias: Mr. Argon
- Started SFD: Pre-Alpha 1.8.2c
- Location: Argentina
- Gender:
- Age: 22
Post
by Mr Argon » Sun Mar 01, 2020 9:03 pm
You actually can use Game.PlayEffect() to achieve that. Search the ScriptAPI for effect names and parameters.
1 x
I'м д Liттlэ оdd... sтill саи livе шiтн тнат.
-
NearHuscarl
- Superfighter

- Posts: 97
- Joined: Thu Feb 07, 2019 4:36 am
Post
by NearHuscarl » Mon Mar 02, 2020 3:59 am
I'd looked into EffectNames before I posted this. Unless I missed something, there is no way to do that.
0 x
-
Gurt
- Lead Programmer

- Posts: 1887
- Joined: Sun Feb 28, 2016 3:22 pm
- Title: Lead programmer
- Started SFD: Made it!
- Location: Sweden
- Gender:
- Age: 36
Post
by Gurt » Mon Mar 02, 2020 7:30 pm
Try to create the effect by using the string "MZLED" which REQUIRES args[0] to be an int. Just send in 0.
0 x
Gurt
-
NearHuscarl
- Superfighter

- Posts: 97
- Joined: Thu Feb 07, 2019 4:36 am
Post
by NearHuscarl » Mon Mar 02, 2020 8:13 pm
Code: Select all
Game.PlayEffect("MZLED", Vector2.Zero, 0);
Showed nothing. Log said failed to create effect. I assume the arg[0] is the UniqueID of an IObject but changing it to the id of a nearby object still didn't work.
0 x
-
Mr Argon
- Fighter

- Posts: 56
- Joined: Sat Mar 09, 2019 2:22 am
- SFD Account: Argón (steam)
- SFD Alias: Mr. Argon
- Started SFD: Pre-Alpha 1.8.2c
- Location: Argentina
- Gender:
- Age: 22
Post
by Mr Argon » Tue Mar 03, 2020 12:05 am
Try checking in the script of "Operation Sunrise" un "The Courtyard" part, there are some flak cannons that use this code. Just copypaste an tweak it, it should work that way.
0 x
I'м д Liттlэ оdd... sтill саи livе шiтн тнат.
-
NearHuscarl
- Superfighter

- Posts: 97
- Joined: Thu Feb 07, 2019 4:36 am
Post
by NearHuscarl » Tue Mar 03, 2020 4:04 am
Mr Argon wrote: ↑Tue Mar 03, 2020 12:05 am
Try checking in the script of "Operation Sunrise" un "The Courtyard" part, there are some flak cannons that use this code. Just copypaste an tweak it, it should work that way.
Thank you! I didn't know that, it works perfectly now. Gurt should update the EffectNames btw because I didn't see it
Code: Select all
// Second argument Position is useless
// arg[0] is IObject's Unique ID. the argument will be spawned at IObject.GetWorldPosition()
// arg[1] is the weapon muzzle. So far I found
// "MuzzleFlashAssaultRifle" - AssaultRifle
// "MuzzleFlashL" - M60
// "MuzzleFlashM" - MP50, Pistol, Pistol45
// "MuzzleFlashS" - Cabine, Flare Gun, Grenade Launcher, Magnum, Revolver, Sniper
// "MuzzleFlashBazooka" - Bazooka
// "MuzzleFlashShotgun" - Dark Shotgun, Pump Shotgun
Game.PlayEffect("MZLED", Vector2.Zero, m_tip.UniqueID, "MuzzleFlashAssaultRifle");
0 x