You must be logged in to post messages.
Please login or register

Scenario and Map Creation
Moderated by Aurilux

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Have a question? Post it here
« Previous Page  1 2 3  Next Page »
posted 05-18-06 02:39 AM EDT (US)   
So you have a question? You can post it here!

Since most heavens have at least one question thread, most very popular and most reaching the very noble score of 2500 posts, its time Rise of Legends Heaven follows in the footsteps of earlier heavens: I present you the question thread!

For one, this will keep the forum cleaner and it will be easier to read the remaining topics, and it will save space instead of threads asking questions about scenario design in the Rise of Legends community. I am sure many both great and less experienced designers will take the time to answer both your simple and harder questions, they might learn something new to..

So, post any and all questions about scripts, triggers, units, mapping, modding, really anything that is about something in the Rise of Legends universe, and the skilled designers in the Rise of Legends community will do their best to answer them.

Once this thread reaches the 2500th post I will take all your questions and answers to put them in one massive FAQ. (Remind me about it, soon I will regret this and edit it out.)

Update: I have decided to put basic questions here, and am aiming for about 5-6 questions here, that get asked often:
1. How do you delete units in the editor?
Use Backspace or Ctrl + X
2. Why don't my multiplayer maps load to the opponent?
Scenarios not saved in your 'My Documents\My Games\Rise Of Legends\custom maps' folder are likely to not be transferred across Gamespy. (Thanks to Evolved for this tip.)
3. Is there any guide about scripting?
This guide was written by Archaeopterix, and handles basic scripting. Note: Guide is not online any more.

Ask your questions!

Yes, periods and smileys are the same for me
No matter what you say

[This message has been edited by Paperfriend (edited 03-29-2007 @ 04:07 AM).]

Replies:
posted 06-26-06 04:26 PM EDT (US)     26 / 69  

Quote:

How come the editor units are like 100 times more detailed.


Probably something to do with your performance settings in the Options, which are not taken into the account for the editor because the editor is paused and no animations happen.
I could be wrong... The detail of units is uniform across editor and gameplay for me.
posted 06-26-06 04:40 PM EDT (US)     27 / 69  

Quote:

Update: I have decided to put basic questions here, and am aiming for about 5-6 questions here, that get asked often:

1. How do you delete units in the editor?
Use Backspace or Ctrl + X


Good idea or should I remove it? I think lots of people are wondering about this one, I did so myself.

Yes, periods and smileys are the same for me
No matter what you say
posted 06-26-06 08:21 PM EDT (US)     28 / 69  
An FAQ of the 5/6 most asked is a good idea. If it exceeds 5 or 6, people simply won't read it. The deletion question is as good a place as any to start, and it can always be replaced if it so happens 5 questions are asked more frequently than it.
posted 06-27-06 06:04 PM EDT (US)     29 / 69  
I have 2 questions.

1) How do I insert the script? I typed in the name of the script which is in the same folder as the map file, pressed enter, and nothing. The name of the script is still visible in he text box, but that's it. Saving and re-loading the map file kills any mention of the script. "Browse" doesn't work either.

My script is very simple:

void game_callback on_game_frame() {
}


2) Assuming it's even possible to use the script, how do I make a BLANK integer/string array? Are arrays even possible?!?

posted 06-27-06 06:14 PM EDT (US)     30 / 69  
A1: You have to right-click somewhere and click add new script. But it's a long time since I've visited the editor, so I'm not quite sure where. The right-clicking was counter-intuitive for me though, so this might be the answer to your question.

A2: I certainly hope arrays are possible, but I don't know as I haven't encountered one yet. I'm not sure about the possibilities of javascript compared to the possibilities of java.

If it's possible, just say:

int[] x;
// for a null array, or:

int[] y = new int[n];
// for an empty array, where n is replaced by the desired array length

EDIT 2: I'm not so sure after all.

Q: If, in javascript, variable types are assigned dynamically, why are there different variable types for Unit, Path (and also the regular int, float)? Only for readability purposes?
This question isn't really RoL related, but I still want to know.

[This message has been edited by Archaeopterix (edited 06-28-2006 @ 10:52 AM).]

posted 06-27-06 06:58 PM EDT (US)     31 / 69  
That's a dynamic array though... Dynamic arrays are slow as they need to redefine their bounds each time. Is it possible to make a static array of size X?


>Q: If, in javascript, variable types are assigned dynamically, why are there different variable types for Unit, Path (and also the regular int, float)? Only for readability purposes?

