ok
idk
also what's the key for the open world map editor?
okay here's a joke:
Head Admin
Chest On Open Map
Root / Programming Questions / [.]
Z_E_R_OCreated:
ok idk also what's the key for the open world map editor? okay here's a joke: Head AdminOh, Im just using the standard mp editorpowers
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
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 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.Can you please describe in depth how you are having trouble? It helps us help you when you do.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.
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.
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.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 thisthis is a joke
Thanks for all the help, sorry for all the questions :)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.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 thisthis is a joke
No problem ;)
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 endEvery 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 nextMuch more efficient than looping through the entire BG tile layer of course.
Ffs, Thank you so much. it worked perfectly.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 endEvery 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 nextMuch more efficient than looping through the entire BG tile layer of course.