Lumina Posted September 9, 2015 Share Posted September 9, 2015 (edited) Hello, I want to make some news birds spawn in some season. But i don't find how to do it correctly. I got my prefab for the news birds (working fine), and i got a morebirdspawner.lua, for the spawn of the news birds. local BIRD_TYPES ={ --[GROUND.IMPASSABLE] = { "" }, --[GROUND.ROAD] = {"crow"}, [GROUND.ROCKY] = {"paradisebird", "huppebird"}, [GROUND.DIRT] = {"paradisebird", "goldbird", "huppebird"}, [GROUND.SAVANNA] = {"paradisebird", "huppebird"}, [GROUND.GRASS] = { "goldbird", "patchbird"}, [GROUND.FOREST] = {"paradisebird", "patchbird"}, [GROUND.MARSH] = {"paradisebird", "goldbird"},} Here i can define bird for each tile. local function PickBird(spawnpoint) local tile = _map:GetTileAtPoint(spawnpoint:Get()) local bird = GetRandomItem(BIRD_TYPES[tile] or { "paradisebird" }) return _worldstate.iswinter and bird == "goldbird" and "paradisebird" or birdend And, here, i suppose that it's the code where i could define which bird spawn in which season. But i can't find the right code to use.I could keep the "_worldstate.iswinter" to replace one specie by another, but it's not what i want. I want one type to spawn in spring, two in summer, one in autumn, and so on. But i obtain errors if i try to put "if" somewhere. So maybe someone could help me to find a way to make it ? Should i create somewhere a table to associate bird to season, like the one to associate bird and tile ? Could someone show me how to do this if it's the thing to do ? because it's exceed my skill. Thank for the help. morebirdspawner.lua Edited September 9, 2015 by Lumina Link to comment Share on other sites More sharing options...
ZupaleX Posted September 9, 2015 Share Posted September 9, 2015 Helloreturn _worldstate.iswinter and bird == "goldbird" and "paradisebird" or birdI do not understand your logic behind this line. What did you want to achieve exactly? Link to comment Share on other sites More sharing options...
Lumina Posted September 10, 2015 Author Share Posted September 10, 2015 It's just a try, based on the line of the original file.return _worldstate.iswinter and bird == "robin" and "robin_winter" or birdBetter than nothing but not what i want. Link to comment Share on other sites More sharing options...
ZupaleX Posted September 10, 2015 Share Posted September 10, 2015 So you wanted to spawn the goldbird, but change the goldbird into a paradisebird for winter? Link to comment Share on other sites More sharing options...
Lumina Posted September 10, 2015 Author Share Posted September 10, 2015 No, sorry if it's not clear. I use it because i can't find the proper way to do what i want. What i want is define for each bird one season (or more) for spawning. Like : Golden bird in summerParadise Bird in autumnHuppe bird in spring and autumnPatchbird in spring and summerFor example, maybe with some changes. (Or adding another bird to the list, latter) I can't find how to do this. I should probably use "_worldstate.iswinter", "_worldstate.issummer", etc, but where ? Link to comment Share on other sites More sharing options...
ZupaleX Posted September 10, 2015 Share Posted September 10, 2015 Oh ok I understand. I will take a look at it when I have time, if you did not figure out until then. Link to comment Share on other sites More sharing options...
Lumina Posted September 10, 2015 Author Share Posted September 10, 2015 Thanks, any help will be very welcome. Link to comment Share on other sites More sharing options...
ZupaleX Posted September 12, 2015 Share Posted September 12, 2015 Is it possible to get the complete mod files? Because just with this i cannot do much. Link to comment Share on other sites More sharing options...
Lumina Posted September 12, 2015 Author Share Posted September 12, 2015 SeasonsAndBirds.zip Here the bird part. I cleaned the rest, because it's still a work in progress and not related to this part.Thanks for the help Link to comment Share on other sites More sharing options...
ZupaleX Posted September 16, 2015 Share Posted September 16, 2015 (edited) SeasonsAndBirds.zip Here the bird part. I cleaned the rest, because it's still a work in progress and not related to this part.Thanks for the help Hello, I am sorry I did not come back to you earlier, I was caught up in some other stuffs!I found your issue. Could you tell me a bit what you want to do with your birds (under which conditions which birds should appear) so i can make some for you as an example and comment the piece of code so you can later expand it yourself? Edited September 16, 2015 by ZupaleX Link to comment Share on other sites More sharing options...
Lumina Posted September 16, 2015 Author Share Posted September 16, 2015 No need to be sorry, i understand Could you do something like : Golden bird in summerParadise Bird in autumnHuppe bird in spring and autumnPatchbird when it rain ?It would be a good example of how it work I don't know if a "rain" condition is possible in this case (i know it exist, not if it will work here). If it's too problematic, a season condition would be fine Thanks again. I appreciate your help Link to comment Share on other sites More sharing options...
ZupaleX Posted September 16, 2015 Share Posted September 16, 2015 Rain is as easy condition as summer or whatever.I will write this down, comment the code and leave the lines you should look at in my next post. Link to comment Share on other sites More sharing options...
ZupaleX Posted September 16, 2015 Share Posted September 16, 2015 http://prntscr.com/8h0uf0http://prntscr.com/8h0uig You have an issue with your landing animation though. The birds just appear on the ground. They take off properly though Link to comment Share on other sites More sharing options...
ZupaleX Posted September 16, 2015 Share Posted September 16, 2015 No need to be sorry, i understand Could you do something like : Golden bird in summerParadise Bird in autumnHuppe bird in spring and autumnPatchbird when it rain ?It would be a good example of how it work I don't know if a "rain" condition is possible in this case (i know it exist, not if it will work here). If it's too problematic, a season condition would be fine Thanks again. I appreciate your help morebirds.lua line 195 morebirdspawner.lua lines 15-73lines 148-174 Have fun. If you have more question or something is not clear, please tell meSeasonsAndBirds.zip Link to comment Share on other sites More sharing options...
Lumina Posted September 16, 2015 Author Share Posted September 16, 2015 I'm sorry, i can't see anything new or different. I am missing something ? Link to comment Share on other sites More sharing options...
ZupaleX Posted September 16, 2015 Share Posted September 16, 2015 You do not see all the comments i put at the lines i indicated? Link to comment Share on other sites More sharing options...
Lumina Posted September 16, 2015 Author Share Posted September 16, 2015 Sorry probably made a mistake. I don't know why it wasn't good but it's fine now. I take a look, thank you Link to comment Share on other sites More sharing options...
Lumina Posted September 16, 2015 Author Share Posted September 16, 2015 It look perfect I will try it right now ! It's wonderfull, thank you so much. You make a really great job, i appreciate it a lot Link to comment Share on other sites More sharing options...
ZupaleX Posted September 16, 2015 Share Posted September 16, 2015 No issue. Again if you need more stuffs, just tell me. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now