Create Random world weapons

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
The Noah
Private First Class
Private First Class
Posts: 30
Joined: Mon Jul 11, 2016 9:38 pm
Location: U.S.A
Contact:

Create Random world weapons

Post by The Noah » Thu Oct 12, 2017 2:55 am

I was wondering if someone could give me some code to make the fallowing plug-in:
Creates random world weapons at random positions and random rotations. After a once the shot the world weapon(s) and the shot reloads the world weapon(s) change to another random position and rotation. Have variables (set through the config) that would set the world size (or if that can be detected that would be great), how often shots are fired, and what type of shots are fired (e.g. SW, US, GM, etc.)

Please PM me with the code and not post it.

Thanks,
The Noah

User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 659
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Re: Create Random world weapons

Post by allejo » Thu Oct 12, 2017 3:52 am

Search the API and learn for yourself: https://wiki.bzflag.org/Functions_(API); there's a section for "world weapon management." As for world size, it's a BZDB variable; there's a function for that too. There's also the API header file which is the authoritative source until the official documentation is done: https://github.com/BZFlag-Dev/bzflag/bl ... /bzfsAPI.h

You'd get a better response from me, and possibly others, if you make an attempt first on what code you've tried and ask for feedback from there. I find saying, "hey write this code for me but send it to me privately because I don't want others to see it or learn from it" to be just rude.

If others just write code for you, it'll be a disservice to you since you'll never learn.
Here's my personal website and my open source projects are available on GitHub; I work on a lot of cool things.

Image

User avatar
The Noah
Private First Class
Private First Class
Posts: 30
Joined: Mon Jul 11, 2016 9:38 pm
Location: U.S.A
Contact:

Re: Create Random world weapons

Post by The Noah » Thu Oct 12, 2017 2:06 pm

There are a few things I would like to say.
1. I searched the API, and found the world weapon management, but I don't know how to use it.
2. I don't know how I would control multiple world weapons, and keep them separate.
3. I thought of making some code first, but knew I wouldn't get anything other then the frame.
4.
I find saying, "hey write this code for me but send it to me privately because I don't want others to see it or learn from it" to be just rude
I'm sorry you find it rude, and it kinda is, but first, someone requested me making a plug-in for them, and said for it to be private. And seconds, since I didn't know the main part (what makes it do what it does), I ask on the forums.

I'm sorry for being rude,
The Noah

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5120
Joined: Fri Dec 13, 2002 4:11 am
Location: [Redacted]
Contact:

Re: Create Random world weapons

Post by JeffM » Thu Oct 12, 2017 2:11 pm

The world weapon api is very simple, call a function, weapon is triggered, end of story. All world weapons art triggered separately, so your comment of how to “keep them seperate” makes no sense. What are you trying to do that is so are for you?

Calling functions is basic programming....

User avatar
Zehra
Private First Class
Private First Class
Posts: 279
Joined: Sun Oct 18, 2015 3:36 pm
Location: Arctic
Contact:

Re: Create Random world weapons

Post by Zehra » Thu Oct 12, 2017 4:31 pm

From my understanding of plug-ins:

A plug-in will call a function when an event happens.
The logic and functions are all up to whoever decides to write the plug-in.

A list of some plug-ins which use world weapons which have been released on the forums.
(These plug-ins are not part of the official distribution)

* Turret Plugin Release
Triggers world weapons based on players.
* Grenade flag release - as seen on Apocalypse
Fires a shockwave based on timing and where a shot is heading.
* SnakeShots
World weapons are used to "fake/make" extra shots for a player.
* CustomFlags
World weapons are used to "fake/make" extra shots for a player.
* UselessMine - Create mines with the Useless flag (2.x)
World weapons are fired when players drive on zones set by players.
* ProximityMine - What UselessMine should have been (2.x)
World weapons are fired when players reach zones set by players.
* UselessMine - Create Mines with the Useless Flag Once Again!
A version of the useless mines plug-in for 2.4.x.

A list of plug-ins from the official distribution which use world weapons are listed below.(At the time of writing from this post)

* ShockwaveDeath
* wwzones

Hopefully these plug-ins can help give an idea of what can be done with world weapons and to also help assist in writing a plug-in.

-Zehra
There's this game I love and it's called Ducati. ~Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
There's always something to remember and it's been a game I love. ~Zehra
The time spent is a time which can never be regained, so it's a time to enjoy. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
The details and the skill of knowing and applying them is what excellence is made of. ~Zehra
The best player is the one who knows what to do and when and applies it successfully. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra
My blog is available at zehrahblog.wordpress.com.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests