[ian-reeds-games] Re: still no archers

  • From: abigail prescott <abigail.prescott@xxxxxxxxxxx>
  • To: <ian-reeds-games@xxxxxxxxxxxxx>
  • Date: Sat, 24 Aug 2013 00:12:10 +0100

With the new version, you also need to specify the unit and the alternative 
unit.

after_perform=add_unit@ { unitname: “bowmen”, unit: “archers”, alt: “elite 
archers” }

I changed it because before, for the function to work with a skill, the skill 
needed a specific block to set the variables for the function. That would work, 
but it would be inpractical and hard for people who don’t understand the 
function to do. Now, those variables are set in the event, so the script can be 
used for any map without having to even look at the scripts folder after the 
file is copied in.Abi

From: Allan Thompson 
Sent: Friday, August 23, 2013 11:53 PM
To: ian-reeds-games@xxxxxxxxxxxxx 
Subject: [ian-reeds-games] still no archers

Hey Abi,

I copied and pasted into a text file what you gave me, plus did the after event 
thing which I copied and pasted into the recruit archers file, and 
doubleslashed out the summon= flag.

 

I don’t get errors, but I am unable to summon the archers unit. Was there 
something else I needed to do?

Thanks,

al 

 

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

 

I’ve upgraded the add_unit function (I know, this must be the hundredth 
update). Now, you can use the function with any units without having to even 
look at the script.

 

Just add an after_perform=add_unit@ event to the skill file that creates the 
unit.

 

Parameters:

unit: the name of the unit file, or the unit type (same thing) in quotes

unitname: the name you want to give the unit (not including the number and 
recruiting unit which is handled by the script)

alt: This is an optional parameter to use in cases like warlords, where you 
have two units that you want the script to treat as one unit. This is the unit 
type in quotes.

 

e.g. In the recruit archers file:

after_perform=add_unit@ { unit: “archers”, unitname: “bowmen”, alt: “elite 
archers” }

 

 

Abi

 

 

From: abigail prescott 

Sent: Friday, August 23, 2013 10:28 PM

To: ian-reeds-games@xxxxxxxxxxxxx 

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

 

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 

Sent: Friday, August 23, 2013 9:01 PM

To: 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 

Sent: Friday, August 23, 2013 7:43 PM

To: 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 

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.

Other related posts: