Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animated Object don't show up #14653

Closed
Yandurva08 opened this issue May 12, 2024 · 1 comment
Closed

Animated Object don't show up #14653

Yandurva08 opened this issue May 12, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@Yandurva08
Copy link

Describe your problem here.

Hello, so, I've been thinking. "I can make a winning icon in lua", and I'm trying to make it but for some reason the addLuaSprite isn't working

Here code (bf code):

function onCreate()
   makeAnimatedLuaSprite('newIconP1', 'Icons New/newicon-' .. getProperty('boyfriend.curCharacter'), 0, 0)
   setProperty('iconP1.alpha', 0)
       setObjectCamera('newIconP1', 'hud')
   setProperty('newIconP1', getProperty('iconP1.x'))
   setProperty('newIconP1.y', getProperty('iconP1.y'))
   setProperty('newIconP1.flipX', true)
   addAnimationByPrefix('newIconP1', 'nor', 'normal', 1, true)
   addAnimationByPrefix('newIconP1', 'loss', 'loss', 1, true)
   addAnimationByPrefix('newIconP1', 'win', 'win', 1, true)
   addLuaSprite('newIconP1', true)
end

function onUpdate()
   debugPrint('ip1 x & y: ' .. getProperty('newIconP1.x') .. ' & ' .. getProperty('newIconP1.y'))
   debugPrint('ip2 x & y: ' .. getProperty('newIconP2.x') .. ' & ' .. getProperty('newIconP2.y'))
   doTweenX('moveIP1X', 'newIconP1', getProperty('iconP1.x'), 0.5, 'sineOut')
   doTweenY('moveIP1Y', 'newIconP1', getProperty('iconP1.y'), 0.5, 'sineOut')
   health = getProperty('health')
   if health >= 1.6 then
   	objectPlayAnimation('newIconP1', 'win', true)
   elseif health <= 1.5 and health >= 0.7 then
   	objectPlayAnimation('newIconP1', 'nor', true)
   elseif health <= 0.6 then
   	objectPlayAnimation('newIconP1', 'loss', true)
   end
end

Here code (dad/opponent code):

function onCreate()
	makeAnimatedLuaSprite('newIconP2', 'Icons New/newicon-' .. getProperty('dad.curCharacter'), 0, 0)
	setProperty('iconP2.alpha', 0)
        setObjectCamera('newIconP2', 'hud')
	setProperty('newIconP2', getProperty('iconP2.x'))
	setProperty('newIconP2.y', getProperty('iconP2.y'))
	addAnimationByPrefix('newIconP2', 'nor', 'normal', 1, true)
	addAnimationByPrefix('newIconP2', 'loss', 'loss', 1, true)
	addAnimationByPrefix('newIconP2', 'win', 'win', 1, true)
	addLuaSprite('newIconP2', true)
end

function onUpdate()
	doTweenX('moveIP2X', 'newIconP2', getProperty('iconP2.x'), 0.5, 'sineOut')
	doTweenY('moveIP2Y', 'newIconP2', getProperty('iconP2.y'), 0.5, 'sineOut')
	health = getProperty('health')
	if health >= 1.6 then
		objectPlayAnimation('newIconP2', 'loss', true)
	elseif health <= 1.5 and health >= 0.7 then
		objectPlayAnimation('newIconP2', 'nor', true)
	elseif health <= 0.6 then
		objectPlayAnimation('newIconP2', 'win', true)
	end
end

If you know the problem, it would help a lot

Are you modding a build from source or with Lua?

Lua

What is your build target?

Linux

Did you edit anything in this build? If so, mention or summarize your changes.

Nop

@Yandurva08 Yandurva08 added the help wanted Extra attention is needed label May 12, 2024
@Yandurva08 Yandurva08 reopened this May 14, 2024
@Yandurva08
Copy link
Author

No one is going to help anyway

@Yandurva08 Yandurva08 closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant