I'm working on a multiplayer type siege map that uses teleporting units to scale walls. Since I'm not too knowledgeable a scripter, I used the teleportation script used in the plugin Chimera.
I got it working for two separate units fine. I then added in 11 more teleporting units and ran into problems.
The script works by detecting an object marker on the map, makes the caster invisible, moves the caster to the marker, and returns the caster to visible.
The units are distinguished from each other by having their own attack the generates a unique object marker, defined in Fear in the projectile’s object tag.
I’ve duplicated the attacks, object marker, and script for all other 11 units, and have gone over it extensively to make sure everything is correctly matched up.
The problem is when unit B cast its marker, unit C teleports to the marker instead of unit B. If unit C casts its marker, unit D teleports instead, etc.
I’ve attempted to make fresh objects for the markers to be distinguished by, with no change in behavior. Even when I had changed the marker’s object tag, but had not updated the scripts with the new object values, the units are still able to teleport one another. This shouldn’t happen, as the script should be looking for the old object value.
I also tried to simple reassign the scripts, to see if that would work. For example, I reassigned Unit B’s script to Unit C, as every time Unit B had tried to teleport, unit C would move instead. The result was that when Unit C tried to teleport, Unit E moved instead. To simplify it:
Original Script:
Unit B Casts = Unit C Moves
Unit C Casts = Unit D Moves
After Reassigning B’s Script to C:
Unit C Casts = Unit E moves (It moves up one unit alphabetically in the script list, briefly explained below)
It truly makes no sense to me.
Perhaps it has something to do with how I duplicated the scripts and attacks? I simply duplicated the original script one line at a time, distinguishing the scripts apart by lettering them alphabetically. So in the script it is listed as:
Script A
Script B
Script C
Etc.
Could the duplications somehow cause the scripts to somehow become linked? There are NO links assigned by me between them. I’m thinking maybe some sort of scripting bug I don’t know about.
The first two units I got up and working still function perfectly. It is only the mass duplication group that behaves oddly.
If anyone has any ideas, or a good teleportation script that they would care to share, I would appreciate it.
Scripting Problem With Teleportation
Right, sorry, thought that might cause some confusion. Here is the script. All monsters use a duplicate of this script. That would tally 13 of the below scripts, all assigned to a unique unit. All 13 units have their own object value. If they didn't, all units would teleport if one unit teleported.
--- Teleportation Script ---
Name: Teleport #
Type: None
• monster-identifier subj (mark 1 monster to transport)
-------------------------------•
Name: Teleport Marker Location - dest #
Type: None
Name: Any Teleportation Markers on Map?
Type: Geometry Filter
Flags: Initial Active
Expiration Mode: Never
Trigger Time: 1.00 - 1.00
• Entire Map
• Object Type
- Value: krtm
• Results Action Identifier
- Action: Teleport Marker Location - dest #
• Tested Items Inside Locations Field Name
- Value: dest
• Activate on Success
- Action: Kyr Teleports Out #
Name: Kyr Teleports Out #
Type: Unit Control
Expiration: on trigger
Trigger Time: 0.00 - 0.00
Flags: Initial Active
• Link
- Action: Teleport # (Corresponding Monster)
• Use Monster Entrance Flag
• Invisible Flag
• Activates On Execution
- Action: Move Kyr to Teleport Marker #
Name: Move Kyr to Teleport Marker #
Type: Move Marker
Expiration: on trigger
Trigger Time: 0.00 - 0.00
Flags: No Initial Delay
• Link
- Action: Teleport # (Corresponding Monster)
- Action: Teleport Marker Location - dest #
• Activate On Execution
- Action: Kyr Teleports In #
Name: Kyr Teleports In #
Type: Unit Control
Execution: on trigger
Trigger Time: 5.00 - 5.00
• Link
- Action: Teleport # (Corresponding Monster)
• Use Monster Entrance Flag
• Visible Flag
--- Teleportation Script ---
Name: Teleport #
Type: None
• monster-identifier subj (mark 1 monster to transport)
-------------------------------•
Name: Teleport Marker Location - dest #
Type: None
Name: Any Teleportation Markers on Map?
Type: Geometry Filter
Flags: Initial Active
Expiration Mode: Never
Trigger Time: 1.00 - 1.00
• Entire Map
• Object Type
- Value: krtm
• Results Action Identifier
- Action: Teleport Marker Location - dest #
• Tested Items Inside Locations Field Name
- Value: dest
• Activate on Success
- Action: Kyr Teleports Out #
Name: Kyr Teleports Out #
Type: Unit Control
Expiration: on trigger
Trigger Time: 0.00 - 0.00
Flags: Initial Active
• Link
- Action: Teleport # (Corresponding Monster)
• Use Monster Entrance Flag
• Invisible Flag
• Activates On Execution
- Action: Move Kyr to Teleport Marker #
Name: Move Kyr to Teleport Marker #
Type: Move Marker
Expiration: on trigger
Trigger Time: 0.00 - 0.00
Flags: No Initial Delay
• Link
- Action: Teleport # (Corresponding Monster)
- Action: Teleport Marker Location - dest #
• Activate On Execution
- Action: Kyr Teleports In #
Name: Kyr Teleports In #
Type: Unit Control
Execution: on trigger
Trigger Time: 5.00 - 5.00
• Link
- Action: Teleport # (Corresponding Monster)
• Use Monster Entrance Flag
• Visible Flag
Well, I got everything working. Doesn't make sense to me, but I got it working.
In the script it looks for an object tag to move to, that the unit casts. I also had to make it so that the 4 letter tag for the projectile matched the 4 letter tag for the object. It works now, but leaves me wondering isn't it supposed to only scan for the object tag? Why must the projectile tag, which uses the object tag, have the same 4 letter tag?
Plenty more to do, but at least I'm past that hurdle. I look forward to getting this plug up and running. Not too excited about trying to balance units.
In the script it looks for an object tag to move to, that the unit casts. I also had to make it so that the 4 letter tag for the projectile matched the 4 letter tag for the object. It works now, but leaves me wondering isn't it supposed to only scan for the object tag? Why must the projectile tag, which uses the object tag, have the same 4 letter tag?
Plenty more to do, but at least I'm past that hurdle. I look forward to getting this plug up and running. Not too excited about trying to balance units.