Kamikaze Plugin

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
Jefenry
Private First Class
Private First Class
Posts: 154
Joined: Thu Sep 14, 2006 3:56 pm
Location: TextEdit
Contact:

Kamikaze Plugin

Post by Jefenry »

I've been working on a map recently that would benefit from a plugin similar to shockwave death. I had in mind if a player hit delete their tank would explode with a shockwave, but any other type of death wouldn't result in the shockwave.

I have no plugin making knowledge, so would someone be willing to make it?

Thanks
pacman87
Private First Class
Private First Class
Posts: 23
Joined: Sat Jul 01, 2006 3:35 pm

clarification

Post by pacman87 »

Will this map have rico or another way for the player to kill themself without pressing delete?

I'm not sure how to determine whether you killed yourself via delete or by shooting yourself. Other than that, it shouldn't be too hard.
User avatar
Jefenry
Private First Class
Private First Class
Posts: 154
Joined: Thu Sep 14, 2006 3:56 pm
Location: TextEdit
Contact:

Post by Jefenry »

The map will have death physics and rico. I could live with a shockwave after dying by either of those methods, if there's no way to determine if you killed yourself by delete or not.
Enigma
Private First Class
Private First Class
Posts: 211
Joined: Sat Apr 23, 2005 3:13 am

Post by Enigma »

If this is done, delete would not be the key to use. You would probably have to create a new slash command (ex: /blowup) that simply fires a world weapon shock wave where you are at.

In addition, if you want to get points when the world weapon blows up a tank, you would need to set killerID in PlayerDieEvent to the ID of the player who used the command. This also requires the programmer to keep track of the shot ID passed to bz_fireWorldWep() and checking for that ID in the DieEvent (there is a data member in the DieEventData struct that stores the shot ID).
pacman87
Private First Class
Private First Class
Posts: 23
Joined: Sat Jul 01, 2006 3:35 pm

Post by pacman87 »

can't you just set the fromPlayer in bz_fireWorldWep()?
User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

Post by L4m3r »

That tends to not work well, in my experience. if I recall, it frequently caused the server and/or clients to crash.
Optimism is just a milder alternative to denial.
User avatar
Cheshire
Private First Class
Private First Class
Posts: 17
Joined: Mon Apr 07, 2008 8:29 pm
Location: BZFlag 2.0.10.app

Post by Cheshire »

Is someone actually working on this :?:
Team BA!
(Better Agent)
Don't install linux on me!
patlkil
Private First Class
Private First Class
Posts: 10
Joined: Sat Jul 22, 2006 6:48 pm

Post by patlkil »

I can try to write a plug-in which blows you up witha shockwave when you use a slash command. Not more...

Greets,
patlkil
patlkil
Private First Class
Private First Class
Posts: 10
Joined: Sat Jul 22, 2006 6:48 pm

Post by patlkil »

Well, here you have the plugin. It compiles fine but I couldn't test it because my BZFS doesn't load plugins because of some reason. :?

The plug-in attached will add a slash command /blowup which blows you up and fires a world weapon where you are. Hope it works.
Maybe someone who knows more about that than me can look at this a second time. :)

Greets,
patlkil
Attachments
kamikaze.cpp
(1.26 KiB) Downloaded 269 times
Enigma
Private First Class
Private First Class
Posts: 211
Joined: Sat Apr 23, 2005 3:13 am

Post by Enigma »

I made a few changes so that scores are updated. This was done by basically copying and pasting some code from my mine plug-ins, since I know the code works. This might not compile though; I don't have 2.0.10 sources and cannot compile it.

I think you need 2.0.10 for this to work. I can't remember.

So here is the code for an untested plug-in that might not even compile. :roll:

[edit] And two minutes later, my first edit. You forgot to call bz_freePlayerRecord() to free the memory allocated by bz_getPlayerByIndex(). I also converted all tabs to spaces. Tabs are annoying. :) [/edit]
Attachments
Kamikaze.cpp
(2.74 KiB) Downloaded 275 times
Post Reply