Well, this isn't javascript, right..? Javascript is a pretty horrible language to write anything at all complex. Do you meant the ROL script? If so, what do you mean by "variable types are assigned dynamically?" Again I'll assume you mean something like "blah=blah2", where blah is not previously defined, but blah2 is. So blah is just defined by the compiler in this case after the compiler figures out the variable type of blah2, and then blah is set equal to blah2.


EDIT: I've been able to answer myself on several of my questions, but still some remain. Also I have found some bugs in the editor that I would like to share.


Quote:


Bugs:
1) The "Browse" button in the script list only works when there is already a script inserted.

2) If a a script has an error and the editor gives an error message, one must click "abort", then "debug" to avoid crashing.

3) Attempting to remove a script crashes the editor.

Answers:
1) To insert locations, areas, scripts, etc. into the map, RIGHT CLICK the black area on the bottom left-- where the screen shows "Locations"/"Areas"/"Scripts", etc, to bring up a sub-menu.


2) Locations defined in a map file can be referenced to in a script using quotations, e.g. a location named loc1 in the map file is named "loc1" in a script. To set a location variable equal to that location, type e.g.:
Location loc1 = "loc1";

3) The script system does not allow the same name for different types of data within the name space of the map itself. Thus, you cannot have both an area and location named "testspot". You must instead use, for instance, "testarea" and "testloc".

4) List of names for units,etc. usable in script: "\Data\unitrules.xml", "\Data\buildingrules.xml", etc. under a type name.



Questions:
1) How can one create fixed arrays, if possible?

2) How does one define locations,areas, etc. in the script code ONLY, e.g. "Location test1 = (50,50)" , if at all possible?

3) How does one convert types such that this code (the ttt part) works? It doesn't error, but doesn't work either:
void game_callback on_game_frame() {
Location test1 = "test1";
run_once {
create_unit ("1","Glass Dragon Start", test1);
}
}
void game_callback on_unit_killed (Unit the_unit) {
Location test1 = "test1";
UnitType ttt = UnitType(the_unit);
create_unit ("1", "Glass Dragon Start", test1); //this works
create_unit ("1", ttt, test1); //this does not work
}

[This message has been edited by Agamemnus (edited 06-29-2006 @ 07:46 PM).]

posted 06-30-06 03:28 PM EDT (US)     32 / 69  
1) Sorry.

2) You can't in the bhs scripts. Instead, look at the .map file for that, and edit the XML code itself. The following excerpt will clarify enough:

Quote:

<CASTMEMBER name="Drop Path B" type="Path">
<CASTMEMBER type="Location" name="Drop Path B 0" tx="43" ty="111"/>
<CASTMEMBER type="Location" name="Drop Path B 1" tx="86" ty="151"/>
<CASTMEMBER type="Location" name="Drop Path B 2" tx="117" ty="140"/>
<CASTMEMBER type="Location" name="Drop Path B 3" tx="151" ty="99"/>
</CASTMEMBER>


Have a look at the campaign's .map files for more examples.

3)

Quote:

UnitType ttt = UnitType(the_unit);


Are you sure it's not a function called GetUnitType (or something similar) you're meant to use here? I wouldn't know though, and I'm too lazy to check the reference myself, but it's the only thing that I think could go wrong. On the other hand, you're not a noob so you probably double check what functions you use...
posted 06-30-06 03:45 PM EDT (US)     33 / 69  
Thanks for the reply,

Yeah I figured out just a few hours ago how to do it: get_unit_type(the_unit). It's the first function but I didn't notice it somehow. I got that working.

I've also been looking at the "array" functions, but it seems they are dynamic arrays instead of real arrays. That's too bad. (insert, search, etc.)

posted 07-02-06 08:54 AM EDT (US)     34 / 69  
Is there anyway to stop buildings from moving? I save a scenario, load it again, and have to send the next 7 minutes putting my crashlanded Alin City back in the air! I want those things to float, but they seem to dislike the idea, the moment I turn my backs on them, they dig a hole for themselves and stay there.

Any help?


Yes, periods and smileys are the same for me
No matter what you say
posted 07-02-06 11:11 AM EDT (US)     35 / 69  
Something to do with the selected placing style? Or has that only to do with prefabs... Otherwhise it's a bug I think. Does it happen to alin buildings only?
posted 07-02-06 11:25 AM EDT (US)     36 / 69  
All civ districts, and the city itself: Millitairy, Merchant, Reactor, Magus, Holy and Industrial. I the screenshot I posted (with the pink millitairy district), had the same, each time I loaded it, I had to redo all the buildings.

EDIT: I forgot palace


Yes, periods and smileys are the same for me
No matter what you say

