Author Topic: Ready made: Bullet Nova  (Read 14755 times)

0 Members and 1 Guest are viewing this topic.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Ready made: Bullet Nova
« on: September 28, 2007, 02:02:53 pm »

Two knife novas with a total of 95 knifes



procedure Nova(X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);

This procedure creates a customized circle of bullets around the specified coordinates. Very useful for coding special effects or... magic spells :D
Requires a deg2rad function (which can also be quite useful ;) )



How to use the parameters:
X & Y:
             Coordinates for the Nova
Speed:            Speed of the bullets
Decentralize:   How far the starting circle is away from it's center (= X & Y)
Power:            Power of the bullets
ID:                  Owner of the bullets
Style:             Bullettype
n:                   Number of bullets


And the code for copy & pasting:
Code: [Select]
procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);
var i: integer;
    angle: single;
begin
  angle := 2*pi/n;
  for i:=0 to n do
    CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );
end;
« Last Edit: July 18, 2008, 05:34:34 am by Avarax »
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Iq Unlimited

  • Flagrunner
  • ****
  • Posts: 864
  • mr. foobar2000
Re: Ready made: Bullet Nova
« Reply #1 on: September 28, 2007, 04:19:57 pm »
pointless, but CRAZY COOL :o. Gj, this would be fun with m79 bullets xD.

Iq Unlimited

Offline Kitty

  • Major
  • *
  • Posts: 60
Re: Ready made: Bullet Nova
« Reply #2 on: September 28, 2007, 04:47:01 pm »
A shield made out of grenades  :o that would be funny

Nice one ;)  ;D
-A female soldat player.


Offline SirJamesaford

  • Flagrunner
  • ****
  • Posts: 763
  • SirJamesaford is still in the early Beta stage.
Re: Ready made: Bullet Nova
« Reply #3 on: September 28, 2007, 04:49:07 pm »
I smell a new hexer skill....fucking a.  Cant wait to see this (that is, if this is gonna be used in hexer.)
And if the dam breaks open many years too soon
And if there is no room upon the hill
And if your head explodes with dark forebodings too
Ill see you on the dark side of the moon

Offline Thomas

  • Major
  • *
  • Posts: 76
    • mnus.de
Re: Ready made: Bullet Nova
« Reply #4 on: September 28, 2007, 06:45:00 pm »
nice work!

i wonder if this makes any difference: (performance, but im sure it doesnt)
deg/(180/pi); <-> deg*(pi/180);
the second is how you would calculte it normally imho

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Ready made: Bullet Nova
« Reply #5 on: September 28, 2007, 09:21:36 pm »
you are a goddam genius Avarax!!!
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: Ready made: Bullet Nova
« Reply #6 on: September 29, 2007, 01:51:25 am »
OMG! Perfect!
you are a goddam genius Avarax!!!
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Ready made: Bullet Nova
« Reply #7 on: September 29, 2007, 03:17:43 am »
Oh come on, how does that little piece of code make someone a genius :-|
Using a negative decentralize value btw creates a nova that goes from outside to inside instead of inside to outside.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Thomas

  • Major
  • *
  • Posts: 76
    • mnus.de
Re: Ready made: Bullet Nova
« Reply #8 on: September 29, 2007, 04:35:12 am »
alternatively you can also use a negative speed value, but somehow the knives didnt really hit my soldat
 i wanted to make some leet adminkill command /novakill *id*

Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
  if GetPiece(Text,' ',0) = '/novakill' then begin
    Nova(
       GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'X'), //X
       GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'Y'), //Y
       -6, //Speed
       50, // distance/decentralize
       100, //power
       ID, //owner
       13, //knife
       40 //n
     );
  end;
  //NOTE: This function will be called when an admin types a / command.
  Result := false; // Return true if you want to ignore the command typed.
end;

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Ready made: Bullet Nova
« Reply #9 on: September 29, 2007, 04:37:48 am »
Use a higher speed and use less decentralization.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Ready made: Bullet Nova
« Reply #10 on: September 29, 2007, 06:22:10 pm »
you're not just a genius because of THIS script, it's good, but you made Hexer!!! anyone who could do that is a genius in my book ;)

Date Posted: September 29, 2007, 07:18:38 pm
what's the max number of bullets a map can render/make at once?
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline Navy0zkr

  • Major(1)
  • Posts: 15
Re: Ready made: Bullet Nova
« Reply #11 on: January 25, 2008, 04:29:49 pm »
AND THE COMMAND?
/???
/???

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Ready made: Bullet Nova
« Reply #12 on: January 25, 2008, 06:27:13 pm »
Oh my god, stop typing in caps,

