Author Topic: How to kill with CreateBullet without using explosive rounds?  (Read 4304 times)

0 Members and 1 Guest are viewing this topic.

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #20 on: July 02, 2010, 10:24:08 am »
Also, i cant remember that DoDamageBy exists, it isnt even in the scripting manual. :\
Did you try  DoDamage(i, Killer, 4000)
In 2.7.0 DoDamage replaces DoDamageBy.

And the problem is that you don't check for activeness of player(player can be alive and active). If that won't help try replacing GetPlayerStat(alive) with GetPlayerStat(health) > 0.
« Last Edit: July 02, 2010, 10:25:39 am by Gizd »

Offline croat1gamer

  • Veteran
  • *****
  • Posts: 1327
  • OMG CHANGING AVATAR!!! ^ω^
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #21 on: July 02, 2010, 10:45:22 am »
Oh.
Is he using 2.7.0 or 2.6.5?
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #22 on: July 02, 2010, 10:48:10 am »
2.6.5, in 2.7.0 all weapon parameters are byte not string.

Offline croat1gamer

  • Veteran
  • *****
  • Posts: 1327
  • OMG CHANGING AVATAR!!! ^ω^
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #23 on: July 02, 2010, 10:54:47 am »
Yeh, i was thinking he was writing the script for 2.6.5, not 2.7.0. :\
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #24 on: July 02, 2010, 09:19:44 pm »
actually what this segment does is kill all zombies in 400 metre radius of Victim if Killer has Barret and is in "sight"

heres the full script :(attached)

@croatgamer: correct, my host is using 1.6.5

SN: DoDamageBy is commented out in the script as its causing instability (amazing how commenting out ONE line fixes all issues :S)

edit: actually i removed the DoDamageBy line

From: July 02, 2010, 11:40:32 pm
i just found out my host is using server version 2.6.6 for his customers
« Last Edit: July 02, 2010, 11:40:32 pm by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #25 on: July 07, 2010, 08:38:27 pm »
btw, if i use DoDamage with the syntax as DoDamageBy i get an "incorrect number of parameters" error so i have to use CreateBullet
« Last Edit: July 07, 2010, 08:49:00 pm by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #26 on: July 08, 2010, 06:59:41 am »
Because DoDamage has the additional parameter Shooter in the beta server and DoDamageBy was removed due to that.
Hint: eC's manual is already up-to-date with the beta server, so don't use it if your not knowing much about all the functions in soldat scripting ;f If you would you would've known this :/

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #27 on: July 08, 2010, 01:27:38 pm »
well im not using 2.7.0, and DoDamage(Shooter,Victim,Damage) doesnt work so what else can i use? CreateBullet doesnt work too well because zombies are always near walls so the created bullets somehow miss their targets even tho the bullet is spawned on each zombie and goes straight up

and, i know about the functions i the ec help center, but thats for 2.7.0, NOT 2.6.6 which is more like 2.6.5, which is why i dont use the ec help center, it would be different if my host was actually using 2.7.0 then i WOULD use it, but since he isnt, i cant use it because the code there is incorrect for 2.6.6, how is it incorrect? well i copy and paste...lets say a function with a begin and end, sometimes only that is enough to cause errors, especially when its an updated function name

so, i ask again, what else can i use to kill zombies that are in range of a raycast effectively, without using explosive rounds? explosive rounds are the only things that do work 100%, but BULLETS MISS, and bullets have a hit rate of about 30% compared to explosive rounds and DoDamageBy(which i cant use apparently) hangs the server. how do i get around that, explosions are causing too much CPU usage on host

there MUST be something i can use, all help appreciated :)
« Last Edit: July 08, 2010, 01:30:38 pm by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #28 on: July 09, 2010, 06:37:02 am »
this sounds quite mysterious. Try it again with DoDamageBy, but add "if getplayerstat(i,'Active') = true then" after your "for i := 1 to  32 do"

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #29 on: July 14, 2010, 01:22:35 am »
Hung the server again

Code: (pascal) [Select]
if Weapon = 'Barrett M82A1' then begin
for i := 1 to 32 do
begin
x := GetPlayerStat(Victim,'x');
y := GetPlayerStat(Victim,'y');
x2 := GetPlayerStat(i,'x');
y2 := GetPlayerStat(i,'y');
if RayCast(x,y,x2,y2,Dist,400) then begin
if i <> Killer then begin   
if GetPlayerStat(i,'Alive') = true then begin
//WriteLn(IDtoName(i)+' is in range of Raycast');
CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-1000,100, 3, Killer);
              if getplayerstat(i,'Active') then DoDamageBy(i, Killer, 99);
BioKills[Killer]:=BioKills[Killer]+1;
end;
end;
end;
end;
WriteConsole(Killer,'Bio-Kills: '+Inttostr(BioKills[Killer]),$EE81FAA1);
BioKills[Killer]:=BioKills[Killer]*0;
end;

full code in attachment
check out my server! click here

If at first you don't succeed, Improvise! :D

DarkCrusade

  • Guest
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #30 on: July 14, 2010, 10:08:33 am »
The way your script works is very inefficient. You access the position of Killer 32 times, in my version I only access it once. Also you must check whether the ID you are trying to access is active before trying to get values from it. Also this could be interesting for you:

Ineffective:
Code: (pascal) [Select]
if (...) then begin
  if (...) then begin
 
  end;
end;

