Jump to content

Scripting Idea/Question


Recommended Posts

I'm trying to make a sequence where the party will have to guide another group somewhere, and I have no idea which calls might be useful for that. Don't kill yourself looking for a solution, but off the top of your head, how might you create an outdoor group that would follow the party step for step?

Link to comment
Share on other sites

Assuming this has to take place in the game and not in a cutscene, I think you should make a custom creature script. You can set the creatures to remain close to the party.

 

beginstate X;

if (approach_char(ME, 0, 1) > 0)

set_state (start_state);

break;

 

Will cause an NPC to try to stand right next to the PC in slot 0 if you call state X in the creature script. Anyone else, please correct me if I'm wrong. I've only written one creature script so far.

Link to comment
Share on other sites

Now, if you want the NPC to actually follow in the footsteps of the party, that would be more tricky. I'd say that you make the NPC completely immoble (mem cell 0 = 2) and then include a script in town state 2 (called each turn) that stores the position of the last character in the party for the last few turns and then uses relocate_char to move the NPCs to those spaces. This would mean having a bunch of variables that store the coordinates of those epaces. Or, if you can make do with just 2 NPCs, you could just add them to slots 5 and 6 in the party.

Link to comment
Share on other sites

Creating a friendly preset encounter with move type 0 will have them follow the party around, but it will be possible to lose them (quite easily). So maybe when the party gets to whereever they're supposed to guide these guys check the distance between them and the party and make them go fetch them if they've lost them.

Link to comment
Share on other sites

A hackish way could be to have a terrain feature that looks like your group, and a script that repositions the tile with each step you take. That's what I think, anyways.

 

EDIT: I've experimented a bit, and this actually seems to work! Right now, I'm seeing if I can make a mobile town. (BTW, remember to add a script too to check if the party is adjacent to the object. I don't think there is a way to set nodes on the fly. In fact, I don't know what this does to nodes at all.) The Flying Fortress of FZ, here we come!

 

EDIT2: Hmm... not possible, most since I can't find a call to move from outdoors to town. Still, I might be able to make mobile teleport gates.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...