[This message has been edited by Paperfriend (edited 07-02-2006 @ 05:49 PM).]

posted 07-08-06 10:57 PM EDT (US)     37 / 69  
Anyone know if its possible to use every single kind of terrain on one map or are we stuck with just one tileset that we set before starting the map?
posted 07-10-06 10:55 PM EDT (US)     38 / 69  
Well we are for now until I really investigate the scenario editor. A preliminary answer would be that we are stuck with just one tileset - though Greypawn once said about unless someone's modded it otherwise.

You can change tileset's when you've loaded a scen, can't you?

EDIT: Can you have the game actually playing during cinematics?

[This message has been edited by Evolved (edited 07-11-2006 @ 01:23 AM).]

posted 07-17-06 01:12 AM EDT (US)     39 / 69  
From what I see tileset is greyed out, maybe im doing somthing wrong, but it would be cool to be able to make a map of aio but to do that you need all tilesets.

Edit: Also does anyone know the largest size for a map, I remember seeing it somewhere before and I just can't find it. I think its 120 but I need some verification.

Thanks

[This message has been edited by Hipskovski (edited 07-17-2006 @ 01:15 AM).]

posted 07-17-06 01:17 AM EDT (US)     40 / 69  
You moderaters always talk about all these scenarios that you've created but if you did create so many then why didn't you upload any of them?

P.S Please upload more scenarios the fallen jungle is great and i cant wait untill the next one.

posted 07-17-06 01:45 AM EDT (US)     41 / 69  
Well most all of mine so far are eye-candy maps.
posted 07-17-06 11:26 AM EDT (US)     42 / 69  
Im in the middle of doing a script and im having some problems setting a buildings health to 20 thousand. I'm getting an
telling me that the function has invalid parameters

In the Function reference its,
void set_building_health_hitpoints (Build the_build, int hitpoints)

