[ian-reeds-games] Re: Plans for the coming school year!

  • From: Ian Reed <support@xxxxxxxxxxxxxxxxxxx>
  • To: ian-reeds-games@xxxxxxxxxxxxx
  • Date: Fri, 23 Aug 2013 16:06:40 -0600

Hi Abigail,

It's a great idea to try and make your scripts so they can be used by multiple map packs with just some changes to the event args. Sometimes it seems more difficult to do it this way than to just make the script for the specific map pack you're working with, but it definitely makes the script more reusable, and more usable for people who have a hard time with scripting since they only need to worry about changing the event arguments and not altering the script itself. Craig did a great job with this and I'm really glad to see you're moving in that direction as well.

Ian Reed


On 8/23/2013 3:28 PM, abigail prescott wrote:
I think both scripts are done. I couldn’t test the catapult naming because I seem to be missing the advanced catapult unit file... Wonder why?
Instructions for the randomise_stats function:
copy the file into a folder in the scripts folder.
Open the file for the unit you want to add this function to and add this at the bottom: after_create=randomise_stats@ { min: number, max: number, current: optional number } Min is the minimum that the stat can be set to, max is the maximum and current is an optional setting if you want the unit to start with different current and max values for a stat.
https://dl.dropboxusercontent.com/u/94819755/randomise%20stats.txt
Al, here’s the naming function with the units you mentioned and their ork equivalents. I put catapults in too, but like I said, I couldn’t test that one. Now you can just put the file into the folder in the scripts folder and all you have to edit is the recruit files. I think the event is the same as it was before, but if it doesn’t work then I’ll paste the event code for you.
https://dl.dropboxusercontent.com/u/94819755/add_unit.txt
I’m going to try updating the add_unit function so it can work for other games other than warlords. I’m annoyed I didn’t think of it earlier, as it might have simplified things, but I suppose I just got it stuck in my head that this was for warlords so started making it specificly for that. If I can get it to work for other maps, there won’t have to be any script editing, just another parameter for the event.
Abi
*From:* abigail prescott <mailto:abigail.prescott@xxxxxxxxxxx>
*Sent:* Friday, August 23, 2013 9:01 PM
*To:* ian-reeds-games@xxxxxxxxxxxxx <mailto:ian-reeds-games@xxxxxxxxxxxxx>
*Subject:* [ian-reeds-games] Re: Plans for the coming school year!
Well, I wrote it because I wanted random character stats, but you could use it for any unit or structure. At least, I think the after_create event can be set on structures. Hopefully I’ll be able to send that soon, along with the naming script.
*From:* Allan Thompson <mailto:allan1.thompson@xxxxxxx>
*Sent:* Friday, August 23, 2013 7:43 PM
*To:* ian-reeds-games@xxxxxxxxxxxxx <mailto:ian-reeds-games@xxxxxxxxxxxxx>
*Subject:* [ian-reeds-games] Re: Plans for the coming school year!

Hey Abi,

It sounds intrigueing. What did you have in mind? Like stats for a character? Or what did you have in mind.

al

*From:*ian-reeds-games-bounce@xxxxxxxxxxxxx [mailto:ian-reeds-games-bounce@xxxxxxxxxxxxx] *On Behalf Of *abigail prescott
*Sent:* Friday, August 23, 2013 2:03 PM
*To:* ian-reeds-games@xxxxxxxxxxxxx
*Subject:* [ian-reeds-games] Re: Plans for the coming school year!

Anyone interested in a script to give units random stats when they’re created?

*From:*Allan Thompson <mailto:allan1.thompson@xxxxxxx>

*Sent:*Friday, August 23, 2013 6:41 PM

*To:*ian-reeds-games@xxxxxxxxxxxxx <mailto: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> [mailto:ian-reeds-games-bounce@xxxxxxxxxxxxx] *On Behalf Of *abigail prescott
*Sent:* Friday, August 23, 2013 1:27 PM
*To:* ian-reeds-games@xxxxxxxxxxxxx <mailto: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 <mailto:allan1.thompson@xxxxxxx>

*Sent:*Friday, August 23, 2013 5:54 PM

*To:*ian-reeds-games@xxxxxxxxxxxxx <mailto: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> [mailto:ian-reeds-games-bounce@xxxxxxxxxxxxx] *On Behalf Of *abigail prescott
*Sent:* Friday, August 23, 2013 8:51 AM
*To:* ian-reeds-games@xxxxxxxxxxxxx <mailto: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 <mailto:abigail.prescott@xxxxxxxxxxx>

*Sent:*Thursday, August 22, 2013 11:25 PM

*To:*ian-reeds-games@xxxxxxxxxxxxx <mailto: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 <mailto:sleepio1@xxxxxxxxxxx>

*Sent:*Thursday, August 22, 2013 11:06 PM

*To:*ian-reeds-games@xxxxxxxxxxxxx <mailto: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.


Other related posts: