You can also lock the player into a specific form using changeForm() and setCanChangeForm(); they do not even need to have the song for that form. I wrote a little function to simplify the process. At the beginning of your script:
dofile("scripts/entities/entityinclude.lua") -- to get the FORM_* definitions
local function ensureForm(form, lockForm)
-- Since setCanChangeForm(false) prevents changing the form by any means, not just by the player,
-- we have to be careful about the order of calls.
-- Do not call setCanChangeForm() if lockForm is nil, i.e. if it has been omitted.
if lockForm == false then setCanChangeForm(true) end
if not isForm(form) then changeForm(form) end
if lockForm == true then setCanChangeForm(false) end
end
Then when you want to force the player into a specific form (for example beast form):
ensureForm(FORM_BEAST, true)And to give them back the normal form and allow changing the form again:
ensureForm(FORM_NORMAL, false)