Scripting or Fear-ing?

A forum for discussing map making ideas and problems for the Myth series.
Post Reply
rifthead
Posts: 88
Joined: Wed Oct 31, 2007 6:53 pm

Scripting or Fear-ing?

Post by rifthead »

I'm working on a plugin that involves the evacuation of a populated city...but it's been a while since I last played with the Myth 2 Engine, and I was never particularly good at scripting.

One of the key mechanics is getting uncontrollable civilians to head towards soldiers, so that the player can set up evacuation routes to rescue the civilians, but doesn't receive direct control over them. I'm trying to figure out the best way to accomplish this...my thoughts so far:

-If I can do it through Fear instead of scripting, I'd like it better. I'm thinking some kind of special attack that attracts the civilians to the unit that uses it. Any ideas on how to set this up?

-If a special attack won't work, what about taunting? Is there any way to set up a Fear mechanic that will make Civilians run towards the unit when it taunts?

-If these fail, what kind of scripting can I use to get Civilians to run towards the unit when it taunts? I know there's a script that does something like this in Through the Ermine, when you taunt in the shrine and it summons all the enemies of the level.


Also, I'd like to implement a fear (the feeling, not the program) mechanic in my civilians, so that when they see an enemy, they run in terror instead of following the Player unit's directions. Kind of like how ambient life runs away from the player when they approach. What's the best way to accomplish this? Again, I'd like to avoid scripting if I can, but if its only doable that way I'll give it a shot.
User avatar
haravikk
Site Admin
Posts: 987
Joined: Mon Mar 22, 2004 12:56 pm
Location: Scotland

Re: Scripting or Fear-ing?

Post by haravikk »

I think scripting is going to be needed to some degree no matter how you implement it exactly.

Your idea of doing it as an attack though might be a good away, as it would eliminate the need for a constant follow script, but it might too restrictive, as the Follow command in scripting is useful for its ability to have monsters avoid nearby enemies while attempting to stick close to a friendly target. If you're not too concerned about having that ability, then an attack command will work well, as you only need to tell the civilian to start "attacking" the right soldier, and it'll continue following until the soldier dies.

You could possible do this is a combination effect:
  • Use a Geometry Filter to detect a single taunting soldier
  • Use another Geometry Filter to detect civilians near to that soldier
  • Tell the civilians to "attack" that soldier
  • Repeat
This way the player can gather civilians by taunting, and they'll follow the specific soldier that taunted, giving them some control by allowing them to taunt with a specific soldier so you can lead the civilians out of a firefight while the other soldiers do the fighting.


But, I don't think there is any way to do this without some script involvement, at least not without something weird and unreliable, like the soldier pulling the civilians around :)
Being Haravikk gets you girls like these:
Image
rifthead
Posts: 88
Joined: Wed Oct 31, 2007 6:53 pm

Re: Scripting or Fear-ing?

Post by rifthead »

But I could set the geometry script to never expire, right? That would mean that each soldier who taunts has the ability to pull civilians from a set radius around them, no matter where they are on the map, if I understand this correctly. That would work just fine.
User avatar
Pyro
Bug Finder Extraordinaire
Posts: 4751
Joined: Sun Mar 21, 2004 2:14 pm
Location: Texas

Re: Scripting or Fear-ing?

Post by Pyro »

Geometry Filters will only look for units or objects, setting it to never expire will ensure it is always looking for whatever you set it to look for.

A good example of a Follow script would be in The Fallen Levels's Out of the Barrier map. In it you see Alric following the player's units. So all you would have to do is open that script and find the follow action and see how it is set up. Working off an example makes scripting a lot easier to learn.
Graydon
Posts: 1605
Joined: Sun Mar 21, 2004 5:10 pm

Re: Scripting or Fear-ing?

Post by Graydon »

Uh, or rather than extracting a different plugin, you could just open up Broken Path or whatever level 3 with rurik is called. That's a prime m2 example of the Follow script, including fallback actions.
Image
User avatar
Pyro
Bug Finder Extraordinaire
Posts: 4751
Joined: Sun Mar 21, 2004 2:14 pm
Location: Texas

Re: Scripting or Fear-ing?

Post by Pyro »

No, Rurik uses "Leading" and leads the player around. Alric uses "Follow" and follows the player around.
Graydon
Posts: 1605
Joined: Sun Mar 21, 2004 5:10 pm

Re: Scripting or Fear-ing?

Post by Graydon »

Wow fail. You're totally right. As always. :P
Image
Post Reply