Jump to content

Outdoor Fight Terrain


Dahak

Recommended Posts

All I know in terms of what I've tried is that if you put items in the outdoor fight town, they won't be spawned when the town is generated for an outdoor fight.

 

My suggestion would be to have the outdoor fight town be composed of a terrain or floor that calls a scenario script state when stepped on, and use that state for whatever it is you want to do. You don't necessarily have to use that terrain anywhere else, either, it can be an alternate version of the regular terrain. Or you could probably fiddle with the 'outdoor state called when met' thing in the encounter itself, but I kind of doubt you'd be able to get it to affect the fight town. Could have the called when met state set an sdf, then the scenario start_state checks to see if that sdf has been set, and if it has and the party is in a small town, do whatever it is you want it to do (and afterwards unset the sdf).

 

But there's probably simpler ways to do it. I seem to have a talent for coming up with code that's five times as complex as it needs to be, simply because it doesn't occur to me that the less complex ways exist.

Link to comment
Share on other sites

The scenario script start_state doesn't get called in outdoor combat. Just another quirk Jeff threw in to show he loves us.

 

The best way I came up with is to include an invisible dummy creature included in the fight, with a custom script that runs like a town script's start_state. There might be better ways, I haven't looked into it too closely.

Link to comment
Share on other sites

If you really want to use the features of a town in an outdoor fight you can borrow an idea from the Exodus scenario. Create a real town, have the fight take place there, then make the town invisible when the PCs leave it, this would use the Exit state:

beginstate EXIT_STATE;

set_town_visibility(12,0);

break;

 

Floor and terrain types can only call Scenario script states, they do this as part of their special properties. To call anything else would involve the use of terrain scripts, one per square.

Link to comment
Share on other sites

Creature scripts work fairly reliably in outdoor fights, so what I'm doing (or planning on doing, anyway) is creating a duplicate of the desired creature(s) and giving them a different default script. Then, when a certain fight is joined, use the special when met thing to call a state that sets a flag. Then, when the creatures are initializing, have a bit of code in their INIT_STATE and having the code play out in that, so long as the flag is set correctly. Then, once the creature is done with whatever it's doing, reset the flag so that none of the other creatures can call it.

 

EDIT: And I fairly certain that most calls that work for towns also work for outside fights.

Link to comment
Share on other sites

The whole reason I wanted it outdoors was so that the party cannot rest or use any town-only functions. I also didn't them to be able to enter and then leave w/o killing everyone. I know I can extend the border of the town from (1,1) to (48,48), but there is no call to force them to leave unless I use move_to_new_town(). Correct? Also, I'll probably test this later, but you can perform a teleport (within a town) and call a cutscene upon the death of an NPC, correct?

Link to comment
Share on other sites

Quote:
Originally written by Dahak:
I know I can extend the border of the town from (1,1) to (48,48), but there is no call to force them to leave unless I use move_to_new_town(). Correct?
That's the only call that immediately moves them to a new town, though you have to have the party step on it or it won't work. You can also teleport them to an area where they have no choice but to leave.

Quote:
Also, I'll probably test this later, but you can perform a teleport (within a town) and call a cutscene upon the death of an NPC, correct?
Yes. You can pretty much do anything in a DEAD_STATE that you could in a normal state.
Link to comment
Share on other sites

Quote:
Is there any way stop them from leaving fight mode?
Not really. You could do something like what Kelandon did in Bahs and punish the player for leaving combat mode, but that's about all. (I would also remark that this method alone is not necessarily very effective. My whole party died repeatedly in Bahs before I figured it out, because I didn't realise that if I enetered combat mode I would stop taking damage.)
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...