Darkness/Lantern effect and Bounce-Pads
Moderators: marionline, SDHawk
- Froginator
- Slime Knight
- Posts: 188
- Joined: Thu Apr 24, 2014 10:13 pm
- Location: Germany
- Contact:
Darkness/Lantern effect and Bounce-Pads
Hello there. As I'm working on the next cave for my game "Quodia" I thought it would be kinda cool to have it be all dark with just a circle of light around the characters and some glowing mushrooms to be "layered" over it so it looks like they glow just enough to be light themselves.
I have a vague idea on how to to it with slices but I'd like to have a solid script for it.. If it even works that is.
My second idea is to build little bounce pads in the form of mushrooms in the cave. it would work kinda like this i guess:
https://www.youtube.com/watch?v=aucqv6Bxk3k
Just without the switches, meaning that it's only the arrows.
I thought about making a cutscene-type sript with suspend player and stuff..
I have a vague idea on how to to it with slices but I'd like to have a solid script for it.. If it even works that is.
My second idea is to build little bounce pads in the form of mushrooms in the cave. it would work kinda like this i guess:
https://www.youtube.com/watch?v=aucqv6Bxk3k
Just without the switches, meaning that it's only the arrows.
I thought about making a cutscene-type sript with suspend player and stuff..
The lighting I'm not entirely sure about. How exactly do you want the mushrooms to show?
The bounce pads should be easy, though. You can use the "set hero z()" function to make the player look like they're moving up and dow . [s]Give me a minute, I'll find the wiki page on it.[/s]
http://rpg.hamsterrepublic.com/ohrrpgce ... jumping%3F
The animation you'll need to do with set hero frame and direction functions.
The bounce pads should be easy, though. You can use the "set hero z()" function to make the player look like they're moving up and dow . [s]Give me a minute, I'll find the wiki page on it.[/s]
http://rpg.hamsterrepublic.com/ohrrpgce ... jumping%3F
The animation you'll need to do with set hero frame and direction functions.
Last edited by kylekrack on Mon Jun 06, 2016 9:11 pm, edited 3 times in total.
My pronouns are they/them
Ps. I love my wife
Ps. I love my wife
- Taco Bot
- Meat, Cheese, and Silicon
- Posts: 484
- Joined: Fri Jul 18, 2014 12:15 am
- Location: Santa Cruz
- Contact:
Also, this might be somewhat helpful: http://rpg.hamsterrepublic.com/ohrrpgce ... he_hero%3F
Last edited by Taco Bot on Mon Jun 06, 2016 10:16 pm, edited 1 time in total.
Sent from my iPhone
Having the mushrooms appear above the darkness is very difficult because:
-you want darkness to be above all normal map layers, and above NPCs
-you want the mushrooms to be above the darkness
-you want the NPCs and heroes to be above the mushrooms (and heroes and NPCs are attached to the same walkabout layer or a sublayer of it)
-you probably want the heroes to appear beneath overhead map layers
I don't see any way to achieve all of these contradictory requirements without some pretty complicated use of slices if you use the "circle of light" slice approach. However it could be doable with a Baconthulhu-style fog of war approach where the map is revealed permanently as you walk around.
Plus if you parent the darkness slices to a map layer then you need to compensate for the movement of the camera, which means having to use the next camera pixel x/y scripts.
-you want darkness to be above all normal map layers, and above NPCs
-you want the mushrooms to be above the darkness
-you want the NPCs and heroes to be above the mushrooms (and heroes and NPCs are attached to the same walkabout layer or a sublayer of it)
-you probably want the heroes to appear beneath overhead map layers
I don't see any way to achieve all of these contradictory requirements without some pretty complicated use of slices if you use the "circle of light" slice approach. However it could be doable with a Baconthulhu-style fog of war approach where the map is revealed permanently as you walk around.
Plus if you parent the darkness slices to a map layer then you need to compensate for the movement of the camera, which means having to use the next camera pixel x/y scripts.
Last edited by TMC on Tue Jun 07, 2016 4:03 am, edited 1 time in total.
Yes, if heroes and NPCs can't walk in front of them then that's pretty simple! I guess actually even in the case that you can, you can use two map layers and a script to draw or erase mushrooms on the topmost above-darkness layer as you get close.
Last edited by TMC on Tue Jun 07, 2016 7:14 am, edited 1 time in total.
- Froginator
- Slime Knight
- Posts: 188
- Joined: Thu Apr 24, 2014 10:13 pm
- Location: Germany
- Contact:
Okay so I made the Light circle thing and it works perfectly.
I set the map on "Wrap" so I could use this script:
The only thing I'd need for this one now is that I want to remove the darkness after I get outta the cave, since it stays.
I put the script as the "autorun" script of the cave map.
I thought about just having an NPC at the cave entrance (a different map) which I put on "step on" and make him activate a script to reset the darkness. Maybe there's a better way, but I mainly need a way to reset the darkness. Thanks in advance
I set the map on "Wrap" so I could use this script:
Code: Select all
global variable (1, flashlight circle)
plotscript, setup flashlight, begin
flashlight circle := load backdrop sprite (5)
end
I put the script as the "autorun" script of the cave map.
I thought about just having an NPC at the cave entrance (a different map) which I put on "step on" and make him activate a script to reset the darkness. Maybe there's a better way, but I mainly need a way to reset the darkness. Thanks in advance
- Bob the Hamster
- Lord of the Slimes
- Posts: 7660
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
The darkness script starts from the map autorun, right?
At the beginning of the script, add a line like this:
At the beginning of the script, add a line like this:
Code: Select all
if(check tag(tag:disable darkness)) then(exit script)
- Froginator
- Slime Knight
- Posts: 188
- Joined: Thu Apr 24, 2014 10:13 pm
- Location: Germany
- Contact:
Also tried the mushroom jumping stuff now.
I used this script:
But after I used it once it won't work again, unless I leave the map and re-enter it..
I used this script:
Code: Select all
variable (i, jump)
suspend player
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
- Froginator
- Slime Knight
- Posts: 188
- Joined: Thu Apr 24, 2014 10:13 pm
- Location: Germany
- Contact:
- Bob the Hamster
- Lord of the Slimes
- Posts: 7660
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
Well, that tag does need to be turned on somewhere, yes.Froginator wrote:@Bob the Hamster I guess you mean that I should make a NPC activate the tag?
Because for some reason that doesn't work..
I re-read your original question, and yeah, you are on the right track. a step-on NPC would be a good way to set the tag.
- Froginator
- Slime Knight
- Posts: 188
- Joined: Thu Apr 24, 2014 10:13 pm
- Location: Germany
- Contact:
- Bob the Hamster
- Lord of the Slimes
- Posts: 7660
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
Maybe I misunderstand what you mean when you say "reset the darkness"
I assumed you meant that after you have completed the map, you don't want toe darkness to show up the next time you come back to the map. Is that what you are trying to do?
As for the jumpy mushroom problem, can you post the script?
I assumed you meant that after you have completed the map, you don't want toe darkness to show up the next time you come back to the map. Is that what you are trying to do?
As for the jumpy mushroom problem, can you post the script?