dvar mit Trigger_use_touch

AUT HK Moto6
Hi Alle!

Ich bin neu hier und moöchte alle begrüssen. Ich bin ein Hobby-Mapper und habe schon einige kleine Problemchen mit Hilfe dieses Boards gelöst.
Dafür möchte ich mich bedanken.

So jetzt zu meiner Frage.
Kann man eine server dvar mit einem Trigger_use_touch setzen?

Ich möchte in der Map mit einem Button die Spielgeschwindigkeit erhöhen.
Also Map startet mit normaler Geschwindigkeit (200) und wenn man den Button drückt dann erhöht sich die Geschwindigkeit.
Dazu gibt es eine dvar /set g_speed 200 (standard) welche man während des Spiels setzen kann, vorausgesetzt man hat das RCON Passwort. Die Geschwindigkeit wird sofort erhöht, mann muß die Map nich neu starten.

Also geht das, die dvar gemeinsam mit dem RCON passwort in ein Skript rein, welches dann über einen trigger_use_touch ausgeführt wird?
serthy
ja, kein problem

in die map einen trigger setzen
key: targetname
value: trigger_speed

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:
init()
{
	level.speedTrigger_addValue = getDvarInt( "scr_speedtrigger_add" );	// in config anpassen, 0 = disabled

	wait( 5.0 );	//warten bis alles initialisiert wurde, sonst error!

	if( level.speedTrigger_addValue )
		thread setUp_SpeedTrigger();
}

setUp_SpeedTrigger()
{
	speedtriggers = getentarray( "trigger_speed" , "targetname" );	// du kannst mehrere trigger_speed in deine map setzen
	
	for( i = 0 ; i < speedtriggers.size ; i++ )
	{	
		speedtriggers[i] thread speedTrigger_think();
	}
}

speedTrigger_think()
{
	for( ; ; )
	{
		self waittill( "trigger" , player );

		setDvar( "g_speed" , getDvarInt( "g_speed" ) + level.speedTrigger_addValue );	// speed wird umm "scr_speedtrigger_add" erhöht
	}
}



man kann das auch anders machen, das ist die einfachste version
z.b. dass nur bestimmte spieler (per guid) den trigger aktivieren können oder das es 2 trigger gibt, der eine machts schneller, der andere langsamer
AUT HK Moto6
Besten Dank, ich werds testen!
AUT HK Moto6
Nach einigem herumprobierern hab ichs jetzt so gemacht!

Hier mal der Link zu nem Video in dem man das fertige Ergebnis sieht.

Video

Im Radianten hab ich nen trigger_use_touch erstellt
targetname -- sound_1

hab an der Stelle ein Radio platziert.

dann hab ich ein neues Skript in raw/maps/mp/ erstellt -- mp_test1_sound_1.gsc

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:
 main()
 {
 thread radio();
 } 
 radio()
 {  radiotrigger = getent ("sound_1","targetname");
 while (1) 
 {
 radiotrigger waittill ("trigger"); 
 iPrintlnBold("^4(!!*^1ACHTUNG^4*!!)");
 wait(1);
 iPrintlnBold("^4(!!*^1ES WIRD SCHNELLER IN^4*!!)");
 musicplay ("sound_2");                         //hier wird der erste sound gestartet
 iPrintlnBold("^4(!!*^15^4*!!)");            //Text einblenden
 wait(1); 
 iPrintlnBold("^4(!!*^14^4*!!)");
 wait(1); 
 iPrintlnBold("^4(!!*^13^4*!!)");
 wait(1);
 iPrintlnBold("^4(!!*^12^4*!!)");
 wait(1);
 iPrintlnBold("^4(!!*^11^4*!!)");
 wait(1);
 iPrintlnBold("^4(!!*^1LOS^4*!!)");
 musicstop( 0 );                                     //hier wird der erste sound gestoppt
 musicplay ("sound_1");                         //hier wird der zweite sound gestartet
 wait(1);
 setdvar("g_speed","500");                     //geschwindigkeit erhöhen
 wait(29);
 iPrintlnBold("^4(!!*^1UND ES WIRD NOCH SCHNELLER^4*!!)");
 wait(1.5);
 setdvar("g_speed","1000");                    //geschwindigkeit noch mehr erhöhen
 wait(30.5);
 iPrintlnBold("^4(!!*^1SO, KURZE VERSCHNAUFPAUSE^4*!!)");
 MusicStop( 0 );                                    //zweiten sound stoppen
 setdvar("g_speed","250");                    //geschwindigkeit auf standard setzen
 wait(10);
 iPrintlnBold("^4(!!*^1RADIO BEREIT IN 60 SEKUNDEN^4*!!)");
 wait(59);
 iPrintlnBold("^4(!!*^1DAS RADIO IST JETZT WIEDER BEREIT!^4*!!)");
 wait(1);
 }
 self thread radio();
 return;
 }



die vielen "wait()" Befehle dienen nur dem Timing damit es auch zur Musik passt

dieses Skript lasse ich aus der raw/maps/mp/mp_test1.gsc (die gsc. file für die map) mit dieser Zeile aufrufen (oben unter "maps\mp\_load::main();" einfügen)

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

code:
1:
maps\mp\mp_test1_sound_1::main();



wie ihr seht befinden sich zwei sounds in dem Skript. Der erste Sound der abgespielt wird (sound_2) ist das von 5 abwärts zählen (hab ich nachträglich eingefügt deswegen sound_2), der zweite sound (sound_1) ist die Musik.

