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?
Catching Script - can it be done?
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 =)
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 =)
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.
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.
forcing a unit to pick up something is also done in twice reborn:
Alric picks up sword at start without moving to it...
[/color]
Edited By Brainbug on 1093860879
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
}
Edited By Brainbug on 1093860879
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 =)
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 =)