• Do not use Works in Progress as a way of avoiding the releases system! Works in Progress can be used for sharing early betas and for getting suggestions for improvement. Releases of finished content are not allowed in this forum! If you would like to submit a finished addon, click here for instructions on how to do so.

Is size manipulation possible for a character WAD?

Status
Not open for further replies.

Zoroark

Member
So, I'm sure everyone knows about how they modify your size in Egg Rock Zone Act 2 if they've played through the game... I want to know if it's possible to do that but as a character WAD feature. Is it possible to do that?

Also, I just joined the forum, so sorry if it's hard to understand my questions until I get used to posting here.

I'm going to be making my first character WAD soon, but I mostly want to find out what is possible and what is not possible first, in terms of character features. So, any ideas if this would be possible?
 
Code:
addHook("MobjSpawn", function(mo)
	mo.scaleinit = 1 // tells the script whether to initialise brak's scale (1) or not (0)
	mo.normscale = mo.scale // "normal" scale
	mo.brakscale = mo.scale*4 // "brak" scale
	mo.banim = 0 // brak attack animation currently being used
	mo.oldbuttons = 0 // stores what buttons were pressed last tic
end, MT_PLAYER)

// Function for MobjThinker hook to use, required to be in function(mobj) format
// "return false" or "return" on its own allows the normal behaviour to carry on as normal after this
// "return true" would make this stop the normal behaviour from running after this
// in this case at least we don't need to (or want to) overwrite normal player behavior, that would cause some problems!
local function HandleBrakScale(brak)
	if not brak.player //somehow this isn't even a player??
		return
	end
	
	if brak.normscale == nil or brak.brakscale == nil //EMERGENCY
		brak.normscale = brak.scale
		brak.brakscale = brak.scale*4
	end
	
	//29/03/14 - Handle scales here now, and in a much more simple manner! Far more efficient now
	if brak.skin == "brakeggman"
		if brak.scaleinit
			brak.scale = brak.brakscale // set to brak scale
			brak.scaleinit = 0
		end
	else //normal skins - switching skins is properly supported now!
		if brak.scale == brak.brakscale
			brak.scale = brak.normscale
		end
		brak.scaleinit = 1
	end
end

addHook("MobjThinker", HandleBrakScale, MT_PLAYER)

Ripped straight from Brak Eggman's lua file, just edit it to work for your character and it should work probably maybe?

EDIT: You might also want to set the SF_HIRES skin flag then set highresscale.
 
Last edited:
Status
Not open for further replies.

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

Back
Top