Anyone interested in a script to give units random stats when they’re created? From: Allan Thompson Sent: Friday, August 23, 2013 6:41 PM To: ian-reeds-games@xxxxxxxxxxxxx Subject: [ian-reeds-games] Re: Plans for the coming school year! My thoughts exactly! I was also thinking of the zombie house map. I think Carlos should use it first though. al From: ian-reeds-games-bounce@xxxxxxxxxxxxx [mailto:ian-reeds-games-bounce@xxxxxxxxxxxxx] On Behalf Of abigail prescott Sent: Friday, August 23, 2013 1:27 PM To: ian-reeds-games@xxxxxxxxxxxxx Subject: [ian-reeds-games] Re: Plans for the coming school year! Thanks, I just hope I haven’t left anything out, but it worked fine when I tested. It should also work for other maps with randomly placed units. So you could have a dungeon where you can’t predict where the monsters are even after playing once already. Abi From: Allan Thompson Sent: Friday, August 23, 2013 5:54 PM To: ian-reeds-games@xxxxxxxxxxxxx Subject: [ian-reeds-games] Re: Plans for the coming school year! Wow,that is amazing! I can’t wait to see Carlos make that capture the flag map using this! al From: ian-reeds-games-bounce@xxxxxxxxxxxxx [mailto:ian-reeds-games-bounce@xxxxxxxxxxxxx] On Behalf Of abigail prescott Sent: Friday, August 23, 2013 8:51 AM To: ian-reeds-games@xxxxxxxxxxxxx Subject: [ian-reeds-games] Re: Plans for the coming school year! Here’s the link to a randomising function I wrote. All you have to do is make a new folder in the scripts folder and put this file in. Then you can use the randomise_unit_positions function in whatever event you want. The things you can set in the event are: starttilex and starttiley: for when you want to set the area starting from a certain tile. As tiles actually start at 0:0, not 1:1, you should subtract 1 from both numbers. startunit: For when you want to set the area around a certain unit, like the flag. Just write the name of the unit file in quotes. minunit and maxunit: the minimum number of units you want to spawn in this area and the maximum. A random number will be chosen ranging between these numbers. unit: the unit that you want to be generated in the area. Like the startunit value, just write the name of the unit file in quotes. rangex and rangey: the number of tiles you want the area to extend to, starting at the starting tile or startunit. I think that’s all of them. Don’t set the starttile values in the same event, the script just finds the first unit of the specified type if you set a startunit. I don’t know if this will cause problems, but I’m guessing you would only want the units to spawn around one unit and you would only have one flag. If you don’t set any starttile values or a startunit, then the unit will be randomly placed around the whole map. If anyone wants to use it to randomly place units around all the units of a specific type (e.g around every city on the map) instead of just the first one, then just find the break; line in the function and delete it. I think that’ll do it. https://dl.dropboxusercontent.com/u/94819755/randomise_unit_positions.txt From: abigail prescott Sent: Thursday, August 22, 2013 11:25 PM To: ian-reeds-games@xxxxxxxxxxxxx Subject: [ian-reeds-games] Re: Plans for the coming school year! Yes, but they don’t need to be specified by the player. They could be set through the event or the script. Event might be better, because then other people who might want randomised maps can use it too. Technically, if a player did want to change the boundaries and they were set in the event, they could just edit the file with the event, but it’s still not the same as offering them the opportunity to restrict the enemy to a certain area where it’ll be easier to predict where they’ll be. Maybe it could work out a certain fraction of the map, that way the area would expand to fit the size of the map, and players would have to know how to script to change it. My idea was that you would set the starting point at the flag (because it makes sense for the units to spawn around the thing they’re protecting) and then four random numbers would be generated with set boundaries of highest and lowest possible numbers. These numbers would be the range of the area to the right, the range to the left, the range upwards and the range downwards. The problem is getting units to spawn, though I think if there was only a few types, you could set that in the event. Sorry if that doesn’t make much sense, but I’m writing things as I think of them and I really should get some sleep. Tomorrow I’ll think about it more and it’ll make more sense then. Abi From: Carlos Macintosh Sent: Thursday, August 22, 2013 11:06 PM To: ian-reeds-games@xxxxxxxxxxxxx Subject: [ian-reeds-games] Re: Plans for the coming school year! I need to define boundaries though. I couldn’t just hav the units all over the place.