Effective:
Code: (pascal) [Select]
if ((...) AND (...)) OR (...) then begin

end;

Also: Instead of "BioKills[Killer]:=BioKills[Killer]*0;" you can just set its value like "BioKills[Killer] := 0;".

Code: (pascal) [Select]
Procedure OnPlayerKill(Killer,Victim:Byte; Weapon:String);
var
  X1,X2,Y1,Y2:Single
  i:Byte;
begin
  if Weapon = 'Barrett M82A1' then begin
GetPlayerXY(Victim,X,Y)
  for i := 1 to 32 do if (GetPlayerStat(i,'Active') = true) then begin
GetPlayerXY(i,X2,Y2);
if RayCast(X1,Y1,X2,Y2,Dist,400) AND (i <> Killer) AND (GetPlayerStat(i,'Alive') = true) then begin
//WriteLn(IDtoName(i)+' is in range of Raycast');
CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-1000,100, 3, Killer);
                                DoDamageBy(i, Killer, 99);
BioKills[Killer]:=BioKills[Killer]+1;
end;
end;
WriteConsole(Killer,'Bio-Kills: '+Inttostr(BioKills[Killer]),$EE81FAA1);
BioKills[Killer] := 0;
end;

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #31 on: July 14, 2010, 01:21:09 pm »
ooh i see, many thanks Dark

this might help me with other scripts also :)
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #32 on: July 14, 2010, 02:00:45 pm »
wow, just had to comment on the line
BioKills[Killer] = BioKills[Killer] * 0

.........seriously?!

Without trying to sound condescending, I think you should go learn assembly and then C++ to have a better understanding of how the computer works.  You'll learn how to be much more efficient with programming concepts.  In my opinion, people should learn in this order:
1- physics
2- chemistry
3- electronic theory
4- analog design
5- logic design
6- digital design
7- microprocessors and assembly
8- C++
9- youdotherest
Can't think of anything original to put here...

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #33 on: July 14, 2010, 02:02:53 pm »
Without trying to sound condescending, I think you should go learn assembly and then C++ to have a better understanding of how the computer works.  You'll learn how to be much more efficient with programming concepts.  In my opinion, people should learn in this order:
1- physics
2- chemistry
3- electronic theory
4- analog design
5- logic design
6- digital design
7- microprocessors and assembly
8- C++
9- youdotherest
you forgot
0- common sense

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #34 on: July 14, 2010, 02:05:11 pm »
Without trying to sound condescending, I think you should go learn assembly and then C++ to have a better understanding of how the computer works.  You'll learn how to be much more efficient with programming concepts.  In my opinion, people should learn in this order:
1- physics
2- chemistry
3- electronic theory
4- analog design
5- logic design
6- digital design
7- microprocessors and assembly
8- C++
9- youdotherest
you forgot
0- common sense

haha, i ddin't put it because i thought it was common sense to have common sense :P (but you're right)
Can't think of anything original to put here...

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #35 on: July 14, 2010, 07:13:51 pm »
OMFG my server is such a f**king douche, it hung again, with that code

From: July 14, 2010, 07:19:18 pm
i think DodamageBy is for 2.7.0 not 2.6.6 since my server doesnt like it, so ill just have to put up with BioKills not working right, unless i put a bullet to the left and right going into the player at high velocity, like my sig says, if at first you dont succeed, improvise :D

unless there is something OTHER THAN DoDamageBy AND CreateBullet, if there isnt, just say so, im getting sick of going round in circles here

if zombies all happen to be in the air, then the createbullet works fine 100%, but if they near wall, most of the bullets miss, and hit at 0-30%, i need something thats EFFICIENT (works 100%) and is NOT CreateBullet OR DoDamageBy
« Last Edit: July 14, 2010, 07:40:04 pm by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

DarkCrusade

  • Guest
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #36 on: July 15, 2010, 01:16:24 am »
The server can crash when you choose a too high velocity.

Change...
CreateBullet(GetPlayerStat(i,'x'),GetPlayerStat(i,'y') - 0, 0,-1000,100, 3, Killer);
To...
CreateBullet(GetPlayerStat(i,'X'),GetPlayerStat(i,'Y'),0,0,350,5,Killer);

DoDamageBy() works just fine. It's all about CreateBullet(). I changed the bulletstyle to 5 (flames) and the hit multiplier to 350%. This should totally work now.

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #37 on: July 15, 2010, 06:41:16 am »
Quote
The server can crash when you choose a too high velocity.
Not really.

Just freakin' ask eC if he knows why DoDamageBy doesn't work correctly, either way your a fucking stupid cunt or, well there's no real or.
It works, prolly it's because of some other script you use, learn2debug.

DarkCrusade

  • Guest
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #38 on: July 15, 2010, 07:03:40 am »
I already crashed my server with 8 CreateBullets with high velocity..

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: How to kill with CreateBullet without using explosive rounds?
« Reply #39 on: July 15, 2010, 12:58:13 pm »
well why is it that the server works perfect as soon as i REMOVE DoDamageBy?

i dont get it, and how the hell would i debug whats causing DoDamageBy to not work? and whats your server version Dark? if its 2.7.0 then thats the problem because mine IS NOT 2.7.0.....

also, if i use flames in CreateBullet, with No bullet Velocity, just 1 CreateBullet with flames lags the server to shit
« Last Edit: July 15, 2010, 01:04:16 pm by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D