Jump to content

outdoor terrain modification


Thralni

Recommended Posts

I have problems with the outdoor terrain and floor modification. i have looked around, and in EoR for example, outdoor terrain modification does work, so i was wondering if there's some fault in my script. i have done it according to the relevant script of EoR, that is to say, the only outdoor script it has. here is my script:

 

Code:
 //Outdoor Script for x = 2  y = 1beginoutdoorscript;variables;int choice;body;beginstate INIT_STATE;if (get_flag(16,0) == 9) {		set_terrain(43,27,138); // All terrain modifications		[it continues with many more terrain]				set_floor(44,18,89); // All floor modifications		[it continues with many more floors]		}break;beginstate START_STATE;if (get_flag(16,0) == 9 && get_flag(121,3) == 0) {		set_state_continue(15);		}break;[states 10 to 14 have been removed as they are irrelevant]beginstate 15;		set_terrain(43,27,138); // All terrain modifications		[it continues with many more terrain]				set_floor(44,18,89); // All floor modifications		[it continues with many more floors]set_flag(121,3,1); // makes sure START_STATE doesn't trigger state 15 again, but instead is taken over by INIT_STATEbreak; 
flag 16,0 is set to 9 upon ending of the cutscene in which terrain is modified. The cutscene happens in town 18, not in the outdoors, and all that works fine. is there any reason why there should be a problem with this script?
Link to comment
Share on other sites

Yeah, so I tried putting that in the INIT_STATE, but later found that said state doesn't trigger very reliably. So, it basically had to slip it into the START_STATE as well... otherwise, the terrain wouldn't look right after reloading a saved game or exiting a town.

 

Also, just for the record, stuff like pause() and force_instant_terrain_redraw() don't work in the outdoors, at all.

 

In short, the outdoors are weird.

Link to comment
Share on other sites

Apparently outdoors scripts aren't reloaded like towns are. So if you leave a town into that outdoor section, you won't technically be entering it. I think it reloads an outdoor script only when you've travelled several sectors away. This is just general stuff I remember from problems I had with Dilecia-- I'm not 100% sure this is totally accurate, but the moral of the story stays the same: Outdoors suck.

Link to comment
Share on other sites

Quote:
Originally written by Ephesos:
Also, just for the record, stuff like pause() and force_instant_terrain_redraw() don't work in the outdoors, at all.
You can use pause() just fine outdoors; I've done it before. You can work around the non-functioning of force_instant_terrain_redraw() by using out_move_party() in some cases.

I think that part of the issue with INIT_STATES of outdoor scripts may be that in BoA's efforts to make the outdoors seamless, it loads an outdoor section and its script when the party is still a section away. This the having to walk quite far away to make the script be reloaded.
Link to comment
Share on other sites

Okay, I have heard here some good things I will be trying, but I do have a question or two:

 

Ephesos: Before I did it as it is now, I had all the modifications in the START_STATE, which didn't work. In EoR it seems to be working fine, though. So you first put it in the INIT, which didn't work proparly, but when you put it in the START, it did work? If so, is there any real difference between our scripts?

 

Dintiradan: I'll try that, thanks.

 

Lazarus: That really sucks. Exactly what i am doing, is getting the party in a town, they view a cutscene, they get out of town, and then the outdoors should be changed. *sighs*

 

Niemand: In my experience, it never worked. I could walk to the end of the world, and still nothing would have changed, so...

 

Anyway, I'm gonna try to change what was suggested here, and see if it works. I'll also put some debug call is, to see when exactly the INIT/START_STATEs are called, which hopefully will make things easier. I have no idea when I will gonna do that, though. tests are over (getting them back now *deep sigh*), but homework is already piling up.

 

So yeah, *fun*

Link to comment
Share on other sites

I've decided that outdoors are a lost cause in most cases, and for two reasons.

 

One was the thing Salmon mentioned - trying to get tress to appear when you stepped on a certain space.

 

The second was something that should be possible - setting a supply cache to the "found" terrain. I've tried this in three different outdoor scripts now, and no cigar. And the weird thing is, other people have done it (Smoo in RA springs to mind as an example).

 

I guess the upshot of this means you might not be able to do what you want. But there may be a work-around - have the party go to a new outdoor section, with the changes you want made. Of course, this will probably only be worthwhile if you had a lot of changes in mind...

Link to comment
Share on other sites

Quote:
Originally written by Thralni:
Ephesos: Before I did it as it is now, I had all the modifications in the START_STATE, which didn't work. In EoR it seems to be working fine, though. So you first put it in the INIT, which didn't work proparly, but when you put it in the START, it did work? If so, is there any real difference between our scripts?
The difference is set_flag(121,3,1), and the corresponding get_flag call. If you just took those out, it'd work just fine.
Link to comment
Share on other sites

Quote:
Originally written by Ephesos:
Quote:
Originally written by Thralni:
Ephesos: Before I did it as it is now, I had all the modifications in the START_STATE, which didn't work. In EoR it seems to be working fine, though. So you first put it in the INIT, which didn't work proparly, but when you put it in the START, it did work? If so, is there any real difference between our scripts?
The difference is set_flag(121,3,1), and the corresponding get_flag call. If you just took those out, it'd work just fine.
I hope so... But I'll never the less try that too.
Link to comment
Share on other sites

Very, very weird...

 

Okay, I tried out what was suggested in this thread, and nothing worked, so I decided to do some research. I entered the strings

 

Code:
 a=x;print_num(a); 
at the INIT and START_STATE, a = 1 for INIT and a = 2 for START. I came to the following conclusion:

 

The START state is called every single turn, as it should, but no terrain is actually changed.

 

The INIT state is called when you are within reach of the new outdoor section, about 5 - 10 spaces away from it.

 

Now comes the strange part: the INIT state altered the terrain, but in a totally weird way. On every place it had to put terrain, it either heightened or lowered the terrain with about 10. This seemed somewhat random, though lowering happened a lot more. Also, the terrain modifications were in the wrong outdoor section, namely in the one the INIT state was triggered in. It then started giving a thousand times the error "terrain number out of reach," and when it had enough, BoA crashed. The report that was automatically made, said I have v1,1 of BoA, which seems strange to me. I downloaded BoA again, though, so I'll see what happens next.

Link to comment
Share on other sites

...that's just weird. Are you sure that none of your set_terrain/floor calls have a numeric typo?

 

Also, how have you been testing this? Because I recommend re-testing with a fresh party, after you remove everything to do with flag (121,3). Then, I don't see why the START_STATE wouldn't work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...