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

What's the difference between onCreate & onCreatePost? #770

Open
SMWpalkia opened this issue Nov 26, 2024 · 3 comments
Open

What's the difference between onCreate & onCreatePost? #770

SMWpalkia opened this issue Nov 26, 2024 · 3 comments
Labels
question Further information is requested

Comments

@SMWpalkia
Copy link

SMWpalkia commented Nov 26, 2024

What is your question?

in one of my stage luas, i noticed it wasn't displaying chromatic abberation despite me not changing anything for a few months. i changed onCreate to onCreatePost and it worked, even though i originally changed it from Post to normal because it disabled my Flash event. now in another song, changing from Post to normal is doing this and I don't understand why. I haven't had any issues with this for months

2024-11-26.17-36-55.mp4

The main reason I had to change it in this stage is because the pink character wasn't working on a multiple character script despite everyone else working fine and even himself working in other stages. I just don't get why he doesn't here

@SMWpalkia SMWpalkia added the question Further information is requested label Nov 26, 2024
@JordanSantiagoYT
Copy link
Owner

onCreate is called right after the characters are created, while onCreatePost is called after just about everything is created

@SMWpalkia
Copy link
Author

SMWpalkia commented Nov 26, 2024

so why does onCreate not add chromatic abberation but makes morpheus (the pink dude) move?
function onCreate()

makeLuaSprite('plat2', 'nesis/plat', 200, 600);
setScrollFactor('plat2', 1, 1);
scaleObject('plat2', 1, 1)

makeLuaSprite('nem1', 'nesis/1', -2100, -900);
setScrollFactor('nem1', 0.6, 0.6);
addGlitchEffect('nem1', 1,10,0.3);
scaleObject('nem1', 2, 2)

makeLuaSprite('nem6', 'nesis/6', -2000, -900);
setScrollFactor('nem6', 0.6, 0.6);
scaleObject('nem6', 1, 1)

makeLuaSprite('nem2', 'nesis/2', -2000, -900);
setScrollFactor('nem2', 0.7, 0.7);
scaleObject('nem2', 2, 2)

makeLuaSprite('nem3', 'nesis/3', -2000, -900);
setScrollFactor('nem3', 0.8, 0.8);
scaleObject('nem3', 2, 2)

makeLuaSprite('nem4', 'nesis/4', -2000, -1400);
setScrollFactor('nem4', 0.9, 0.9);
scaleObject('nem4', 2, 2)

makeLuaSprite('nem5', 'nesis/5', -2000, -900);
setScrollFactor('nem5', 0.8, 0.8);
scaleObject('nem5', 2, 2)

makeLuaSprite('plat1', 'nesis/plat', -1200, 300);
setScrollFactor('plat1', 1, 1);
scaleObject('plat1', 2, 2)

addLuaSprite('plat2', false)
addLuaSprite('nem1', false)
addLuaSprite('nem6', false)
addLuaSprite('nem2', false)
addLuaSprite('nem3', false)
addLuaSprite('nem4', false)
addLuaSprite('nem5', false)
addLuaSprite('plat1', false)

addChromaticAbberationEffect('camhud', 0.005)	
addChromaticAbberationEffect('camgame', 0.005)	

close(true)

end

function onUpdate(elapsed)
songPos = getSongPosition()
currentBeat = (songPos / 1000) * (bpm / 140)
if curBeat >= 608 then
doTweenY(dadTweenY, 'dad', 0-100math.sin((currentBeat0.4)math.pi),0.01)
setObjectOrder('plat1',0)
setObjectOrder('plat2',12)
if curBeat >= 1376 then
doTweenY(dadTweenY, 'dad', -200-100
math.sin((currentBeat0.4)math.pi),0.01)
if curBeat >= 2080 then
doTweenY(dadTweenY, 'dad', -1000-100
math.sin((currentBeat
0.2)math.pi),0.01)
if curBeat >= 2784 then
doTweenY(dadTweenY, 'dad', -200-100
math.sin((currentBeat*0.2)*math.pi),0.01)
if curBeat >= 3040 then
setObjectOrder('plat1',13)
setObjectOrder('plat2',0)
end
end
end
end
end
end

@SMWpalkia
Copy link
Author

ok so i justed removed the close(true) and it ended up fixing everything. but i still find it weird how all of this happened even though i havent touched anythign in months

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants