Benötigen dringend Hilfe gegen Bug

Arnold
unsere _main.gsc aus dem Reignoftheundead Mod:


Code einblendenCode 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:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
killstreaksperks()
{
	while(1)
	{
		if(self.cur_kill_streak >= 25)
		{
			notifydata = spawnStruct();
			notifydata.titletext = "Perk earned:";
			notifydata.notifytext = "^1Stopping Power";
			notifydata.glowcolor = (0, 1, 0);
			notifydata.duration = 8.0;
			self thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata);
			self SetPerk("specialty_bulletdamage");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 50)
		{
			notifydata = spawnStruct();
			notifydata.titletext = "Perk earned:";
			notifydata.notifytext = "^1Double Tab";
			notifydata.glowcolor = (0, 1, 0);
			notifydata.duration = 8.0;
			self thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata);
			self SetPerk("specialty_rof");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 75)
		{
			notifydata = spawnStruct();
			notifydata.titletext = "Extra earned:";
			notifydata.notifytext = "^1More Health";
			notifydata.glowcolor = (1, 0, 0);
			notifydata.duration = 8.0;
			self thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata);
			self.maxhealth += 50;
			self.health = self.maxhealth;
			self notify("damage");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 100)
		{
			notifydata = spawnStruct();
			notifydata.titletext = "Perk earned:";
			notifydata.notifytext = "^1Sleight of Hand";
			notifydata.glowcolor = (0, 1, 0);
			notifydata.duration = 8.0;
			self thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata);
			self SetPerk("specialty_fastreload");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 150)
		{
			notifydata = spawnStruct();
			notifydata.titletext = "Extra earned:";
			notifydata.notifytext = "^1More Speed";
			notifydata.glowcolor = (1, 0, 0);
			notifydata.duration = 8.0;
			self thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata);
			speed = (getdvarint("scr_surv_playerspeed") + 0.1);
			self SetMoveSpeedScale( speed );
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 200)
		{
			notifydata = spawnStruct();
			notifydata.titletext = "Extra earned:";
			notifydata.notifytext = "^1More Health";
			notifydata.glowcolor = (1, 0, 0);
			notifydata.duration = 8.0;
			self thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata);
			self.maxhealth += 50;
			self.health = self.maxhealth;
			self notify("damage");
			break;
		}
		wait 0.1;
	}
}

killstreaks()
{
	while(1)
	{
		if(self.cur_kill_streak >= 50)
		{
			self iprintlnbold("You are on a ^1Killingspree! ^2(50+)");
			self iprintln("^2Claymores ^3received!");
			self GiveWeapon("claymore_mp");
			self GiveMaxAmmo("claymore_mp");
			self SetActionSlot(1, "weapon", "claymore_mp");
			self iprintln("^2+300 Upgrade Points!");
			self.upgradepoints += 300;
			self notify("update_upgradehud");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 100)
		{
			self iprintlnbold("You are on a ^1Rampange! ^2(100+)");
			self iprintln("^2+500 Upgrade Points!");
			self.upgradepoints += 500;
			self notify("update_upgradehud");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 200)
		{
			self iprintlnbold("You are ^1Dominating! ^2(200+)");
			self iprintln("^2C4 ^3received!");
			self TakeWeapon("claymore_mp");
			self GiveWeapon("c4_mp");
			self GiveMaxAmmo("c4_mp");
			self SetActionSlot(1, "weapon", "c4_mp");
			self iprintln("^2+700 Upgrade Points!");
			self.upgradepoints += 700;
			self notify("update_upgradehud");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 300)
		{
			self iprintlnbold("You are on a ^1ULTRAKILL! ^2(300+)");
			self iprintln("^2RPG ^3received!");
			self TakeWeapon("c4_mp");
			self GiveWeapon("rpg_mp");
			self GiveMaxAmmo("rpg_mp");
			self SetActionSlot(1, "weapon", "rpg_mp");
			self iprintln("^2+1200 Upgrade Points!");
			self.upgradepoints += 1200;
			self notify("update_upgradehud");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 400)
		{
			self iprintlnbold("You are on a ^1MONSTERKILL! ^2(400+)");
			self iprintln("^1TNT ^3received!");
			self thread zombiesurvival\_main::dotntbomb();
			self SetActionSlot(4, "weapon", "tnt_mp");
			self iprintln("^2+1500 Upgrade Points!");
			self.upgradepoints += 1500;
			self notify("update_upgradehud");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 500)
		{
			self iprintlnbold("You are ^1UNSTOPPABLE! ^2(500+)");
			self iprintln("^1AT4 ^3received!");
			self TakeWeapon("rpg_mp");
			self GiveWeapon("at4_mp");
			self GiveMaxAmmo("at4_mp");
			self SetActionSlot(1, "weapon", "at4_mp");
			self iprintln("^2+1800 Upgrade Points!");
			self.upgradepoints += 1800;
			self notify("update_upgradehud");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 600)
		{
			self iprintlnbold("You are ^1GODLIKE!!! ^2(600+)");
			self iprintln("^2+2200 Upgrade Points!");
			self.upgradepoints += 2200;
			self notify("update_upgradehud");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 700)
		{
			self iprintlnbold("You are on a ^1ROADKILL!!! ^2(700+)");
			self iprintln("^2+2500 Upgrade Points!");
			self.upgradepoints += 2500;
			self notify("update_upgradehud");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 800)
		{
			self iprintlnbold("You are ^1WICKED SICK!!! ^2(800+)");
			self iprintln("^2+2800 Upgrade Points!");
			self.upgradepoints += 2800;
			self notify("update_upgradehud");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 900)
		{
			self iprintlnbold("You are a ^1SLAUGHTER!!! ^2(900+)");
			self iprintln("^2+3100 Upgrade Points!");
			self.upgradepoints += 3100;
			self notify("update_upgradehud");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 1000)
		{
			self iprintlnbold("^5MASSACRE ^2(1000+)");
			self iprintln("^2+3300 Upgrade Points!");
			self.upgradepoints += 3300;
			self notify("update_upgradehud");
			break;
		}
		wait 0.1;
	}
	while(1)
	{
		if(self.cur_kill_streak >= 12)
		{
			notifydata = spawnStruct();
			notifydata.titletext = "HOLY SHIT!!!";
			notifydata.notifytext = self.name + " got a 1200 killstreak!!!";
			notifydata.glowcolor = (1, 0, 0);
			notifydata.duration = 6.0;
			players = getentarray("player", "classname");
			for(i=0; i<players.size; i++)
			{
				players[i] thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata );
			}
			self iprintln("^2+4000 Upgrade Points!");
			self.upgradepoints += 4000;
			self notify("update_upgradehud");
			break;
		}
		wait 0.1;
	}
}

onPlayerDisconnect()
{
	while (1)
	{
		self waittill("disconnect");
		
		if( isDefined( self.turret_gun ) ||  isDefined( self.turret_bipod ))
		{
			self notify("kill_turret");
			self.turret_gun notify("kill_turret");
			self.turret_gun delete();
			self.turret_bipod delete();
			self.Perk_bulletdamage delete();
			self.Perk_rof delete();
			self.Perk_fastreload delete();
			self.Perk delete();
			self.AllPerk delete();
		}
	
	}
}



Der Server löscht die Perks nichtmehr - wie sorge ich dafür, dass er das tut? Wenn er sie nicht löscht, gibt es das Problem, dass alle Spieler einen Serverlagg erleiden. Wir haben den script entwickelt, doch jetzt scheitern wir an einer so simplen Sache - bitte helft uns - wir werden uns dankbar erweißen, den script als GNU lizenz zu veröffentlichen (-->jeder darf den scipt in jeder weiße verwenden, außer er sagt, es sei sein eigener script. Sogar kommerziell.)


Danke schoneinmal im Voraus
Arnold
Ich habe ein 2. Script verfasst, mit dem der Server zwar startet, aber das Script tut nichts.

Code einblendenCode 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:
onPlayerDisconnect()
{
	while (1)
	{
		self waittill("disconnect");
		
		if( isDefined( self.Perk_bulletdamage )  ||  isDefined( self.Perk_bulletdamage_bipod ))
		{
			self notify("kill_perk_bulletdamage");
			self.Perk_bulletdamage notify("kill_perk_bulletdamage");
			self.Perk_bulletdamage delete();
			self.Perk_bulletdamage_bipod delete ();
		}
		wait 0.1;
	}
	while (1)
	{
		self waittill("disconnect");
		
		if( isDefined( self.turret_gun ) ||  isDefined( self.turret_bipod ))
		{
			self notify("kill_turret");
			self.turret_gun notify("kill_turret");
			self.turret_gun delete();
			self.turret_bipod delete();
		}
		wait 0.1;
	}
	while (1)
	{
		self waittill("disconnect");
		
		if( isDefined( self.Perk_fastreload )  ||  isDefined( self.Perk_fastreload_bipod ))
		{
			self notify("kill_perk_bulletdamage");
			self.Perk_fastreload notify("kill_perk_bulletdamage");
			self.Perk_fastreload delete();
			self.Perk_fastreload_bipod delete ();
		}
		wait 0.1;
	}
	while (1)
	{
		self waittill("disconnect");
		
		if( isDefined( self.Perk_rof )  ||  isDefined( self.Perk_rof_bipod ))
		{
			self notify("kill_perk_bulletdamage");
			self.Perk_rof notify("kill_Perk_rof");
			self.Perk_rof delete();
			self.Perk_rof_bipod delete ();
		}
		wait 0.1;
	}
}





