Okay, I've gotten the art of creating sprites in script under my belt. Now it's high time I learned how to create sprite definitions in script. I'm starting out by just trying to create one sprite definition. Once I get that figured out, I'll rewrite this loop to include all the sprites I want to copy. Here's my plan: I'll go ahead and create all the player and weapon sprites that will be need for each map. I'll trigger this sub to copy all the sprite definitions:
Sub CopySprites
With ProjectObj.Maps("Home_Mesa_Interior")
dim I
I = 0
Do While I < .SpriteDefCount
If .SpriteDefs(I).Name = "Player_jumping_right_1" Then Set NewJumpLeftSpr = .SpriteDefs(I).Clone
I = I + 1
Loop
End With
End Sub
Then, whenever the player gets to a new map, I'll trigger this sub to put all those sprite definitions into the map:
Sub LoadSprites
With ProjectObj.Maps("Home_Desert")
Set NewJumpLeftSpr.rPath = .Paths(1)
NewJumpLeftSpr.Name = "Player_jumping_right_6"
Set NewJumpLeftSpr.Template = .SpriteTemplates("Player_jumping_right")
.AddSpriteDef HostObj.AsObject(NewJumpLeftSpr)
End With
End Sub
Problem is, once the player is supposed to change over to the jumping sprite, he just kinda disappears... That's telling me I have created a definition (since I would otherwise get an error), but sort of an empty shell of a definition. The map where I'm loading the sprite definition has a template named Player_jumping_right already. It usually changes to a sprite named Player_jumping_right_2, but I'm manually making it try to change to _6 to test if the definition is being made.
The scripts I'm looking at for this are GoldYoink and Wudd, both of which do way more object creation than I plan on, so maybe that's where I missed something. Any help will, as always, be greatly appreciated.