Catching Script - can it be done?

A forum for discussing map making ideas and problems for the Myth series.
Post Reply
User avatar
Road
Posts: 371
Joined: Fri Mar 19, 2004 3:23 pm

Post by Road »

Is it possible to have a specific unit catch an object when it hits them in Mesh Script?

Iv scrolled through many script options but none really seem to work for it. Iv already put a script in for the unit to automatically aquire the weapon at start with "unit control pickup artifact" but I want the unit to also get the artifact back into inventory if the artifact is withen a radiuse of him.

Isnt there a way to Test a radiuse of a unit to activate an action if a certian projectile/artifact is withen a certian range and then force the unit to have the artifact back in hand?
Image
User avatar
haravikk
Site Admin
Posts: 987
Joined: Mon Mar 22, 2004 12:56 pm
Location: Scotland

Post by haravikk »

That would require a Geometry Filter set-up to test within a radius of the unit for the given projectile type and then on success do what you want it to.

The parameters you will require off the top of my head:
cemo (monster_identifier) - the monster to test, only works for one monster or the first present monster in a list
radi (world_distance) - the radius around the unit to test
obje (field_name) - the four letter code identifying the projectile type or
proj (object_identifier) - an identifier for the exact object to look for (if there is only one present)
insi (field_name) - this determines what parameter the results are stored in, if you are giving an artifact to a unit then you will want to enter 'proj'.
resu (action_identifier) - the action to place results of the GEOM into. This will place all projectiles found into the action, I generally use an empty action specially for this purpose
_max (integer) - the maximum number of results to return (for an artifact 1 is probably best)
acos (action_identifier) - what to do on success, this would be perhaps a unit control which uses the results action to give the unit the item.

Hope some of this helps, some of the above may be a little off but you should be able to find the right parameters without much bother =)
Being Haravikk gets you girls like these:
Image
User avatar
Nameless
Posts: 69
Joined: Sun Aug 08, 2004 3:28 pm
Location: United States

Post by Nameless »

Im not much of a scripter but couldnt you make the projectile delete when it hits the unit and then give the unit that projectile? :?:
User avatar
Road
Posts: 371
Joined: Fri Mar 19, 2004 3:23 pm

Post by Road »

Well thats pretty much what Iv been trying to do. Horus had a script from a mapset that he says works like that and he sent me the script but it was pretty much the same as what Haravikk wrote.

Iv tried a few differnt scripts and all failed so far. One problem is that I cant seem to find a way for the script to target a Projectile thats not already on the map. I tried to do a test for the projectile header withen 3 units from monster but it doesnt seem to have any effect.

As far as I can tell there is no way to remove the projectile unless its already placed on the map.
Image
User avatar
Nameless
Posts: 69
Joined: Sun Aug 08, 2004 3:28 pm
Location: United States

Post by Nameless »

I dunno. Maybe you could use a simple visibility command. Make the projectile invisible rather than removing it. Just a guess...
Brainbug
Posts: 319
Joined: Fri Mar 19, 2004 6:28 pm
Location: The Mekka Of Techno
Contact:

Post by Brainbug »

forcing a unit to pick up something is also done in twice reborn:

Alric picks up sword at start without moving to it...

Code: Select all

	Give Alric the sword [Unit Control]
		initially_active
		deactivates_on_trigger
		0.00, 0.00
	{
		Link
			==== Alric ====
		Give Monster Artifact or Projectile
			10000 (24 Alric's magic sword)
		Ammunition
			0
	}
[/color]



Edited By Brainbug on 1093860879
User avatar
Road
Posts: 371
Joined: Fri Mar 19, 2004 3:23 pm

Post by Road »

As stated above the unit already starts with the artifact...as in HoC many units do with that script BB.

Yes making the projectile dissipear would work to...but it doesnt seem to acknowledge the header for the projectile when it get near unit...:(
Image
User avatar
haravikk
Site Admin
Posts: 987
Joined: Mon Mar 22, 2004 12:56 pm
Location: Scotland

Post by haravikk »

You want to delete the projectile? Giving it to the unit should work with the script I suggested, however deleting it may depends upon how you do it.

The header option in GEOM's is intended for detecting a type of projectile, regardless of it's being present to begin with or not.
Try sticking the debu flag in your GEOM to get debugging information output to your myth_log.txt, you can use this to check if the GEOM is succeeding or not. Try and have the test occur early on though or you might end up with a ton of rubbish in your log before you look at it =)
Being Haravikk gets you girls like these:
Image
Post Reply