? Chest On Open Map (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Chest On Open Map

1 2
  • #1 ✎ 109 Z_E_R_O Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself I'm working on a bigger project, I'm using the open world map editor. I now know how to set boarders like trees, But how would I add treasure chest using BG functions. Any help would be great. :) Posted
  • #2 ✎ 431 ToadIsTheBest Forum Contributor Hidden Achievements Night Person I like the quiet night and sleep late. Express Yourself Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength ok idk also what's the key for the open world map editor? okay here's a joke: Head Admin watches ova u Send messages in Staff chatroom Make announcement threads in the forums Make chat announcements across all rooms Ban users from chat up to 1 day Edit or delete comments Edit or delete forum posts Close or reopen polls Close or reopen threads Rename threads Move threads Sticky threads Edit submitted pages Promote pages to the front page Block users from chat up to 1 week Block users from website up to 1 week Delete threads Delete user submitted pages A bit of control over the chat server Set the alert banner at top of website Give out certain badges Retrieve special information from the server Block user's avatar Grant lower stars to other users Block users from website for any time Change usernames Supreme control over chat server Hide your powers Elevated power Can die Can permaban peeps Posted
  • #3 ✎ 109 Z_E_R_O Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    ok idk also what's the key for the open world map editor? okay here's a joke: Head Admin watches ova u Send messages in Staff chatroom Make announcement threads in the forums Make chat announcements across all rooms Ban users from chat up to 1 day Edit or delete comments Edit or delete forum posts Close or reopen polls Close or reopen threads Rename threads Move threads Sticky threads Edit submitted pages Promote pages to the front page Block users from chat up to 1 week Block users from website up to 1 week Delete threads Delete user submitted pages A bit of control over the chat server Set the alert banner at top of website Give out certain badges Retrieve special information from the server Block user's avatar Grant lower stars to other users Block users from website for any time Change usernames Supreme control over chat server Hide your powers Elevated power Can die Can permaban peeps
    Oh, Im just using the standard mp editor
    Posted
  • #4 ✎ 431 ToadIsTheBest Forum Contributor Hidden Achievements Night Person I like the quiet night and sleep late. Express Yourself Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength
    super snip galaxy AND TYPO FIX Im just using the standard map editor
    b-b-b-but you said
    super snip galaxy 2 I'm using the open world map editor. super snip 3D LAND
    Posted Edited by ToadIsTheBest
  • #5 ✎ 393 chicken OSP Contest 1 Contest Participant I participated in the first SmileBASIC Source OSP Contest! Second Year My account is over 2 years old Website Good Page Hidden Achievements
    I'm using the standard map editor.
    ...But you said:
    I'm using the open world map editor.
    It's the same thing in the end
    Posted Edited by chicken
  • #6 ✎ 109 Z_E_R_O Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself XD I don't even know what's going on at this point XD Posted
  • #7 ✎ 431 ToadIsTheBest Forum Contributor Hidden Achievements Night Person I like the quiet night and sleep late. Express Yourself Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength
    XD I don't even know what's going on at this point XD
    no-one does. i haz helped you by request of lumage
    Posted
  • #8 ✎ 265 spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength So what are you doing? Are you trying to put a treasure chest with effects in a map in sb and maybe animate it? Posted
  • #9 ✎ 109 Z_E_R_O Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    So what are you doing? Are you trying to put a treasure chest with effects in a map in sb and maybe animate it?[/quoteI Yes, I'm not sure how to though.I have trouble randomly generating items.
    Posted
  • #10 ✎ 61 ninjagnu
    So what are you doing? Are you trying to put a treasure chest with effects in a map in sb and maybe animate it?
    Yes, I'm not sure how to though.I have trouble randomly generating items.
    Can you please describe in depth how you are having trouble? It helps us help you when you do.
    Posted
  • #11 ✎ 109 Z_E_R_O Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    So what are you doing? Are you trying to put a treasure chest with effects in a map in sb and maybe animate it?
    Yes, I'm not sure how to though.I have trouble randomly generating items.
    Can you please describe in depth how you are having trouble? It helps us help you when you do.
    Yes I can :) Basically i'm using bgload for all layers, I'm setting the bg layer to move, and then i'm trying to place a BG Tile on the map I have it to where Layer 1 is the boundary. Now i am trying to add chest in random places on the map, but I want them to do the same thing, Open and give the player a random item.
    Posted
  • #12 ✎ 109 Z_E_R_O Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Its Bg Tile 864 Posted
  • #13 ✎ 265 spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Randomly generate the chests and go through your map checking each tile. If your character or whatever interacts with it, generate a random item id. You can randomly generate them by using nested loops and using the I and J incrementors of the loops as x and y coordinates. Based on a random number (if rnd==123 etc) you can then bgput tile on the coordinates each inner loop iteration. Higher conditional numbers make the spawn rarer. Posted Edited by spaceturtles
  • #14 ✎ 265 spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength
    Randomly generate the chests and go through your map checking each tile. If your character or whatever interacts with it, generate a random item id. You can randomly generate them by using nested loops and using the I and J incrementors of the loops as x and y coordinates. Based on a random number (if rnd==123 etc) you can then bgput tile on the coordinates each inner loop iteration. Higher conditional numbers make the spawn rarer.
    my SB doesn't have the new dlc that allows you to make nested DEFs and loops so i can't test this this is a joke
    Then what's the point wasting everyone's time? Anyways http://smilebasicsource.com/page?pid=958 can help with movement and maybe interaction @Z_E_R_O.
    Posted Edited by spaceturtles
  • #15 ✎ 109 Z_E_R_O Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    Randomly generate the chests and go through your map checking each tile. If your character or whatever interacts with it, generate a random item id. You can randomly generate them by using nested loops and using the I and J incrementors of the loops as x and y coordinates. Based on a random number (if rnd==123 etc) you can then bgput tile on the coordinates each inner loop iteration. Higher conditional numbers make the spawn rarer.
    my SB doesn't have the new dlc that allows you to make nested DEFs and loops so i can't test this this is a joke
    Then what's the point wasting everyone's time? Anyways http://smilebasicsource.com/page?pid=958 can help with movement and maybe interaction @Z_E_R_O.
    Thanks for all the help, sorry for all the questions :)
    Posted
  • #16 ✎ 265 spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength No problem ;) Posted
  • #17 ✎ 61 ninjagnu
    Randomly generate the chests and go through your map checking each tile. If your character or whatever interacts with it, generate a random item id. You can randomly generate them by using nested loops and using the I and J incrementors of the loops as x and y coordinates. Based on a random number (if rnd==123 etc) you can then bgput tile on the coordinates each inner loop iteration. Higher conditional numbers make the spawn rarer.
    An alternative more efficient way would be to keep a pseudo-2d array full of coordinates of the chests on the map. Then to loop through this list instead of the entire BG layer. Like this maybe:dim chests[0] def addchest x,y,contents ' adds chest with contents to array push chests,x push chests,y push chests,contents end Every frame you can loop through the chests array like this:for i=0 to len(chests)-1 step 3 'loops through chests array 'chests[i] = x 'chests[i+1] = y 'chests[i+2] = contents if collisionwithplayer(chests[i],chests[i+1]) then 'checks collision between player and chest animatechest chests[i], chests[i+1] 'animates chest opening giveplayeritem chests[i+2] 'gives player item endif next Much more efficient than looping through the entire BG tile layer of course.
    Posted
  • #18 ✎ 109 Z_E_R_O Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    Randomly generate the chests and go through your map checking each tile. If your character or whatever interacts with it, generate a random item id. You can randomly generate them by using nested loops and using the I and J incrementors of the loops as x and y coordinates. Based on a random number (if rnd==123 etc) you can then bgput tile on the coordinates each inner loop iteration. Higher conditional numbers make the spawn rarer.
    An alternative more efficient way would be to keep a pseudo-2d array full of coordinates of the chests on the map. Then to loop through this list instead of the entire BG layer. Like this maybe:dim chests[0] def addchest x,y,contents ' adds chest with contents to array push chests,x push chests,y push chests,contents end Every frame you can loop through the chests array like this:for i=0 to len(chests)-1 step 3 'loops through chests array 'chests[i] = x 'chests[i+1] = y 'chests[i+2] = contents if collisionwithplayer(chests[i],chests[i+1]) then 'checks collision between player and chest animatechest chests[i], chests[i+1] 'animates chest opening giveplayeritem chests[i+2] 'gives player item endif next Much more efficient than looping through the entire BG tile layer of course.
    Ffs, Thank you so much. it worked perfectly.
    Posted
  • #19 ✎ 61 ninjagnu
    -snip- Ffs, Thank you so much. it worked perfectly.
    ffs? sorry I don't use internet slang as often as I should.
    Posted Edited by ninjagnu
  • #20 ✎ 431 ToadIsTheBest Forum Contributor Hidden Achievements Night Person I like the quiet night and sleep late. Express Yourself Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength
    -snip- Ffs, Thank you so much. it worked perfectly.
    ffs? sorry I don't use internet slang as often as I should.
    i don't understand that internet slang either and i use internet slang often lol
    Posted
1 2