Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 6 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: CoD2 Bubble Problem!
nemanja-1997
General Member
Since: Jan 5, 2012
Posts: 5
Last: Jan 6, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Thursday, Jan. 5, 2012 04:23 pm
Hey all i have a Bubble script, but it dont work, idk why...
Can you help me to fix this Script....? [confused]


edited on Jan. 6, 2012 01:43 am by nemanja-1997
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Thursday, Jan. 5, 2012 10:19 pm
only if you can explain 3 things going on in that code.
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 12:14 am
asking me to write you a piece of code gives you minus one point.
asking the modsonline community to fix it for you gives you minus one point.
having no clue what the code actually does gives you minus one point.
posting the script i made for your eyes only gives you minus ten points.

Thats minus 13 points by my count. Given that 13 is my unlucky number, im not going to help you any further.
Share |
nemanja-1997
General Member
Since: Jan 5, 2012
Posts: 5
Last: Jan 6, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 08:40 am
i dont know that that was your script...
Sorrey!
Share |
Dobriy
General Member
Since: Mar 31, 2011
Posts: 96
Last: May 23, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 04:41 pm

nemanja-1997


U can use my script

Code:
main
{
level._effect["nuk"] = loadfx ("fx/zombie/dbubble_deploy.efx");
level._effect["nuks"] = loadfx ("fx/zombie/dbubble_hit.efx");
level._effect["nu"] = loadfx ("fx/zombie/dbubble_green.efx");
level._effect["s"]= loadfx ("fx/zombie/dbubble_powerdown.efx");

self.hudbuble destroy();
self.hudbuble = newClientHudElem(self);
self.hudbuble.alignx = "center";
self.hudbuble.x = 330;
self.hudbuble.y = 120; 
self.hudbuble.fontscale = 1.2;
self.hudbuble.label = &"^2`^9[^1For Delete^9]^2:";

bubble = spawn( "script_model",self.origin+(0,0,20));
bubble setModel("xmodel/bx_dbubble");
time=60;
while(1)
{
time-=0.1;
self.hudbuble setValue(int(time));
bubble rotateto((0, randomfloat(360), randomfloat(360)), 0.4);
playFx( level.fx_dbubble_loop, bubble.origin + (0,0,15));
wait 0.1;
if(time<=0 || self.pers["team"]!="allies" )
{
self.hudbuble destroy();
bubble hide();
playFx( level._effect["s"], bubble.origin );
bubble delete();
self.spawnprotected=false;
break;
}
players = getEntArray( "player", "classname" );
for( i = 0; i < players.size; i++ )
{
if(players[i].pers["team"]=="axis" && distance(bubble.origin, players[i].origin ) < 100 && isAlive(players[i]))
{
playFx( level._effect["nuks"],players[i].origin+(0,0,15));
players[i].health = players[i].health + 300;
players[i] finishPlayerDamage(players[i], players[i], 300, 0, "MOD_PROJECTILE", "panzerschreck_mp", bubble.origin, vectornormalize(players[i].origin - bubble.origin), "none", 0);
}
if(players[i].pers["team"]=="allies" && distance(bubble.origin, players[i].origin ) < 100 && isAlive(players[i]))
{
players[i].spawnprotected=true;
}
if(players[i].pers["team"]=="allies" && distance(bubble.origin, players[i].origin ) >= 100 && isAlive(players[i]))
{
players[i].spawnprotected=false;
}
}
}
}
Share |
nemanja-1997
General Member
Since: Jan 5, 2012
Posts: 5
Last: Jan 6, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 06:29 pm
Thanx but , it dont work,
bad syntax: (file 'scripts/bubble.gsc', line 2)
{
Share |
nemanja-1997
General Member
Since: Jan 5, 2012
Posts: 5
Last: Jan 6, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 07:22 pm
I fixed, Thanks Dobriy, do you have xfire?
If you have give me your username i add you :)
You are The best!!!!
Share |
tHMatt
General Member
Since: Sep 11, 2007
Posts: 473
Last: Mar 20, 2013
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 08:39 pm
This forum disgusts me now. I still visit even though I don't touch COD anymore. When I used to learn here I had to actually make effort to write the code and asked for help based on what I couldn't logically understand. This helped me get to where I am now (Degree in Computer Games Programming) ModsOnline is where it started, I only have them to thanks for where I am heading.

People coming on here posting scripts they got from opening someone else's .iwd file and asking for help because it wont work after they copied and pasted it into their mod should be shot. And people like Dobriy who consistently keeps pasting other codes in here that are broken without making the person think about the code he is implementing should also be shot.

Load the guns lads!!

MattY
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Jan. 7, 2012 12:49 am
Dobriy writes...
Quote:

nemanja-1997


U can use my script

