Test Arrest Command Issues

Status
Not open for further replies.
The game crashes if I use the testarrest command that I made after an enemy becomes my target. Also, I want to make it where if I'm looking at an object it becomes my target for testing purposes.

Code:
COM_AddCommand("testarrest", function(player)
	if player.mo.target
		player.mo.arrestedplayer = player.mo.target
	else
		player.mo.arrestedplayer = nil
		CONS_Printf(player, "No objects found to arrest!")
		return
	end
	
	if player.mo
		P_LinedefExecute(64, player.mo.arrestedplayer, player.mo.subsector.sector)
	end
end)

Log.txt:
Compiled for SDL version: 2.0.4
Linked with SDL version: 2.0.3
Setting up SRB2...
Looking for WADs in: SRB2WADDIR,.
Z_Init(): Init zone memory allocation daemon.
System memory: 2047MB - Free: 2047MB
I_StartupTimer()...
W_InitMultipleFiles(): Adding IWAD and main PWADs.
Added file C:\Users\ZachandTim\Desktop\My Files\Games\SRB2\2.1\srb2.srb (6214 lumps)
Loading main config from C:\Users\ZachandTim\Desktop\My Files\Games\SRB2\2.1\srb2.srb
Added file C:\Users\ZachandTim\Desktop\My Files\Games\SRB2\2.1\zones.dta (962 lumps)
Loading main config from C:\Users\ZachandTim\Desktop\My Files\Games\SRB2\2.1\zones.dta
Added file C:\Users\ZachandTim\Desktop\My Files\Games\SRB2\2.1\player.dta (526 lumps)
Added file C:\Users\ZachandTim\Desktop\My Files\Games\SRB2\2.1\rings.dta (444 lumps)
Added file C:\Users\ZachandTim\Desktop\My Files\Games\SRB2\2.1\patch.dta (94 lumps)
Added file C:\Users\ZachandTim\Desktop\My Files\Games\SRB2\2.1\music.dta (171 lumps)
I_StartupGraphics()...
NOTE: Under SDL2, all modes are supported on all platforms.
Under opengl, fullscreen only supports native desktop resolution.
Under software, the mode is stretched up to desktop resolution.
0: 1920x1200
1: 1920x1080
2: 1680x1050
3: 1600x1200
4: 1600x900
5: 1366x768
6: 1440x900
7: 1280x1024
8: 1280x960
9: 1280x800
10: 1280x720
11: 1152x864
12: 1024x768
13: 800x600
14: 640x480
15: 640x400
16: 320x240
17: 320x200
Current Video Mode
320x200 at 16 bit color
Stored in system memory
CPU Info: 486: 1, 586: 1, MMX: 1, 3DNow: 0, MMXExt: 0, SSE2: 1
HU_Init(): Setting up heads up display.
Number of console HUD lines is now 5
executing config.cfg
Default resolution: 640 x 400 (8 bits)
M_Init(): Init miscellaneous info.
R_Init(): Init SRB2 refresh daemon.
R_LoadTextures()...
P_InitPicAnims()...
R_InitSprites()...
srb2.srb added 2975 frames in 231 sprites
player.dta added 163 frames in 1 sprites
rings.dta added 431 frames in 18 sprites
patch.dta added 1 frames in 1 sprites
Added skin 'tails'
Added skin 'knuckles'
R_InitColormaps()...
Number of Extra Colormaps: 0
S_Init(): Setting up sound.
ST_Init(): Init status bar.
D_CheckNetGame(): Checking network game status.
Entering main game loop...
I_StartupKeyboard()...
===========================================================================
We hope you enjoy this game as
much as we did making it!
...wait. =P
===========================================================================
Sonic Robo Blast 2 v2.1.19 (May 28 2017 12:27:09 22232832)
Starting Server....
Binding to 0.0.0.0:5029
Network system buffer: 64Kb
Contacting the server...
Sending join request...
Join accepted, waiting for complete game state...
Player 1 has joined the game (node 0)
Speeding off to level...
Map is now "MAP01: GREENFLOWER ZONE 1"
Player 1 renamed to Choalover
$addfile gfz_cave_b3.wad
Added file ./gfz_cave_b3.wad (12 lumps)
Loading main config from ./gfz_cave_b3.wad
MAP01
Current map 1 replaced by added file, ending the level to ensure consistency.

Speeding off to level...
Map is now "MAP01: GREENFLOWER ZONE 1"
$addfile testjailscript.lua
Added file ./TestJailScript.lua (1 lumps)
Loading Lua script from ./TestJailScript.lua
Pardon me while I initialize the Lua scripting interface...
Added command "testarrest"
Added command "gototestjail"
No maps added
$testarrest
No objects found to arrest!
$testarrest
No objects found to arrest!
$testarrest
No objects found to arrest!
$testarrest
No objects found to arrest!
$testarrest
No objects found to arrest!
$testarrest

I_Error(): P_MapStart: tmthing set!
I_ShutdownGraphics(): shut down
I_ShutdownTcpDriver: shut down
I_ShutdownSystem(): end of logstream.
 
Last edited:
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Top