|
 |
AWE LR Sniper |
|
|
wie ich dir schon in der PM geschrieben hab brauch ich mehr Infos um dir zu helfen.
__________________

|
|
|
|
|
Dr.Longunregistriert

|
|
schonmal den modordner nach anderen/AWE-fremden moddateien durchwühlt? der mainordner der clients sollte ebenfalls frei von moddateien sein!
|
|
|
|
|
|
|
Das hilft so gut wie gar nicht lol.
1. Hitlocations
Die Anzeige der Hitlocations für die Longrange Sniper erfordert sehr gute Scriptkenntnisse da alle Hitlocations komplett
neu erstellt werden mussen. Läuft derzeit soviel ich weiss nur auf 2 Snipservern.
Die Hitlocation wird standardmässig mit "none" angezeigt da die Longrange Sniper eine modifizierte Panzerfaust
oder Racketenwerfer ist.
1. Distanzanzeige
Ist die Distanzanzeige Standard im AWE oder habt ihr Sie hinzugefügt, wenn ja wo und wie sieht das Script dazu aus.
Allgemein: Die Distanzanzeige sollte in einem player killed Teil des Scripts sein und im Normalfall sie ist unabhängig von der Waffe.
3. Waffe
Wird die Longrange dem Spieler automatisch zugewiesen zb Anstelle der Pistole oder ist sie im Menü frei wählbar?
Wenn ihr in Game die Sniper wechselt steht rechts unten der korrekte Name?
__________________

|
|
|
|
|
Bill(ACR)
5-Minuten-Ei

Dabei seit: 25.05.2009
Beiträge: 10