Code:
main
{
level._effect["nuk"] = loadfx ("fx/zombie/dbubble_deploy.efx");
level._effect["nuks"] = loadfx ("fx/zombie/dbubble_hit.efx");
level._effect["nu"] = loadfx ("fx/zombie/dbubble_green.efx");
level._effect["s"]= loadfx ("fx/zombie/dbubble_powerdown.efx");

self.hudbuble destroy();
self.hudbuble = newClientHudElem(self);
self.hudbuble.alignx = "center";
self.hudbuble.x = 330;
self.hudbuble.y = 120; 
self.hudbuble.fontscale = 1.2;
self.hudbuble.label = &"^2`^9[^1For Delete^9]^2:";

bubble = spawn( "script_model",self.origin+(0,0,20));
bubble setModel("xmodel/bx_dbubble");
time=60;
while(1)
{
time-=0.1;
self.hudbuble setValue(int(time));
bubble rotateto((0, randomfloat(360), randomfloat(360)), 0.4);
playFx( level.fx_dbubble_loop, bubble.origin + (0,0,15));
wait 0.1;
if(time<=0 || self.pers["team"]!="allies" )
{
self.hudbuble destroy();
bubble hide();
playFx( level._effect["s"], bubble.origin );
bubble delete();
self.spawnprotected=false;
break;
}
players = getEntArray( "player", "classname" );
for( i = 0; i < players.size; i++ )
{
if(players[i].pers["team"]=="axis" && distance(bubble.origin, players[i].origin ) < 100 && isAlive(players[i]))
{
playFx( level._effect["nuks"],players[i].origin+(0,0,15));
players[i].health = players[i].health + 300;
players[i] finishPlayerDamage(players[i], players[i], 300, 0, "MOD_PROJECTILE", "panzerschreck_mp", bubble.origin, vectornormalize(players[i].origin - bubble.origin), "none", 0);
}
if(players[i].pers["team"]=="allies" && distance(bubble.origin, players[i].origin ) < 100 && isAlive(players[i]))
{
players[i].spawnprotected=true;
}
if(players[i].pers["team"]=="allies" && distance(bubble.origin, players[i].origin ) >= 100 && isAlive(players[i]))
{
players[i].spawnprotected=false;
}
}
}
}


at least 3 things wrong witht his code: the loadfx() is called too late, so it runs after a wait. Dont ever do this.

The typo: main should be main()

And last but not least: having a while(true) loop which breaks on one condition. Put it in the fkcing loop if you dont mind. thx.
Share |
Dobriy
General Member
Since: Mar 31, 2011
Posts: 96
Last: May 23, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Jan. 7, 2012 09:45 am
IzNoGoD writes...
Quote:
Dobriy writes...
Quote:

nemanja-1997


U can use my script

Code:
main
{
level._effect["nuk"] = loadfx ("fx/zombie/dbubble_deploy.efx");
level._effect["nuks"] = loadfx ("fx/zombie/dbubble_hit.efx");
level._effect["nu"] = loadfx ("fx/zombie/dbubble_green.efx");
level._effect["s"]= loadfx ("fx/zombie/dbubble_powerdown.efx");

self.hudbuble destroy();
self.hudbuble = newClientHudElem(self);
self.hudbuble.alignx = "center";
self.hudbuble.x = 330;
self.hudbuble.y = 120; 
self.hudbuble.fontscale = 1.2;
self.hudbuble.label = &"^2`^9[^1For Delete^9]^2:";

bubble = spawn( "script_model",self.origin+(0,0,20));
bubble setModel("xmodel/bx_dbubble");
time=60;
while(1)
{
time-=0.1;
self.hudbuble setValue(int(time));
bubble rotateto((0, randomfloat(360), randomfloat(360)), 0.4);
playFx( level.fx_dbubble_loop, bubble.origin + (0,0,15));
wait 0.1;
if(time<=0 || self.pers["team"]!="allies" )
{
self.hudbuble destroy();
bubble hide();
playFx( level._effect["s"], bubble.origin );
bubble delete();
self.spawnprotected=false;
break;
}
players = getEntArray( "player", "classname" );
for( i = 0; i < players.size; i++ )
{
if(players[i].pers["team"]=="axis" && distance(bubble.origin, players[i].origin ) < 100 && isAlive(players[i]))
{
playFx( level._effect["nuks"],players[i].origin+(0,0,15));
players[i].health = players[i].health + 300;
players[i] finishPlayerDamage(players[i], players[i], 300, 0, "MOD_PROJECTILE", "panzerschreck_mp", bubble.origin, vectornormalize(players[i].origin - bubble.origin), "none", 0);
}
if(players[i].pers["team"]=="allies" && distance(bubble.origin, players[i].origin ) < 100 && isAlive(players[i]))
{
players[i].spawnprotected=true;
}
if(players[i].pers["team"]=="allies" && distance(bubble.origin, players[i].origin ) >= 100 && isAlive(players[i]))
{
players[i].spawnprotected=false;
}
}
}
}


at least 3 things wrong witht his code: the loadfx() is called too late, so it runs after a wait. Dont ever do this.

The typo: main should be main()

And last but not least: having a while(true) loop which breaks on one condition. Put it in the fkcing loop if you dont mind. thx.


IzNoGoD,You consider yourselves as the cleverest at the given forum? Can before criticising that that is checked really up and works, you show something the instead of will philosophise before those who understands of nothing in cod2 scripting and your advice are not necessary to them, scripts are necessary to them.thx
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»