Ist das denn falsch? Sorry, aber da bin ich echt Ratlos!


EDIT:
Ich habe vor, das alles von vorne zu scripten - wie funktionieren die Hardpoints wie z.b. Helicopter? In der Art und so einfach wie möglich will ich es programmieren.

Es wäre toll, wenn mal jemand ein Tutorial schreiben könnte, wie man möglichst einfach ein Hardpointsystem probgrammiert. Einschließlich Beliebiger Waffen, die man auf eine beliebigen Taste legen kann, bis zu Perks und Hardpoints, wie z.b. Nuke oder Heli.

Ich fände das mal angebracht, da ich soetwas noch nie gefunden habe. Weder Englisch noch Deutsch.
bangingbernie
HIER gibt es CoDPad Lite. Angeblich soll man damit relativ leicht scripten können.
Arnold
Das hilft mir leider nicht weiter - das ist ein normaler Texteditor, nur, dass er mir vorschläge zum Befehlsnamen macht.


Das erklärt mir nicht, warum unser Script nicht funktioniert.
Deshalb brauch ich etwas Hilfe von Fortgeschrittenen.
OLD MAN WITH GUN
Wann genau soll der player denn den Perk wieder verlieren?

Genau dort im script musst du dann testen ob der Player den perk besitzt, und wenn ja, diesen dem player wegnemen.
etwa so:

Code einblendenCode angehängt. Klicke hier zum Ein-/Ausblenden

code:
1:
2:
if( self HasPerk( "perkName" ) )
  self UnSetPerk( "perkName");

Arnold
Danke für die Antwort, aber das will auch nicht klappen -.-


Mit welchem befehl deaktiviere ich einen speziellen threat und wie mache ich eine spezielle variable oder einen beliebigen befehl rückgängig?

in diesem beispiel soll es folgendes sein:


disable threat "killstreaksperks()"

danach sollte es eig. funktionieren - ich habe einfach den killstreaksperks() threat aus der gsc entfernt und schon ging alles --> kein so nerviger 12 sekunden lagg.....



wenn ich also den "self threat killstreaksperks()" wieder ausschalten kann, bevor jemand disconnected, müsste alles klappen.


Edit:

Oder man schaltet die ganze gsc aus und schaltet eine andere an, die alles aus dießer beinhaltet. nur eben nicht die Perks

Edit2:

Ich bitte einen beliebigen user im Forum die gsc mal genau unter die lupe zu nehmen:

http://kurzer-url.ch/0ivda1

Ziel: /user/rycon.iwd

In der "rycon.iwd/rycon/_main.gsc" steht der script.

