Yeah.. what I'm trying to do is that the cave can be entered and exited at any time. The darkness inside should stay, but the problem is when you exit the cave, every map now has the black overlay.
plotscript, shroomJumpRight, begin
suspend player
play sound (2)
wait for sound (2)
stop sound (2)
variable (i, jump)
set hero direction (me, right)
jump := -5
for (i, 0, 10) do (
put hero (me, hero pixel X (me) + 4, hero pixel Y (me) + jump)
jump += 1
wait
)
resume player
end
I think the problem with activating NPCs is that the hero becomes misaligned, because the hero moves 44 pixels in the x direction. Here's one modification that should work better:
Froginator wrote:Yeah.. what I'm trying to do is that the cave can be entered and exited at any time. The darkness inside should stay, but the problem is when you exit the cave, every map now has the black overlay.
Thanks for the help! The Mushroom script works perfectly now.
But there's one thing with the Darkness script. It's probably my fault though.
I think I'm putting things at the wrong places because here's what I did:
global variable (1, flashlight circle)
plotscript, setup flashlight, begin
flashlight circle := load backdrop sprite (5)
if(current map <> #Waterfall Cave#) then(
exit script
)
end
I also tried putting it in front of the "flashlight circle := load backdrop sprite (5)" and also tried using free sprite but I'm probably doing it all wrong. So I'd rather have someone help me instead of more trial and error. What could also be a problem is that the map name IS #Waterfall Cave# and HSS reads it as a comment written with a # in front of it..
So now that I got both mushrooms for left and right done, I'm trying to make two for up and down.
I think I got some of the values wrong because what happens is that the chracters fly in some kind of black void when I use the shroom..?
plotscript, shroomJumpDown, begin
suspend player
play sound (2)
wait for sound (2)
variable (i, jump, starty)
jump := -5
starty := hero pixel Y (me)
for (i, 1, 11) do (
put hero (me, starty + -60 * i / 11, hero pixel X (me) + jump)
jump += 1
wait
)
resume player
end
What I did is basically just change every X to a Y because it worked in a script where I used X and Y as well before but this doesn't seem to be the correct solution..
Oh, yeah, it's definitely best to use Z. Note the Z position increases upwards, while Y [s]decreases[/s] (edit: increases) towards the bottom of the screen.
# Makes the hero jump in an arc and move so many pixels in the X and Y directions
script, shroomJump, x total, y total, begin
suspend player
play sound (2)
wait for sound (2)
variable (i, jump, startx, starty)
jump := 5
startx := hero pixel X (me)
starty := hero pixel Y (me)
for (i, 1, 11) do (
put hero (me, startx + x total * i / 11, starty + y total * i / 11)
set hero Z(me, hero Z(me) + jump)
jump -= 1
wait
)
resume player
end
plotscript, shroomJumpDown, begin
shroomJump(0, 60)
end
plotscript, shroomJumpUp, begin
shroomJump(0, -60)
end
plotscript, shroomJumpLeft, begin
shroomJump(-60, 0)
end
plotscript, shroomJumpRight, begin
shroomJump(60, 0)
end
Last edited by TMC on Thu Jun 09, 2016 11:11 pm, edited 1 time in total.