This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Forum rules

spawning grenade dud

Give us your input on how we may improve the ScriptAPI in the game in future versions.
Forum rules
By using the forum you agree to the following rules.
Locked
User avatar
gwendalaze
Superfighter
Superfighter
Posts: 84
Joined: Sat Mar 19, 2016 12:55 pm
Title: Jarate Yellow Belt
Started SFD: PreAlpha 1.1.4
Location: France

spawning grenade dud

Post by gwendalaze » Sun Jul 03, 2016 1:05 am

So, I was wondering if it is possible

According to the API, SpawnWeaponItem("WpnGrenadesThrown",...); will spawn a live grenade
Thank you in advance
4 x
- Gwendalaze, failing at being fun, just like this signature

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 27

Post by JakSparro98 » Tue Jul 19, 2016 1:08 am

if, for a live grenade, you mean a thrown grenade, the used script is not the one for creating weapons but the one used for creating object, like this:

Game.CreateObject("WPNGRENADESTHROWN" , new Vector2 (x,y));

So with this sintax you spawn a thrown grenade at the coordinates of x and y variables that you could change into numbers, variables, etc.

Obviously you need the method for use this command so the complete script is:

public void Grenade(TriggerArgs arg)
{

Game.CreateObject("WPNGRENADESTHROWN" , new Vector2 (0,0));

}


Create a button in your map then place the name of the method "Grenade" in the Script method section and test the map, if you press the button the grenades will spawn at the center of the map (because for the zeroes that I put in the coordinates of the Vector2).
0 x

User avatar
gwendalaze
Superfighter
Superfighter
Posts: 84
Joined: Sat Mar 19, 2016 12:55 pm
Title: Jarate Yellow Belt
Started SFD: PreAlpha 1.1.4
Location: France

Post by gwendalaze » Tue Jul 19, 2016 1:23 am

JakSparro98 wrote:if, for a live grenade, you mean a thrown grenade, the used script is not the one for creating weapons but the one used for creating object, like this:

Game.CreateObject("WPNGRENADESTHROWN" , new Vector2 (x,y));

So with this sintax you spawn a thrown grenade at the coordinates of x and y variables that you could change into numbers, variables, etc.

Obviously you need the method for use this command so the complete script is:

public void Grenade(TriggerArgs arg)
{

Game.CreateObject("WPNGRENADESTHROWN" , new Vector2 (0,0));

}


Create a button in your map then place the name of the method "Grenade" in the Script method section and test the map, if you press the button the grenades will spawn at the center of the map (because for the zeroes that I put in the coordinates of the Vector2).
thanks jaksparro, but I alreay know how to code
My question was concerning disabled grenades, and, at this point, I guess there is no way
1 x
- Gwendalaze, failing at being fun, just like this signature

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 27

Post by JakSparro98 » Tue Jul 19, 2016 10:45 pm

Oh, sorry if I treated you like a newbie.
You said you want a grenade that not explode instead of this, right? As you said I don't think now we can control the internal timer of the grenades or disable it.

We need to tell this to gurt only to know if in a future we could edit weapons and objects more deeply.
1 x

Locked