Diese beiden sounds muss man in den soundaliases definieren.
Die Datei befindet sich in raw/soundaliases/mp_test1.csv (Dateiname je nach Mapname) und sieht so aus

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:
"#""If the first column for a row is blank"," then the row is ignored""",
# The first non-comment line of a sound alias file specifies the key name for all values appearing in this column.,,
"# This means it is safe to swap entire columns around, though you should never swap partial columns.",,
"# You can invent new keys, but the game will ignore them if it doesn't know about them.",,
"# You can leave out keys, but the ""name"" and ""file"" keys must always be present.",,

,name,name of the alias that is used to play this sound (required)
,sequence,"used to uniquely identify alias entries when more than one sound goes to an alias, used only to catch unwanted duplicates (default = 0)"
,file,the name of the file that contains the sound data (required)
,vol_min,"0 is silent, 1 is full volume (default = 1)"
,vol_max,"0 is silent, 1 is full volume (default = same as vol_min)"
,vol_mod,"blank causes no effect on vol_min and vol_max, otherwise the string must match a string in the volumemodgroups.def file and the value in that file corresponding to that string will be used to adjust vol_min and vol_max, clamped to the valid range"
,pitch_min,"1 is normal playback, 2 is twice as fast, 0.5 is half as fast (default = 1)"
,pitch_max,"1 is normal playback, 2 is twice as fast, 0.5 is half as fast (default = same as pitch_min)"
,dist_min,"within this distance in inches, the sound is always full volume (default = 120)"
,dist_max,"outside this distance in inches, the sound is not started.  If left blank or set to 0, the sound will play from any distance.  This does not affect sound volume falloff."
,channel,"auto, menu, weapon, voice, item, body, weapon, weapon, announcer (default = auto)"
,type,primed (a streamed sound which gets primed on some platforms) / streamed / loaded (default = loaded)
,probability,weight to use for the weighted probability of playing this sound instead of another sound (default = 1)
,loop,"whether this sound is ""looping"" or ""nonlooping"" (default = ""nonlooping"")"
,masterslave,"if ""master"", this is a master sound.  If a number, then this sound's volume will be multiplied by that number (a percentage between 0 and 1) any master sound is playing.  If blank, then neither master nor slave."
,loadspec,"space-separated list of which maps should use this alias; eg, ""burnville dawnville"".  If blank, the alias is used on all maps."
,compression,"a string corresponding to an entry in ""XMAUpdate.tbl"" which is used to determine compression by XMAUpdate.exe"
,secondaryaliasname,"defined the name of an additional sound alias to play in addition to the current alias being played. Note that it is an error for the secondaryalias to also define a secondaryaliasname (eg, if B is a secondaryalias of A, B is not allowed to have its own secondaryalias)."
,volumefalloffcurve,if blank uses the linear curve which can not be changed. A string 'XXXX' corresponds to the curve defined by the file 'soundaliases/XXXX.vfcurve'
,startdelay,defaults to no delay. The value is the number of milliseconds to delay starting the sound by
,speakermap,if blank uses the default speakermappings which cannot be changed. A string 'XXXX' corresponds to the speakermap defined by the file 'soundaliases/XXXX.spkrmap'.
,reverb,"blank means the alias is affected normally by wet and dry levels, ""fulldrylevel"" forces the alias to use a full drylevel (ignoring the global drylevel), ""nowetlevel"" forces the alias to use no wetlevel (ignoring the global wetlevel)"
,lfe percentage,this determines what percentage of the highest calculated spatialized speaker volume should be passed to the LFE. blank means no LFE for the sound
,center percentage,this determines what percentage of the volume should be redirected to the center channel (equal percentage taken from all speakers).
,platform,"used by XMAUpdate to determine whether the alias should be processed for a particular platform.  If blank, process for all platforms.  Platforms are PC, XB, PS, WI.  Multiple values should be separated by spaces.  !PC will exclude alias from PC but include in all other platforms.  PC will only include alias for PC.  !PC XB is invalid."
,envelop_min,any sounds within this distance of the listener will use the full envelop percentage
,envelop_max,sounds between enevlop_min and envelop_max use a fraction of the envelop percentage,,,,,,,,,,,,,,,,,,,,,,,,,,
,envelop percentage,amount of omnidirectionality to apply,,,,,,,,,,,,,,,,,,,,,,,,,,

name,sequence,file,vol_min,vol_max,vol_mod,pitch_min,pitch_max,dist_min,dist_max,channel,type,probability,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,volumefalloffcurve,startdelay,speakermap,reverb,lfe percentage,center percentage,platform,envelop_min,envelop_max,envelop percentage

#Mapsounds,,,,,,,,,,,,,,,,,,,,,,,,,

sound_1,1,music/sound_1.mp3,1,1,,1,1,7,50000,music,streamed,,,,mp_test1,,,,,,,,,,,,,
sound_2,1,music/sound_2.mp3,1,1,,1,1,7,50000,music,streamed,,,,mp_test1,,,,,,,,,,,,,



Ich lasse die sounds als "music" laufen damit sie von allen Spielern auf der ganzen Map gleich laut gehört werden.

So, diese Zeile dann noch in die Zone Files eintragen ("Update Zone Files" in den Compile Tools)

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

code:
1:
rawfile,maps/mp/mp_test1_sound_1.gsc



Die Beiden sounds müssen natürlich in die .iwd Datei der map, und zwar nach
sounds/music/
mit dem Dateinamen sound_1.mp3 und sound_2.mp3
serthy
super smile

sieht gut aus

auch die killtexte sind 1A grosses Grinsen
mirko911
@AUT HK Moto6

du hast ne PM xD