Re: Ask a simple question, get a simple answer
Posted: Thu Apr 18, 2019 10:23 am
Ok, I tried your method as is. I had this problem :
I ended up with :
Code: Select all
function testknockback()
myFacing = party.facing
destination = (party.facing+2)%4
print(tostring(myFacing).." -> "..tostring(destination))
if (destination ~= nil) then
party.party:knockback(destination)
end
end
But the main point is when I use this with the chest open, the chest close itself, then open itself and I have my flickering again ! Here is the full code :
Code: Select all
function checkContent()
nbArtefact=0
for myIndex, myObject in chest_2.surface:contents() do
if (myObject.go.name == "fidget_spinner" or myObject.go.name == "vilson_orb" or myObject.go.name == "lava_truc") then
nbArtefact = nbArtefact + 1
playSound("secret")
else
hudPrint("Je ne veux pas de ce " .. myObject.go.name) -- On dit qu'on en veut pas
party.party:shakeCamera(0.05,2) -- on secoue
myObject.go:destroy() -- on degage l'objet
spawner_1.spawner:activate()
end
end
if (nbArtefact == 3) then
gotoFin()
end
end
function gotoFin()
--on joue un son et on fait bouger la camera et fondu au noir
playSound("force_field_cast")
party.party:shakeCamera(0.1,1.5)
myFacing = party.facing
destination = (party.facing+2)%4
if (destination ~= nil) then
party.party:knockback(destination)
end
GameMode.fadeOut(0, 2)
--on attend la fin de l'effet pour lancer la video
delayedCall("script_entity_2", 2, "piegeMovie")
end
function piegeMovie()
GameMode.playVideo("mod_assets/cinematics/piege.ivf")
--chest_2:destroy() --pour eviter le flickering
GameMode.fadeIn(0,0.5)
--On teleporte !
party:setPosition(16, 17, 0, 0, 14)
end
If it seems too tricky, I'll stick with the destroy method. We're clearly not in "simple question, simple answer" anymore.