Ich bitte alle, die etwas davon verstehen, die GSC unter die Lupe zu nehmen - ich kann es leider nicht mit mehr als "credits" vergelten. ich hoffe, euch reichen credits als dank?
OLD MAN WITH GUN
Du kannst keinen thread rückgängig machen. Ein thread läuft ja eigentlich auch nur einmal durch. Nur deine endlos while Schleifen laufen halt immer weiter. Also müsstet du in die while-Schleifen eine Bedingung einbauen, die die Schleife beendet. Ich werde aber aus deinem Script nicht ganz schlau (wann soll der Spieler einen Perk bekommen und wann soll er ihn verlieren. Dein Script gibt momentan einem Spieler bei einem Killstreak von 25 den Perk stopping power. bei 26 auch, bei 27, bei 28 usw. usw.
Ab einem killstreak von 50 bekommt er Double Tap und Stopping power (da killstreak ja immer noch über 25 ist und er damit den ersten ja auch bekommt) und das führt sich immer weiter so fort (und das alle 0.1 Sekunden aufs neue). Kein Wunder das das laggt wie sau.
Anstatt >= würde ich erst mal ein reines == setzen und die wheile schleifen ganz raus.
Dann rufst du deinen thread aus dem thread Callback_PlayerKilled aus der _globallogic.gsc auf. So wird bei jedem Kill getestet, ob der Spieler (attacker) einen bestimmten Killstreakwert erreicht hat (der wird dann auch immer nur einmal durchlaufen, eine Schleife ist unnötig).

Code einblendenCode 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:
killstreaksperks()
{
	streak = self.cur_kill_streak;
	
	if( streak < 25 )
		return;
	
	if( streak == 25 )
	{
		notifydata = spawnStruct();
		notifydata.titletext = "Perk earned:";
		notifydata.notifytext = "^1Stopping Power";
		notifydata.glowcolor = (0, 1, 0);
		notifydata.duration = 8.0;
		self thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata);
		self SetPerk("specialty_bulletdamage");
	}
	else if( streak == 50 )
	{
		notifydata = spawnStruct();
		notifydata.titletext = "Perk earned:";
		notifydata.notifytext = "^1Double Tab";
		notifydata.glowcolor = (0, 1, 0);
		notifydata.duration = 8.0;
		self thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata);
		self SetPerk("specialty_rof");
	}
	else if( streak == 75 )
	{
		notifydata = spawnStruct();
		notifydata.titletext = "Extra earned:";
		notifydata.notifytext = "^1More Health";
		notifydata.glowcolor = (1, 0, 0);
		notifydata.duration = 8.0;
		self thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata);
		self.maxhealth += 50;
		self.health = self.maxhealth;
		self notify("damage");
	}
	else if( streak == 100 )
	{
		notifydata = spawnStruct();
		notifydata.titletext = "Perk earned:";
		notifydata.notifytext = "^1Sleight of Hand";
		notifydata.glowcolor = (0, 1, 0);
		notifydata.duration = 8.0;
		self thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata);
		self SetPerk("specialty_fastreload");
	}
	else if( streak == 150 )
	{
		notifydata = spawnStruct();
		notifydata.titletext = "Extra earned:";
		notifydata.notifytext = "^1More Speed";
		notifydata.glowcolor = (1, 0, 0);
		notifydata.duration = 8.0;
		self thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata);
		speed = (getdvarint("scr_surv_playerspeed") + 0.1);
		self SetMoveSpeedScale( speed );
	}
	else if( streak == 200 )
	{
		notifydata = spawnStruct();
		notifydata.titletext = "Extra earned:";
		notifydata.notifytext = "^1More Health";
		notifydata.glowcolor = (1, 0, 0);
		notifydata.duration = 8.0;
		self thread maps\mp\gametypes\_hud_message::notifyMessage( notifydata);
		self.maxhealth += 50;
		self.health = self.maxhealth;
		self notify("damage");
	}
}



und das in die _globallogic.gsc bei Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration)

Code einblendenCode angehängt. Klicke hier zum Ein-/Ausblenden

code:
1:
2:
3:
attacker thread name_Deiner_gsc_Datei::killstreakPerks();

Rycoon
Jetzt möchte ich euch mal aufklären. ^^

Zuerst, ich habe diese Skripte geschrieben. ;D
Ich geben zu damals war ich noch nicht ganz so begabt in Skripting und habe deshalb auch den einen oder anderen Bug drin. Dass das Skript jede Zehnte Sekunde durchläuft ist falsch. Denn sobald er 25 oder mehr Kills hat wird der loop durch das Break; beendet.

Würde ich nun ein == anstelle eines >= nehmen, dann könnte es zu Problemen kommen da der Spieler auch zwei Kills mit einmal machen kann.

Um das Problem beim Skript zu lösen dachte ich vllt an ein Endon. Füge am Anfang von dem Thread einfach noch folgendes hinzu:

self endon("disconnect");
self endon("death");

Wenn der Thread nur einmal aufgerufen wird (also nur ein einziges mal) dann lass einfach das self endon("death"); weg.

Ich hoffe ich konnte helfen.

Bei Fragen fragt mich einfach. grosses Grinsen
OLD MAN WITH GUN
Das mit den while-Schleifen würde ich dennoch ändern. Ohne die Schleifen und mit dem richtigen Einsprung nur wenn es auch nötig ist (nämlich wenn ein Kill passiert) senkt das die Serverlast.
Arnold
http://openwarfaremod.com/owforum/viewtopic.php?f=82&t=4786

Der war einen hauch schneller als ihr^^

Er bekommt die credits. Sry, aber danke für die hilfe - das hier kann stehen bleiben, um anderen zu helfen.