SRB2 Message Board  

Go Back   SRB2 Message Board > Archived > SRB2 Forum Archives > Bug Reports (2.1.X) > Bug Report Cleanup

Thread Tools Search this Thread
Old 01-19-2017   #1
*audible scribbling noises*
Prisima's Avatar
Default Freeslotting sprites doesn't work inside of functions.

If you freeslot a sprite inside of a function, like this:
addHook("ThinkFrame", do
	if not _G["SPR_ABC1"]
	for p in players.iterate
		if _G["SPR_ABC1"] = SPR_ABC1
you get an error (in addition to the sprite not being displayed):
ERROR: R_ProjectSprite: invalid sprite frame 0/0 for ABC1
But if you freeslot the sprite outside of the function, like this:

addHook("ThinkFrame", do
	for p in players.iterate = SPR_ABC1
everything is fine, the sprite displays, and no errors occur.

Last edited by Monster Iestyn; 04-25-2017 at 12:57 AM.
Prisima is offline  
Old 01-20-2017   #2
Monster Iestyn
Friendly Neighbour-Hood
Monster Iestyn's Avatar

This is because the sprite prefix doesn't exist when the WAD containing the sprites is loaded (I assume they're in the same WAD as the script here), so the game never thinks to load the lumps with the sprite prefix at all. Freeslotting the sprite after the game has already loaded the WAD won't cause the game to look again in it for sprite lumps.

Probably got some details wrong but it's really because the freeslotting doesn't take place on WAD load.
My page stuffed full of MIDI goodness!
The Hitchhiker's Guide to the Robo-Hoodiverse
Timeline of Sonic Robo Blast History!

That's an uppercase i, not a lowercase L, for the record. Also, it's pronounced "Yes-tin".
Monster Iestyn is offline  
Old 01-21-2017   #3
gender collector
fickleheart's Avatar

Why are you trying to use a sprite freeslot in a hook anyway?
<@toaster> '"sonic robot explosion 2", the hot new sensation for teens looking for a good time, tempts many children away from god each year'
av src
fickleheart is offline  

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:16 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.