|
|
hi wir sind selber am modden wieder mal am awe weil der einfach besser spielbar ist und da wir auch einen sniperserver haben hatten wir das mal bei dem extreme mod mit dem hitloc gemacht anhand dieser anleitung
Your projectile weapon got you down?…
You can’t stand getting hit in the toe and have instant death?
Well girls here is, this the answer to all your problems. No, it is not a new pimple cream (though I bet a few of you young scripters out there could use some) it is HITLOC for long range sniper rifles.
Let’s see how we go about it.
One key is knowing that the means of death (sMeansOfDeath = "MOD_PROJECTILE") is from the projectile long range weapon and that the game engine will automatically give you 100+ points of iDamage (that’s the stuff that kills you) for any, I mean, any hit location (HITLOC). Further, the game engine will not even return a HITLOC for the Projectile (too bad as that would have made this super easy)
So what we really need here is HITLOC so that we can set the proper iDamage for each type of HITLOC (e.g. headshot, leg shot , neck shot. Etc.) To get this we will assign some markers to various body parts at spawn time so that we can use them later.
Then, we need trap for projectile weapon hits in the Callback_PlayerDamage routine of each gametype you want to have this for then calculate the distance to each body part marker and then do some simple “triangulation” to figure about where it hits. Then with this “HITLOC” you can just set the iDamage you like.
First let’s see what we need.
At spawn time lets set some markers…
Both eXtreme and AWE use about the same code to set body markers for various reasons like GetStance and Sprint Sound. AWE puts this code in _Player.gsc (around line 60) and eXtreme in _ex_main.gsc (around line 653)
AWE: in _player.gsc
Code angehängt. Klicke hier zum Ein-/Ausblenden
| code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
|
RunOnSpawn()
{
awe\_util::remove_blackscreen(self);
// Kill any running threads
self notify("awe_killthreads");
// Wait for threads to die
wait .05;
self.awe_helmetpopped = false;
// Attach spinemarker, used by GetStance()
// This may work better? "J_Spine4"
if(isdefined(self.awe_spinemarker))
{
self.awe_spinemarker unlink();
self.awe_spinemarker delete();
}
self.awe_spinemarker = spawn("script_origin",(0,0,0));
self.awe_spinemarker linkto (self, "J_Spine4",(0,0,0),(0,0,0));
if(isdefined(self.ex_headmarker))
{
self.ex_headmarker unlink();
self.ex_headmarker delete();
}
self.ex_headmarker = spawn("script_origin",(0,0,0));
self.ex_headmarker linkto (self, "J_Head",(0,0,0),(0,0,0));
//ASP Long range HITLOC
if(!isDefined(self.ex_eyemarker))
{
self.ex_eyemarker = spawn("script_origin",(0,0,0));
self.ex_eyemarker linkto (self, "tag_eye",(0,0,0),(0,0,0));
}
// Attach ankle marker, used by ADS
if(!isDefined(self.ex_lankmarker))
{
self.ex_lankmarker = spawn("script_origin",(0,0,0));
self.ex_lankmarker linkto (self, "j_ankle_le",(0,0,0),(0,0,0));
}
if(!isDefined(self.ex_rankmarker))
{
self.ex_rankmarker = spawn("script_origin",(0,0,0));
self.ex_rankmarker linkto (self, "j_ankle_ri",(0,0,0),(0,0,0));
}
if(!isDefined(self.ex_lwristmarker))
{
self.ex_lwristmarker = spawn("script_origin",(0,0,0));
self.ex_lwristmarker linkto (self, "j_wrist_le",(0,0,0),(0,0,0));
}
if(!isDefined(self.ex_rwristmarker))
{
self.ex_rwristmarker = spawn("script_origin",(0,0,0));
self.ex_rwristmarker linkto (self, "j_wrist_ri",(0,0,0),(0,0,0));
}
//ASP
.
.
. |
|
For eXtreme: in _ex_main.gsc
Code angehängt. Klicke hier zum Ein-/Ausblenden
| code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
|
.
.
.
exPostSpawn()
{
level endon("ex_gameover");
self endon("disconnect");
self notify("ex_spawned");
// wait for threads to die
wait 0.5;
if(isPlayer(self))
{
// Attach spinemarker, used by GetStance()
if(!isDefined(self.ex_spinemarker))
{
self.ex_spinemarker = spawn("script_origin",(0,0,0));
self.ex_spinemarker linkto (self, "J_Spine4",(0,0,0),(0,0,0));
}
// Attach headmark, used by sprint sound
if(!isDefined(self.ex_headmarker))
{
self.ex_headmarker = spawn("script_origin",(0,0,0));
self.ex_headmarker linkto (self, "J_Head",(0,0,0),(0,0,0));
}
//ASP range
/*/ Attach elbow marker, used by ADS
if(!isDefined(self.ex_elbowmarker))
{
self.ex_elbowmarker = spawn("script_origin",(0,0,0));
self.ex_elbowmarker linkto (self, "J_Elbow_bulge_ri",(0,0,0),(0,0,0));
}
// Attach thumb marker, used by ADS
if(!isDefined(self.ex_thumbmarker))
{
self.ex_thumbmarker = spawn("script_origin",(0,0,0));
self.ex_thumbmarker linkto (self, "J_Thumb_ri_1",(0,0,0),(0,0,0));
*/
// Attach eye marker, used by ADS
if(!isDefined(self.ex_eyemarker))
{
self.ex_eyemarker = spawn("script_origin",(0,0,0));
self.ex_eyemarker linkto (self, "tag_eye",(0,0,0),(0,0,0));
}
// Attach ankle marker, used by ADS
if(!isDefined(self.ex_lankmarker))
{
self.ex_lankmarker = spawn("script_origin",(0,0,0));
self.ex_lankmarker linkto (self, "j_ankle_le",(0,0,0),(0,0,0));
}
if(!isDefined(self.ex_rankmarker))
{
self.ex_rankmarker = spawn("script_origin",(0,0,0));
self.ex_rankmarker linkto (self, "j_ankle_ri",(0,0,0),(0,0,0));
}
if(!isDefined(self.ex_lwristmarker))
{
self.ex_lwristmarker = spawn("script_origin",(0,0,0));
self.ex_lwristmarker linkto (self, "j_wrist_le",(0,0,0),(0,0,0));
}
if(!isDefined(self.ex_rwristmarker))
{
self.ex_rwristmarker = spawn("script_origin",(0,0,0));
self.ex_rwristmarker linkto (self, "j_wrist_ri",(0,0,0),(0,0,0));
}
//ASP
self thread playerThreads();
}
}
.
.
. |
|
Now that sets the markers. On to the real code…
Here one must know that one of the arguments of callback_player_damage is Vpoint which turns out is the point on the body the hit was made in vector coordinates. So what we do is determine how far this point is from the eye, head, neck, wrist(s), ankle(s), and spine and then use this to figure out where on the body the hit was so that we can manually set HITLOC and iDamage. We use the distance function (like in the range finder) then set the MOD to bullet (from projectile). That is…
sMeansOfDeath = "MOD_RIFLE_BULLET";
and then we set iDamage to whatever you like for each case.
Note: please excuse the pedestrian method that I use here and the poor logic but it works ok for me. The distances were derived through trial and error and are not totally wringed out and there is a lower_torso hitloc for when the logic fails to capture a location. Give it a try. Be advised that the iDamage for the normal short range sniper will kill you if you get hit in the gut and does greater damage elsewhere as well. I just took the SR weapon our completely and just use the long range one with the short range zoom and reticle. Have fun!
Code angehängt. Klicke hier zum Ein-/Ausblenden
| code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
|
Callback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime)
{
if(self.sessionteam == "spectator" || self.ex_invulnerable) return;
//ASP Long range
if(isDefined(eAttacker) && isDefined(self))
{
if(isDefined(eAttacker.origin) && isDefined(self.origin))
{
range = int(distance(eAttacker.origin, self.origin));
rangedist = int(range * 0.04);
if(isDefined(sMeansOfDeath))
{
if((sMeansOfDeath == "MOD_PROJECTILE"))
{
rangee = 0;
startOrigine = [];
startOrigine = self.ex_eyemarker.origin;
rangee = int(distance(vPoint, startOrigine));
rangela = 0;
startOriginla = [];
startOriginla = self.ex_lankmarker.origin;
rangela = int(distance(vPoint, startOriginla));
rangera = 0;
startOriginra = [];
startOriginra = self.ex_rankmarker.origin;
rangera = int(distance(vPoint, startOriginra));
rangelw = 0;
startOriginlw = [];
startOriginlw = self.ex_lwristmarker.origin;
rangelw = int(distance(vPoint, startOriginlw));
rangerw = 0;
startOriginrw = [];
startOriginrw = self.ex_rwristmarker.origin;
rangerw = int(distance(vPoint, startOriginrw));
rangehm = 0;
startOriginrw = [];
startOriginrw = self.ex_headmarker.origin;
rangehm = int(distance(vPoint, startOriginrw));
rangesm = 0;
startOriginrw = [];
startOriginrw = self.ex_spinemarker.origin;
rangesm = int(distance(vPoint, startOriginrw));
sMeansOfDeath = "MOD_RIFLE_BULLET";
sHitLoc = "torso_lower";// might use none here.
iDamage = 50;
if(rangee <= 8 && rangehm <= 9)
{
sMeansOfDeath = "MOD_HEAD_SHOT";
sHitLoc = "head";
iDamage = 100;
}
if(rangehm <= 5 && rangee >= 8)
{
sMeansOfDeath = "MOD_RIFLE_BULLET";
sHitLoc = "neck";
iDamage = 75;
}
if(rangesm <= 6)
{
sMeansOfDeath = "MOD_RIFLE_BULLET";
sHitLoc = "torso_upper";
iDamage = 100;
}
if(rangee > 8 && rangee < 25 && rangesm <= 18 && rangesm > 6)
{
sMeansOfDeath = "MOD_RIFLE_BULLET";
sHitLoc = "torso_lower";
iDamage = 50;
}
if(rangee > 25 && (rangera > 10 && rangera < 30))
{
sMeansOfDeath = "MOD_RIFLE_BULLET";
sHitLoc = "right_leg_upper";
iDamage = 34;
}
if(rangee > 25 && (rangela > 10 && rangela < 30))
{
sMeansOfDeath = "MOD_RIFLE_BULLET";
sHitLoc = "left_leg_upper";
iDamage = 34;
}
if(rangera <= 10 && rangee >30)
{
sMeansOfDeath = "MOD_RIFLE_BULLET";
sHitLoc = "right_foot";
iDamage = 26;
}
if(rangela <= 10 && rangee >30)
{
sMeansOfDeath = "MOD_RIFLE_BULLET";
sHitLoc = "left_foot";
iDamage = 26;
}
if(rangerw <= 6)
{
sMeansOfDeath = "MOD_RIFLE_BULLET";
sHitLoc = "right_hand";
iDamage = 26;
}
if(rangelw <= 6)
{
sMeansOfDeath = "MOD_RIFLE_BULLET";
sHitLoc = "left_hand";
iDamage = 26;
}
}
}
}
}
//ASP
|
|
IPB
aber wir bekommens auch nicht so richtig hin, fehler der noch da ist, das
der headshoot nicht angezeigt wird, distanz geht aber , und verletzen tut die waffe auch wenn uns einer weiterhelfen könnte währe das echt cool .
achso wenn es jemand versuchen will da ist es einmal für extreme und einmal für AWE erklärt, und wenn ihr die scripte so einbauen wollt dan immer die stelle ab
//ASP
einfügen
an der richtigen stelle versteht sich ;-))
mfg Bill



achso scheißt auf das neue mw 2 lieber gute cod2/4 server ;-))
schade hatte mich so gefretu lol
--- Edit by Nightwing_ Code richtig eingefügt ---
Dieser Beitrag wurde 2 mal editiert, zum letzten Mal von Nightwing: 22.10.2009 21:54.
|
|
|
|
|
|
|
|
 |
Impressum ||Datenschutzerklärung
|