I Have,
trigger BuildingHP(){
set_building_health_hitpoints("d1", "20000");
set_building_health_hitpoints("d2", "20000");
set_building_health_hitpoints("d3", "20000");
set_building_health_hitpoints("d4", "20000");
set_building_health_hitpoints("d5", "20000");
set_building_health_hitpoints("d6", "20000");
set_building_health_hitpoints("d7", "20000");
set_building_health_hitpoints("d8", "20000");

Edit: Well i took off the "20000" using just 20000 and I got rid of the invalid parameters but now im getting set_building_health_hitpoints is undefined.

Edit: Good News Theres No Error
Bad News The Buildings Just Blow Up Now

[This message has been edited by Hipskovski (edited 07-17-2006 @ 01:43 PM).]

posted 07-17-06 11:52 AM EDT (US)     43 / 69  

Quote:

Anyone know if its possible to use every single kind of terrain on one map or are we stuck with just one tileset that we set before starting the map?


No, you must use the tileset you choose when creating the map and only that tileset.
Unfortunately.

Theoretically, you could add all textures to one tileset (by modding) and pick the new tileset, but I don't know how to do that off the top of my head as I haven't tried.

posted 07-17-06 11:57 AM EDT (US)     44 / 69  
Not with the current files seems to be the default answer for modding questions, and so it applies here.
posted 07-20-06 04:45 PM EDT (US)     45 / 69  

Quote:


Im in the middle of doing a script and im having some problems setting a buildings health to 20 thousand. I'm getting an
telling me that the function has invalid parameters
In the Function reference its,
void set_building_health_hitpoints (Build the_build, int hitpoints)

I Have,
trigger BuildingHP(){
set_building_health_hitpoints("d1", "20000");
set_building_health_hitpoints("d2", "20000");
set_building_health_hitpoints("d3", "20000");
set_building_health_hitpoints("d4", "20000");
set_building_health_hitpoints("d5", "20000");
set_building_health_hitpoints("d6", "20000");
set_building_health_hitpoints("d7", "20000");
set_building_health_hitpoints("d8", "20000");

Edit: Well i took off the "20000" using just 20000 and I got rid of the invalid parameters but now im getting set_building_health_hitpoints is undefined.

Edit: Good News Theres No Error
Bad News The Buildings Just Blow Up Now

Rather than use script, I'd highly recommend creating a new unit in the map header using xml.

To do it, there's a very simple way to create custom units, spells, and buildings for any map. The bonus is that you don't have to use custom tribes. The drawback is that you're going to have to manually edit it into the file. Be sure to make a backup your original!

Open the "Mine Again" map from the Vinci campaign in an xml editor and looking at the "Types" section (it's near the top). You'll see this section behaves pretty much like a custom tribe's (or unitrules.xml) types section. Using this technique, you can create new units, spells, buffs, etc all inside of the map file without importing a custom tribe. They can then be added via script or the scenario editor.

For example, if I wanted to give all obelisks 20,000 hp, it would look something like this:


<TYPES>
<BUILDING class="builds" reference_name="Obelisk" reference_style="replace">
<HITS>20000</HITS>
</BUILDING>
</TYPES>

I'd drop that inbetween the and sections of the map.

For other examples, there are a number of other maps that use this technique in the campaign. The custom tribe handbook has more specific information on creating types.

posted 07-20-06 05:14 PM EDT (US)     46 / 69  
Kahooola!
posted 07-20-06 11:48 PM EDT (US)     47 / 69  
Mr. Darthveda,

Hopefully you will also be gracious enough to answer my questions too, which I have wanted to know the answers to for a long time:

*Is it possible to modify a location's position with integers? (If so, how?)

*Is it possible to dynamically change a unit's attributes, like max hitpoints or firepower?

*Is it possible to define an array without defining each empty value?, e.g. int array1[50] instead of int [] array1 = [0,0,0,0...etc.]?

* I'd also like to know how to access the time left on a buff. For instance "give_object_buff (curUnit, curUnit, "Augmentation", 400);" gives about 20 seconds, but I want to know when it's exactly at 1 second.

* Is there a way/file to search for all the built in functions, not just the ones in the function list document? (as there are quite a few that are in scripts but not in the document)

EDIT: Also, any plans on making landscapes rotatable in the future?

Thanks.

[This message has been edited by Agamemnus (edited 07-21-2006 @ 00:32 AM).]

posted 07-21-06 11:59 AM EDT (US)     48 / 69  
Thanks DearthVeda

I no longer need it, I should have edited the post to say this but the information will help in other projects.

Thanks Again

Edit:
When ever i test a map online player names are changed to Player 1 Player 2 etc...

Anyway to get it so they just use the name they go in with?

Edit: To do this you just delete the part in the xml where it says Player Name "Player 1" or somthing similar. I can't recall it exactly.

[This message has been edited by Hipskovski (edited 07-22-2006 @ 08:22 PM).]

posted 07-22-06 11:16 AM EDT (US)     49 / 69  
Don't answer hipskovski, answer me.

Besides, we already found the answer to his second question.

posted 07-24-06 11:40 AM EDT (US)     50 / 69  

Quote:


*Is it possible to modify a location's position with integers? (If so, how?)

Nope.

Quote:


*Is it possible to dynamically change a unit's attributes, like max hitpoints or firepower?

While there isn't a script function that reliably does this, you can do this through techs and bonuses. For example, in the Vinci campaign some units get a buff that increase their max HP without creating a new unit. With a bonus you can increase stats by a percentage or a specific value.

There's a bit more on techs and bonuses in the ROL Custom Tribe Kit.

There exist a number of ways you can set these up. You can buff a single unit by using give_object_buff and the name of the bonus. You can give a leader a tech, and the bonus that has that tech as a prerequisite will be applied to either a) the unit type(s) specified or b) all the units produced from a building specified. See techrules.xml for a lot of examples on bonuses.

And remember that you can create new techs and bonuses in the map header with the method I specified a few posts above!

Quote:


*Is it possible to define an array without defining each empty value?, e.g. int array1 instead of int array1 = ?

Sure. You can just use "int foo[];" and then use the script function add(array, value) to insert values into the array later. For example:


void game_callback on_game_frame(){

int foo[];

add(foo, 3); // Adds 3 to the last position in the array, growing the array in the process
}

Quote:


* I'd also like to know how to access the time left on a buff. For instance "give_object_buff (curUnit, curUnit, "Augmentation", 400);" gives about 20 seconds, but I want to know when it's exactly at 1 second.

The script function "get_spell_remaining_time (Spell the_spell)" should give you what you want. If it doesn't, I'd resort to using a timer to try and keep track.

Quote:


* Is there a way/file to search for all the built in functions, not just the ones in the function list document? (as there are quite a few that are in scripts but not in the document)

I assume you're talking about the Script Function Reference Sheet.doc contained in the ROL Scripting Kit. Aside from that doc, no.

Quote:


EDIT: Also, any plans on making landscapes rotatable in the future?

I don't know of any plans at this time, but I wouldn't rule anything out

[This message has been edited by DarthVeda (edited 07-24-2006 @ 11:41 AM).]

« Previous Page  1 2 3  Next Page »
Rise of Legends Heaven » Forums » Scenario and Map Creation » Have a question? Post it here
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Rise of Legends Heaven | HeavenGames