There is no command, this is just a function that you put at the start of a script and then you can call it later, so, either someone has to make you a script so you can just type /nova or something, and I can't be F***ed doing it.
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline Navy0zkr

  • Major(1)
  • Posts: 15
Re: Ready made: Bullet Nova
« Reply #13 on: January 25, 2008, 09:49:09 pm »
look my nova!



CODE:
Quote
function deg2rad(deg: single): single;
begin
  result:=deg/(180/pi);
end;

procedure Nova(X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);
var i: integer;
begin
  for i:=0 to n do
    CreateBullet(X + (cos(deg2rad(360 / n * i))*decentralize),Y + (sin(deg2rad(360 / n * i))*decentralize),(cos(deg2rad(360 / n * i))*speed),(sin(deg2rad(360 / n * i))*speed),power,style,ID);
end;
function OnCommand(ID: Byte; Text: string): boolean;
begin
  if GetPiece(Text,' ',0) = '/novakill' then begin
Nova(
       GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'X'), //X
       GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'Y'), //Y
       -5, //Speed
       40, // distance/decentralize
       100, //power
       ID, //owner
       12, //knife
       40 //n
     );
    Nova(
       GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'X'), //X
       GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'Y'), //Y
       -5, //Speed
       30, // distance/decentralize
       100, //power
       ID, //owner
       4, //knife
       40 //n
     );
  Nova(
       GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'X'), //X
       GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'Y'), //Y
       -5, //Speed
       10, // distance/decentralize
       100, //power
       ID, //owner
       4, //knife
       40 //n
     );
Nova(
       GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'X'), //X
       GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'Y'), //Y
       -5, //Speed
       5, // distance/decentralize
       100, //power
       ID, //owner
       13, //knife
       40 //n
     );
  end;
  //NOTE: This function will be called when an admin types a / command.
  Result := false; // Return true if you want to ignore the command typed.
end;
Quote
:D

Offline IvanTh3Great

  • Major(1)
  • Posts: 8
Re: Ready made: Bullet Nova
« Reply #14 on: February 12, 2008, 09:59:18 pm »
can u make this into a zip file with the sub folders and whatnot...please?

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: Ready made: Bullet Nova
« Reply #15 on: March 31, 2008, 02:48:20 pm »
So... sumthing went wrong (probably everything)
I have the deg3rag thing and after that i have:

Code: [Select]
procedure Nova(X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);
var i: integer;
begin
  for i:=0 to n do
    CreateBullet((GetPlayerStat(ID,'x') + (cos(deg2rad(360 / 50 * i))*50),(GetPlayerStat(ID,'y') + (sin(deg2rad(360 / 50 * i))*50),(cos(deg2rad(360 / 50 * i))*70),(sin(deg2rad(360 / 50 * i))*70),0,14,ID);
end;

function OnCommand(ID: Byte; Text: string): boolean;
begin
  if Text = '/Nova' then begin
    Nova;
end;

Could someone tell what went wrong?
So i want the "skill" triggered with /nova
Help?
Also Known As REIMA


Lol Happles (happy apples)

Offline sai`ke

  • Camper
  • ***
  • Posts: 318
  • Can't be arsed to remove christmas avatar
Re: Ready made: Bullet Nova
« Reply #16 on: March 31, 2008, 03:33:47 pm »
One thing is that you're missing an end. It helps to line out code so that begin and end's that belong together have the same indenting. It's easier to spot errors that way.

Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
  if Text = '/Nova' then
  begin
    Nova(X,Y,speed,decentralize, power, ID, style, n);
  end
end;

Also for X,Y,speed,decentralize, power, ID, style, n you need to either enter values or make them variables. Read the rest of the thread to find out what kind of values these take. You need to think about these and try various things depending on what you want...
« Last Edit: March 31, 2008, 03:40:52 pm by sai`ke »
#soldat.ttw #ttw.gather --- Quakenet!
http://ttwforums.com

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: Ready made: Bullet Nova
« Reply #17 on: April 01, 2008, 08:07:11 am »
I tried to do something but the script wont work!! >:(
I think scripting is driving me nutty... i just cant get it where is the problem.
Also Known As REIMA


Lol Happles (happy apples)

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Ready made: Bullet Nova
« Reply #18 on: April 02, 2008, 09:49:57 am »
how exactly does it "not work"? Got any error messages?

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: Ready made: Bullet Nova
« Reply #19 on: April 02, 2008, 01:11:59 pm »
When i try to put up the server, it gives this error:

  • MyOwn -> [Error] (19:74): Close round expected 

    that's exactly how it doesn't work :(
Also Known As REIMA


Lol Happles (happy apples)