Welcome New User
Home
|
Forums
|
Register
|
Login
|
Larger Font
Main-Menu
Home
Login
Register
Add Download
Add News
Add Tutorial *
Forums
Advertise
Affiliate Store US *
Affiliate Store UK *
Affiliate Store CA *
Angry Letter Generator
Avatar Upload
Calendar of Games
Contact
Downloads
FAQs
Forums
Member List
Member Projects
News
News Grabber *
Policy
Polls
Private Messages
Reviews
Screenshot Gallery
Search
Servers - Game
Store - Shirts *
Subscribe
Topics
Tutorials
Weblinks
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoD FAQs
HL2 Mapping
HL2 FAQs
SOF1 Mapping
Crysis Mapping
Q4 Mapping
Doom 3 Mapping
Doom 3 FAQs
UT2K3 Mapping
SOF2 Mapping
SOF2 FAQs
Lightray Modeling
General Modeling
General Modding
Adobe Photoshop
Common Mapping Errors
Readme.txt Generator
Members-Online
rabidsqurl
[Forum]
KillerCrazzy
[Today]
Sgt.Jack
[Galle]
3 Members and 14 Guests
Chat MODSonline
Join Chat
0 People Now Chatting
MODSOnline TeamSpeak
download TeamSpeak
In-The-News
Friday, Jul. 18th
MODSonair Episode 136
Thursday, Jul. 17th
E3 2008: Daily Recap
Monday, Jul. 14th
E3 2008 Latest News
Sunday, Jul. 13th
MODSonair 136 LIVE
Saturday, Jul. 12th
Brothers in Arms: HH - Baptism of Fire Walkthrough
Latest Poll
Want a MODSonline Wiki for various games?
I think a Wiki would be a great addition to MODSonline.
75.81%
I could see a benefit of a Wiki.
4.84%
I think it would take away from the community.
4.03%
Wiki sites are never good.
3.23%
Wiki... isn't that Buck Roger's robot slave?
12.1%
Read More...
10 comments
Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register
.
In The Forums
sp and gsc files
CoD 4 Single Pla..
Posts:
(4)
Views:
(40)
by rabidsqurl
mp tank fire script problem sound error
CoD 2 Level Desi..
Posts:
(7)
Views:
(39)
by newtonboy
making oldschool wisp and ammo pickups ?
CoD 4 Level Desi..
Posts:
(3)
Views:
(24)
by COLMAC
I need maps for CODUO-BASE ASSAULT
CoD and CoDUO Cu..
Posts:
(1)
Views:
(10)
by milang5
Forums
MODSonline.com 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.
Jump To:
Select Forum Category
Call of Duty: World at War
- CoD:WW Level Design
- CoD:WW Single Player
- CoD:WW General Gaming
- Offsite Links and Information
- CoD:WW Scripting
- CoD:WW Custom Map Releases
Call of Duty 4
- CoD 4 Level Design
- CoD 4 Single Player
- CoD4 General Gaming
- Offsite Links and Information
- CoD 4 Scripting
- CoD4 Custom Map Releases
- MODSCON - ALL
Call of Duty 2
- CoD 2 Level Design
- CoD 2 Single Player
- CoD2 General Gaming
- CoD2 Custom Map Releases
- CoD2 Scripting
- Offsite Links and Information
Call of Duty
- CoD Level Design
- CoDUO Level Design
- CoD General Gaming
- CoD and CoDUO Custom Map Releases
- Offsite Links and Information
MODSonline
- MODSonline
- In The News
- News Around the Web
- General
- MODSon-air
- Teamspeak Servers
- MODSCON 06
- The Wiki
General Gaming Topics
- General Gaming
- General Machinima
- General Level Editing
- General Modeling
- Classic Raven Games
- Offsite Links and Information
Half Life 2
- HL2 Level Design
- HL2 General Gaming
- HL2 Custom Map Releases
- Garry's Mod
- Offsite Links and Information
Quake 4
- Q4 Level Design
- Q4 General Gaming
- Q4 Scripting
- Q4 Custom Map Releases
- Offsite Links and Information
DOOM III
- DOOM III Level Design
- DOOM III General Gaming
- DOOM III Custom Map Releases
Quake I, II, III
- Quake 1-3 Level Design
- Quake General Gaming
- Quake Scripting
- Quake Custom Map Releases
- Offsite Links and Information
Crysis
- General Crysis
- Crysis Level Design
- Crysis Custom Releases
- Offsite Links and Info
Unreal Tournament 2003
- UT2K3 General Gaming
- UT2K3 Level Design
- UT2K3 Custom Map Releases
Battlefield
- BF2 General Gaming
- Battlefield 2142 General Gaming
- BF2 Level Design
Soldier of Fortune
- SoF Editing, Gaming, and Design
- SoFII Editing, Gaming, and Design
- SoFI & II Custom Map Releases
- SoFII Coding
- SoFI General Gaming
- SoFII General Gaming
- SoFII Server Support
Jedi Knight
- Jedi Knight - Jedi Academy
- Jedi Knight II: Jedi Outcast
- Jedi Knight II: Jedi Outcast MOD Support
Star Trek Voyager: Elite Force
- Star Trek Voyager: Elite Force MOD Support
- Star Trek Voyager: Elite Force General
Forum:
All Forums
:
Call of Duty 2
Category:
CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators:
foyleman
,
rEdrUmMDK
,
Foxhound
,
Wyatt_Earp
,
Rasta
,
StrYdeR
,
The_Caretaker
,
Cypher2004
,
batistablr
1
2
Author
Topic: injuries only ---> enemies-players ???
alfabigo
General Member
Since: Jan 16, 2008
Posts: 50
Last: Jul 8, 2008
[
view latest posts
]
Category: CoD2 Scripting
Posted: Sunday, May. 11, 2008 12:17 am
Hi,
I have 1 "trigger_use_touch" , which I active an bomb .
this bomb explode and causing injuries. But i want only . it cause damage to enemies-players . I don't wish cause injuries to my friends-players.
how i do it ?
this is part of script:
Code:
damage() { level.activar waittill ("trigger"); playfx (level._effect["explosion"], self.origin ); radiusDamage(self.origin + (0,0,12), 300, 40, 0); }
thanks in advance.
PD:excuse my language. I don't speak English
playername
Preferred Member
Since: Aug 24, 2006
Posts: 686
Last: Jul 4, 2008
[
view latest posts
]
Category: CoD2 Scripting
Posted: Sunday, May. 11, 2008 01:13 am
Ok, to do this you have to add some to your script. Let me see if there is a easy way to do this :/
edited on May. 11, 2008 01:15 am by playername
Few tips for coding.
1. Keep the script as short as possable.
2. Don't use comments unless you HAVE to point something out.
3. Don't over complicate the script, keep it orgainized and easy to read.
These help you find simple errors and makes it easy to make changes.
playername
Preferred Member
Since: Aug 24, 2006
Posts: 686
Last: Jul 4, 2008
[
view latest posts
]
Category: CoD2 Scripting
Posted: Sunday, May. 11, 2008 01:34 am
There is one thing you need to add to your map. It is a trigger_multiple in the area around the bomb. What the script does is gets all of the people in the map, checks to see if they are touching the trigger, and if they are of the player's enemy, dead.
****WHAT TO ADD****
1. MAP: Make a trigger_multiple around the area you want the enemy to die in. Give it a targetname of kill_trig. Don't make it to big.
2. SCRIPT: Change to the following code. If you wish, you can take out the comments i have added.
Code:
damage() { level.activar waittill ("trigger", other); //wait until trigger and get who triggered it. killTrig = getent("kill_trig", "targetname"); //get the trigger_multiple area to find if someone is in it or not. playfx (level._effect["explosion"], self.origin ); //play FX players = getentarray("player", "classname"); //Get all of the players on the map for(i=0;i
NOTE: This is not tested. Post errors. Anyone, please fix!
Few tips for coding.
1. Keep the script as short as possable.
2. Don't use comments unless you HAVE to point something out.
3. Don't over complicate the script, keep it orgainized and easy to read.
These help you find simple errors and makes it easy to make changes.
alfabigo
General Member
Since: Jan 16, 2008
Posts: 50
Last: Jul 8, 2008
[
view latest posts
]
Category: CoD2 Scripting
Posted: Sunday, May. 11, 2008 01:57 am
ok thanks , I will study your script ,then , I will do other questions.
regards
alfabigo
General Member
Since: Jan 16, 2008
Posts: 50
Last: Jul 8, 2008
[
view latest posts
]
Category: CoD2 Scripting
Posted: Sunday, May. 11, 2008 02:56 am
I did the following map . using your script
Code:
main() { level._effect["explosion"] = loadfx ("fx/explosions/20mm_wallexplode.efx"); level.activar = getent("activar", "targetname"); // un trigger_use_touch level.centro = getent("centro", "targetname"); // un script_origen level.centro thread damage(); } damage() { level.activar waittill ("trigger", other); //wait until trigger and get who triggered it. killTrig = getent("kill_trig", "targetname"); //get the trigger_multiple area to find if someone is in it or not. playfx (level._effect["explosion"], self.origin ); //play FX players = getentarray("player", "classname"); //Get all of the players on the map for(i=0;i
I get the following ERROR :
Quote:
******* script compile error *******
uninitialised variable 'player': (file 'maps/mp/_matarsoloenemigo.gsc', line 29)
player
suicide(); //kill the player
*
************************************
what happen ???
The_Caretaker
Preferred Member
Since: Jun 8, 2004
Posts: 11034
Last: Jul 19, 2008
[
view latest posts
]
Category: CoD2 Scripting
Posted: Sunday, May. 11, 2008 03:02 am
Code:
player[i] suicide(); //kill the player player[i].sessionstate = "dead"; //show he died.
should be
Code:
players[i] suicide(); //kill the player players[i].sessionstate = "dead"; //show he died.
alfabigo
General Member
Since: Jan 16, 2008
Posts: 50
Last: Jul 8, 2008
[
view latest posts
]
Category: CoD2 Scripting
Posted: Sunday, May. 11, 2008 03:06 am
thanks. you're right .-
alfabigo
General Member
Since: Jan 16, 2008
Posts: 50
Last: Jul 8, 2008
[
view latest posts
]
Category: CoD2 Scripting
Posted: Sunday, May. 11, 2008 05:43 am
yeah ! I found another way....It appears more simple. I post it tomorrow.
Unfortunately for testing, we must see us dead.
alfabigo
General Member
Since: Jan 16, 2008
Posts: 50
Last: Jul 8, 2008
[
view latest posts
]
Category: CoD2 Scripting
Posted: Sunday, May. 11, 2008 09:12 pm
I have here what I promised.
with the help of the script of playername. I did mine.
I don't want to use the function " suicide()".
I was anxious to use the function "radiusDamage(,,,)" . so , I search in my folder :
C: \ Program Files \ Activision \ Call of Duty 2 \ Docs \ ScriptFunctions
I found the following function:
"setplayerignoreradiusdamage (true);"
so , without using a "Trigger_multiple", this is my script:
Code:
main() { level._effect["explosion"] = loadfx ("fx/explosions/20mm_wallexplode.efx"); level.activar = getent("activar", "targetname"); // un trigger_use_touch level.centro = getent("centro", "targetname"); // un script_origen level.centro thread damage(); } damage() { while(1) { level.activar waittill ("trigger", other); //wait until trigger and get who triggered it. playfx (level._effect["explosion"], self.origin ); //play FX players = getentarray("player", "classname"); //Get all of the players on the map for(i=0;i
true and try again } radiusDamage(self.origin + (0,0,12), 300, 50 , 0); //radiusDamage([where] , [radius] , [max dmg] , [min dmg]); //wait 5 ; damage() ; break ; } }
another way: this is another code more realistic.
Code:
main() { level._effect["explosion"] = loadfx ("fx/explosions/20mm_wallexplode.efx"); level.activar = getent("activar", "targetname"); // un trigger_use_touch level.centro = getent("centro", "targetname"); // un script_origen level.centro thread damage(); } damage() { while(1) { level.activar waittill ("trigger", other); //wait until trigger and get who triggered it. playfx (level._effect["explosion"], self.origin ); //play FX players = getentarray("player", "classname"); //Get all of the players on the map for(i=0;i
== and try again else self.maxDmg = 50 ; } radiusDamage(self.origin + (0,0,12), 300, self.maxDmg , 0); //radiusDamage([where] , [radius] , [max dmg] , [min dmg]); //wait 5 ; damage() ; break ; }
for testing, do:
script-1
Quote:
setplayerignoreradiusdamage(false); ---> true
script-2
Quote:
!= ---> ==
---------------------------------------------
this works in "radiant". I was an "lonely player " . I can not see enemies injured .I hope This should work on a server.
what do you think my script?
good luck !
alfabigo
General Member
Since: Jan 16, 2008
Posts: 50
Last: Jul 8, 2008
[
view latest posts
]
Category: CoD2 Scripting
Posted: Sunday, May. 11, 2008 10:22 pm
mmmmmmmmmmmmmm....
seems that code 2 does not work as I think.
since; generalizes the variable " maxDmg " for everyone equally.
-------------------
Also, I seriously doubt another code....
help !!
1
2
MODSonline.com Forums
: Call of Duty 2 :
CoD2 Scripting
Duwayne Burnside
|
Personal Finance
|
Mortgage
|
Mortgages
|
Cheap Flights
All logos and trademarks and information in this site are property of
MODSonline LLC © 2008
.
The comments are property of their posters.
RSS news feeds for MODSonline.com can be found
News.php
.
Partners
Ask About
Advertising
Friends
Ask About
Advertising
Link to Us
468 x 60
468 x 60
468 x 60
150 x 400
140 x 40
Advertise
With Us
MODSonair
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
MODSonair Releases
•
MODSonair Episode 136
•
MODSonair Episode 135
•
MODSonair Episode 134
•
MODSonair Episode 133
•
MODSonair Special CoD:WW Episode
Next Show
The next
MODSonair
show will air LIVE on:
07/20/2008 11:00 EDT
Time remaining:
Copyright
©
2008 MODSonline
Tresware Content Management System Copyright © 2008 Tresware
Website Designed and Hosted