Scripting Problem With Teleportation
Posted: Sun Feb 11, 2007 5:50 am
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.
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.