aboutsummaryrefslogtreecommitdiff
path: root/bobthebob.testing/scripts/vscripts/sh_bobtestingfunctions_mp.gnut
blob: 70bc5165b2d3402dea6363887d5ab220f43b31c0 (plain)
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
globalize_all_functions

void function DumpPdefEnum( string pdefEnum )
{
	for ( int i = 0; i < PersistenceGetEnumCount( pdefEnum ); i++ )
		print( PersistenceGetEnumItemNameForIndex( pdefEnum, i ) )
}

void function ListPlayers()
{
	foreach ( entity player in GetPlayerArray() )
	{
		if ( player == null )
			continue
	
		print( "player " + player.GetPlayerName() + ": G" + player.GetGen() + "." + player.GetLevel() )
	}
}

void function DumpPdefTable()
{
	foreach ( key0, value0 in shGlobalMP.playerStatVars )
	{
		foreach ( key1, value1 in value0 )
		{
			foreach ( key2, statData in value1 )
			{
				print ( statData.statVar )
			}
		}
	}
}

void function DumpModels()
{
	for ( int i = 0; i < 2048; i++ )
		if ( GetEntByIndex( i ) != null && GetEntByIndex( i ).GetModelName() != $"?" )
			print( i + ": " + GetEntByIndex( i ).GetModelName() )
}

void function DumpScoreEvents()
{
	int i = 0;
	while ( true ) 
	{
		ScoreEvent event 
		try event = ScoreEvent_FromId( i ) catch ( exception ) break
			
		print( "event " + i + ":" )
		print( "name: " + event.name )
		print( "splashText: " + event.splashText )
		
		// get string representation of displaytype
		// if squirrel has a better way to do this i don't know it
		string displayType
		
		if ( event.displayType & eEventDisplayType.HIDDEN )
			displayType += "HIDDEN, "
		if ( event.displayType & eEventDisplayType.CENTER )
			displayType += "CENTER, "
		if ( event.displayType & eEventDisplayType.MEDAL )
			displayType += "MEDAL, "
		if ( event.displayType & eEventDisplayType.CALLINGCARD )
			displayType += "CALLINGCARD, "
		if ( event.displayType & eEventDisplayType.ATTRITION )
			displayType += "ATTRITION, "
		if ( event.displayType & eEventDisplayType.BIG )
			displayType += "BIG, "
		if ( event.displayType & eEventDisplayType.GAMEMODE )
			displayType += "GAMEMODE, "
		if ( event.displayType & eEventDisplayType.CHALLENGE )
			displayType += "CHALLENGE, "
		if ( event.displayType & eEventDisplayType.MEDAL_FORCED )
			displayType += "MEDAL_FORCED, "
		if ( event.displayType & eEventDisplayType.SHOW_SCORE )
			displayType += "SHOW_SCORE, "
		
		print( "displayType: " + displayType )
		print( " " ) // newline
		
		i++
	}
	
	print( "got " + i + " events!" )
}

void function DumpConversations()
{
	foreach ( string k, v in GetConversationToIndexTable() )
		print( k )
}

#if CLIENT 
void function TestMarkRUI()
{
	var rui = CreateCockpitRui( $"ui/speedball_flag_marker.rpak", 200 )
	RuiSetBool( rui, "isVisible", true )
	RuiSetFloat3( rui, "pos", GetLocalViewPlayer().GetOrigin() )
	RuiSetBool( rui, "playerIsCarrying", false )
	RuiSetInt( rui, "teamRelation", TEAM_IMC )
	RuiSetBool( rui, "isCarried", false )
}

void function TestObjectiveRUIHunted()
{
	var rui = CreateCockpitRui( $"ui/hunted_objective.rpak", 200 )
	RuiSetGameTime( rui, "startTime", Time() )
	RuiSetGameTime( rui, "endTime", Time() + 20.0 )
	RuiSetString( rui, "objectiveTitleText", "#HUNTED_OBJECTIVE_TITLE" )
	RuiSetFloat( rui, "blingDuration", 5.0 )
	RuiSetBool( rui, "showAll", true )
}

void function TestObjectiveRUIFW()
{
	var rui = CreateCockpitRui( $"ui/fw_objective_text.rpak" )
	RuiSetString( rui, "objective", "deez nuts" )
	
	float time = Time() + 10.0
	while ( time > Time() )
	{
		RuiSetString( rui, "objective", "deez nuts " + ( time - Time() ) )
		WaitFrame()
	}
	
	RuiDestroy( rui )
}

void function RespawnWhy()
{
	for ( int i = 0; i < 500; i++ ) // this only works in lobby, luckily
		GetLocalViewPlayer().ClientCommand( "test_clientsetplaylistvaroverride " + i + " whyyyyy" )
}
#endif