Help adding cam direction for multi-notes #992
Replies: 3 comments
-
|
you could just refer to I edited the ek script to print the direction of a note whenever it is hit, which actually printed all the extra notes! So for the script you could just add "or" statements to make it apply on the extra note data (i.e. the UP direction (2) counts the other UP arrows (4 and 7 if on 9K)) |
Beta Was this translation helpful? Give feedback.
-
|
i was thinking using the for i loop to count every individual note direction, this would allow it to use 4 directions without any /2 patterns or using animations since some mods have it use the custom boyfriend animations for left 2, down 2, up 2, right 2, up 3 (9 keys) ect. so you edited the script so it now broadcasts the directions? because using if else 4 directions used to apply to only the 1st 4 notes should i try _G['dadGhostData.noteDirection'] = getPropertyFromGroup('notes', id, 'noteDirection') or something so the function could be (function name)(direction)? i don't think this would work since it's not defined as a variable compared to stumtime that works because it's part of the psych engine api |
Beta Was this translation helpful? Give feedback.
-
|
i edited the script to debugPrint the notedata to test if it would only wrap around 4 like you said, but it printed the actual data also, the thing for referring to direction outside goodNoteHit is noteData, which is the lane that the note is on |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
instead of using the classic measures that those other lua scripts used, i changed it so it would support 3 scripts in 1: note tween, ghost, and shaders which all work perfectly using for i = and get/setproperty only methods:
-- function onEvent(name, value1, value2) -- When ever event in song json is activated...
-- if name == 'Update Notes' then
-- updateNotePositions()
-- end
-- end
function pneumonoultramicroscopicsilicovolcanoconiosis_updateNotePositions()
noteX = {}
noteY = {}
local noteCount = getProperty('strumLineNotes.length')
for i = 0, noteCount - 1 do
local noteXVal = getPropertyFromGroup('strumLineNotes', i, 'x')
local noteYVal = getPropertyFromGroup('strumLineNotes', i, 'y')
noteX[i] = noteXVal
noteY[i] = noteYVal
end
end
function pneumonoultramicroscopicsilicovolcanoconiosis_noteTween()
local noteCount = #noteX
for i = 0, noteCount - 1 do
if noteX[i] ~= nil and noteY[i] ~= nil then
local newX = math.random(noteX[i] - 10, noteX[i] + 10)
local newY = math.random(noteY[i] - 10, noteY[i] + 10)
noteTweenX('glitchNoteX' .. i, i, newX, 0.01, 'backInOut')
noteTweenY('glitchNoteY' .. i, i, newY, 0.01, 'backInOut')
end
end
end
function pneumonoultramicroscopicsilicovolcanoconiosis_ghostCreations(char)
local songPos = getSongPosition()
local ghostName = char..'Ghost'..songPos
makeAnimatedLuaSprite(ghostName, getProperty(char..'.imageFile'), getProperty(char..'.x'), getProperty(char..'.y'))
addLuaSprite(ghostName, false)
setProperty(ghostName..'.scale.x', getProperty(char..'.scale.x'))
setProperty(ghostName..'.scale.y', getProperty(char..'.scale.y'))
setProperty(ghostName..'.flipX', getProperty(char..'.flipX'))
local colorArray = getProperty(char..'.healthColorArray')
local hexColor = string.format('%.2x%.2x%.2x', colorArray[1], colorArray[2], colorArray[3])
setProperty(ghostName..'.color', getColorFromHex(hexColor))
setProperty(ghostName..'.alpha', 1)
setProperty(ghostName..'.animation.frameName', _G[char..'GhostData.frameName'])
setProperty(ghostName..'.offset.x', _G[char..'GhostData.offsetX'])
setProperty(ghostName..'.offset.y', _G[char..'GhostData.offsetY'])
setObjectOrder(ghostName, getObjectOrder(char..'Group')-1)
doTweenAlpha(ghostName..'delete', ghostName, 0, 0.5, 'linear', function()
if objectExists(ghostName) then
removeLuaSprite(ghostName, true)
end
end)
end
function pneumonoultramicroscopicsilicovolcanoconiosis_ghostData(char)
_G[char..'GhostData.frameName'] = getProperty(char..'.animation.frameName')
_G[char..'GhostData.offsetX'] = getProperty(char..'.offset.x')
_G[char..'GhostData.offsetY'] = getProperty(char..'.offset.y')
end
function onCreate()
clearEffects('camHud', true)
clearEffects('camGame', true)
clearEffects('camOther', true)
addVCREffect('camHud', false)
addVCREffect('camGame', false)
addVCREffect('camOther', true)
addBlockedGlitchEffect('camHud', true)
addBlockedGlitchEffect('camGame', true)
addBlockedGlitchEffect('camOther', true)
end
function onCreatePost()
clearEffects('camHud', true)
clearEffects('camGame', true)
clearEffects('camOther', true)
addVCREffect('camHud', false)
addVCREffect('camGame', false)
addVCREffect('camOther', true)
addBlockedGlitchEffect('camHud', true)
addBlockedGlitchEffect('camGame', true)
addBlockedGlitchEffect('camOther', true)
end
function onSongStart()
pneumonoultramicroscopicsilicovolcanoconiosis_updateNotePositions()
clearEffects('camHud', true)
clearEffects('camGame', true)
clearEffects('camOther', true)
addVCREffect('camHud', false)
addVCREffect('camGame', false)
addVCREffect('camOther', true)
addBlockedGlitchEffect('camHud', true)
addBlockedGlitchEffect('camGame', true)
addBlockedGlitchEffect('camOther', true)
end
function opponentNoteHit(id, direction, noteType, isSustainNote)
clearEffects('camHud', true)
clearEffects('camGame', true)
clearEffects('camOther', true)
if _G['dadGhostData.strumTime'] == getPropertyFromGroup('notes', id, 'strumTime') and not isSustainNote then
clearEffects('camHud', true)
clearEffects('camGame', true)
clearEffects('camOther', true)
cameraShake('camHud',0.01,0.2)
cameraShake('camOther',0.01,0.2)
pneumonoultramicroscopicsilicovolcanoconiosis_noteTween()
pneumonoultramicroscopicsilicovolcanoconiosis_ghostCreations('dad')
end
if not isSustainNote then
clearEffects('camHud', true)
clearEffects('camGame', true)
clearEffects('camOther', true)
_G['dadGhostData.strumTime'] = getPropertyFromGroup('notes', id, 'strumTime')
pneumonoultramicroscopicsilicovolcanoconiosis_ghostData('dad')
end
clearEffects('camHud', true)
clearEffects('camGame', true)
clearEffects('camOther', true)
addVCREffect('camHud', false)
addVCREffect('camGame', false)
addVCREffect('camOther', true)
addBlockedGlitchEffect('camHud', true)
addBlockedGlitchEffect('camGame', true)
addBlockedGlitchEffect('camOther', true)
end
function goodNoteHit(id, direction, noteType, isSustainNote)
if _G['boyfriendGhostData.strumTime'] == getPropertyFromGroup('notes', id, 'strumTime') and not isSustainNote then
pneumonoultramicroscopicsilicovolcanoconiosis_ghostCreations('boyfriend')
end
if _G['gfGhostData.strumTime'] == getPropertyFromGroup('notes', id, 'strumTime') and not isSustainNote then
pneumonoultramicroscopicsilicovolcanoconiosis_ghostCreations('gf')
end
if not isSustainNote then
_G['boyfriendGhostData.strumTime'] = getPropertyFromGroup('notes', id, 'strumTime')
pneumonoultramicroscopicsilicovolcanoconiosis_ghostData('boyfriend')
_G['gfGhostData.strumTime'] = getPropertyFromGroup('notes', id, 'strumTime')
pneumonoultramicroscopicsilicovolcanoconiosis_ghostData('gf')
end
end
i feel like it adds a good vibe to me when i see chaos like this, there's one more thing i want to add and that's the cam direction, however, since there're only 4 directions (0-3), it doesn't work for more than 5 keys, is there anyway to get note direction data by using property that would work for more than 4 notes, i'm prob gonna use a for i = for the cam direction function to count every individual note direction, i just need a method of getting the note direction by using a property method
if direction==0 then
cancelTween('revert')
setProperty('camHUD.angle', 0)
setProperty('camHUD.y', 0)
setProperty('camHUD.angle', -5)
doTweenAngle('revert', 'camHUD', 0, 0.3, 'CircOut')
Beta Was this translation helpful? Give feedback.
All reactions