Hi all,
I am attempting to create a Portal Gun item for my single player adventure map. The idea of the item is pretty much the same as the portal gun in Portal game series: User can point to a location, create a portal which connects to previously created portal like a Waygate. Only 2 portals ever exist at the same time, old one gets removed as new one is created. Not too complicated, eh?
Well, I have been struggling with really perplexing bugs with the trigger system and now I have to resort to asking you guys for help. If some puzzle-loving, good-hearted soul is interested, I’d appreciate any help. I've heavily commented on my triggers so it would be easier for you people to help me troubleshoot this.
Be warned, this is a long post. I’ve tried multiple things to fix my own issues, and I go through my thoughts to help you read my GUI code.
Basically I have a couple of variables for referencing the locations of the two portals. These locations get updated as the portals are moved: the new portal is set up at the point referenced by the variable. Later on as units attempt to move through the portals, the location variables are used to compare distances and to actually teleport the units. The main issue with this is that both of the variables seemingly reference MULTIPLE locations, even though I thought that would be impossible. The portals get created with no issues, and my debug messages confirm that the variable was changed. However, as I use another debug trigger to ping the map to show the location of the points, they are elsewhere, even though no trigger should have changed them or reset them (I’d say they are at map centre, but I have not confirmed this). The teleportation system also does not work.
If I don’t use the variables and instead just reference points via the GUI function “Location of unit”, the system just works. But then the code leaks point references and takes a lot more processing power. Is this even an issue in a single player map?
The test map also has started to crash occasionally as I attempt to use the portal gun to create a new portal, but I have no idea why. To me it seems that I have no infinite loops, and I should be far away still from any memory limits. Could the crashes maybe be related to using the test map feature of the map editor? That’d be easy to solve at least...
Here are the triggers. I’m using version 1.30 so I can still create and play custom campaigns. This is something I can not easily give up with my map, as the design involves moving from map to map…
This one just enables the entire system:
When the item is acquired:
This trigger is one of the most troublesome ones. I manage to make it work if I DON'T use variables to reference points (PG_Portal1Location and PG_Portal2Location) and instead just call "Position of unit Shimmering portal 0011/0012" every time. Debug messages confirm that the if-else structure functions correctly, and that the location variables DO MOVE around. However when I fire my debug trigger (found below later), it pings totally different locations.
I think I could make this entire trigger shorter and nicer looking, but first I'd just love to see it work at all, even though this approach is not the most efficient.
In the end I resorted to using two preplaced portals, which I hide before they get used and then just move those two around and play some animations. This did work as long as I did not use point variables, but referencing unit location repeatedly is inefficient and leaks points. There's also the issue of crashing due to unknown reasons.
The system works by adding any units that are ordered to move to either portal to a unit group, which is then a condition for teleport in the two later triggers where a unit gets close to a portal. This way a unit can hang around the portal or move close to the portal and not get teleported (like Waygates work). Units only get teleported if the player commands them to move through the portal. The triggers repeat the move order with a slight offset, as just asking a unit to follow the portal would not move it close enough.
I currently use multiple triggers instead of one for easier troubleshoot, even though currently I have to repeat a lot of myself in the code.
I could make the portal system more beautiful by adding effects/sounds and tweaking animation times etc. but honestly I think I should at least make it work first...
As you hopefully can see, I've tried multiple different approaches, and none of them gives me the behaviour I want, is stable AND does not leak. I'm open to any suggestions, although I must warn you that I need handholding with JASS. I only know GUI and Google-fu...
Map posted below, there are some test spells there too. But the problem can't be that I'm approaching the "script limit" or whatever-one-calls-that, can it?
I'm a very inexperienced scripter, and even though I could just leave the custom spells from my map, this Portal Gun item is integral to the design and I need it to work. I'll gladly answer any questions.
If someone actually wants to use my scripts, feel free. If you can get them to work...
I am attempting to create a Portal Gun item for my single player adventure map. The idea of the item is pretty much the same as the portal gun in Portal game series: User can point to a location, create a portal which connects to previously created portal like a Waygate. Only 2 portals ever exist at the same time, old one gets removed as new one is created. Not too complicated, eh?
Well, I have been struggling with really perplexing bugs with the trigger system and now I have to resort to asking you guys for help. If some puzzle-loving, good-hearted soul is interested, I’d appreciate any help. I've heavily commented on my triggers so it would be easier for you people to help me troubleshoot this.
Be warned, this is a long post. I’ve tried multiple things to fix my own issues, and I go through my thoughts to help you read my GUI code.
Basically I have a couple of variables for referencing the locations of the two portals. These locations get updated as the portals are moved: the new portal is set up at the point referenced by the variable. Later on as units attempt to move through the portals, the location variables are used to compare distances and to actually teleport the units. The main issue with this is that both of the variables seemingly reference MULTIPLE locations, even though I thought that would be impossible. The portals get created with no issues, and my debug messages confirm that the variable was changed. However, as I use another debug trigger to ping the map to show the location of the points, they are elsewhere, even though no trigger should have changed them or reset them (I’d say they are at map centre, but I have not confirmed this). The teleportation system also does not work.
If I don’t use the variables and instead just reference points via the GUI function “Location of unit”, the system just works. But then the code leaks point references and takes a lot more processing power. Is this even an issue in a single player map?
The test map also has started to crash occasionally as I attempt to use the portal gun to create a new portal, but I have no idea why. To me it seems that I have no infinite loops, and I should be far away still from any memory limits. Could the crashes maybe be related to using the test map feature of the map editor? That’d be easy to solve at least...
Here are the triggers. I’m using version 1.30 so I can still create and play custom campaigns. This is something I can not easily give up with my map, as the design involves moving from map to map…
This one just enables the entire system:
-
PG Init
-
Events
-
Conditions
-
Actions
-
-------- game has a tendency to crash sometimes if portal gun triggers are in game. --------
-
-------- I don't know the reason for crashes, as to me there seems to be no significant leaks or infinite loops --------
-
-------- Crashes are seemingly random, I've been unable to replicate them. The game just works sometimes, sometimes it doesn't --------
-
-------- Setup variables, hide unusable portals --------
-
-------- portals need to be preplaced, GUI allows only "entering range" event for preplaced units --------
-
Set PG_Portal1 = Shimmering Portal 0011 <gen>
-
Set PG_Portal2 = Shimmering Portal 0012 <gen>
-
Set PG_Portal1Location = (Position of PG_Portal1)
-
Set PG_Portal2Location = (Position of PG_Portal2)
-
-------- Ownership change for security, no visibility or aggro etc. relating to portals --------
-
Unit - Change ownership of PG_Portal1 to Neutral Passive and Change color
-
Unit - Change ownership of PG_Portal2 to Neutral Passive and Change color
-
Unit - Hide PG_Portal1
-
Unit - Hide PG_Portal2
-
-
When the item is acquired:
-
PG Setup User
-
Events
-
Unit - A unit Acquires an item
-
-
Conditions
-
(Item-type of (Item being manipulated)) Equal to Portal Gun
-
-
Actions
-
-------- As a new unit acquires the PG item, set that unit as the user. PG user unit location is used for setting portal facings --------
-
Set PG_User = (Triggering unit)
-
-------- Only units belonging to the same player as the user can move through the portals. This may be changed here --------
-
Set PG_OwnerOfUser = (Owner of PG_User)
-
-------- Allow creation of portals only after a user has been set up --------
-
Trigger - Turn on PG New Portal <gen>
-
-
This trigger is one of the most troublesome ones. I manage to make it work if I DON'T use variables to reference points (PG_Portal1Location and PG_Portal2Location) and instead just call "Position of unit Shimmering portal 0011/0012" every time. Debug messages confirm that the if-else structure functions correctly, and that the location variables DO MOVE around. However when I fire my debug trigger (found below later), it pings totally different locations.
I think I could make this entire trigger shorter and nicer looking, but first I'd just love to see it work at all, even though this approach is not the most efficient.
-
PG New Portal
-
Events
-
Unit - A unit Begins construction
-
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Shimmering Portal (dummy)
-
-
Actions
-
-------- Record required points as temp values --------
-
Set Temp_location = (Position of (Constructing structure))
-
Set Temp_location2 = (Position of PG_User)
-
-------- remove dummy --------
-
Unit - Remove (Triggering unit) from the game
-
-------- Moving portals is currently a long, semi-repeating if-then-else limbo, as I am a shit coder. It works with references to preplaced unit locations, but not with point variables --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
PG_NumOfPortals Equal to 0
-
-
Then - Actions
-
-------- If portal number is 0, create first portal --------
-
-------- Update portal location, item user location, portal angle and portal number --------
-
Set PG_Portal1Location = Temp_location
-
Set PG_NumOfPortals = 1
-
Set PG_LastCreated = 1
-
Set PG_Portal1Angle = (Angle from PG_Portal1Location to Temp_location2)
-
-------- Debug Messages --------
-
Game - Display to (All players) the text: 1
-
Game - Display to (All players) the text: (Portal1Location: + ((String((X of PG_Portal1Location))) + (String((Y of PG_Portal1Location)))))
-
Game - Display to (All players) the text: (PG_NumOfPortals: + (String(PG_NumOfPortals)))
-
Game - Display to (All players) the text: (PG_LastCreated: + (String(PG_LastCreated)))
-
-------- Place teleport to specified location and unhide --------
-
Unit - Move PG_Portal1 instantly to PG_Portal1Location
-
Unit - Make PG_Portal1 face PG_Portal1Angle over 0.00 seconds
-
Unit - Unhide PG_Portal1
-
-------- Play a snappy portal birth animation --------
-
Animation - Change PG_Portal1's animation speed to 300.00% of its original speed
-
Animation - Play PG_Portal1's birth animation
-
-------- Prepare reset to regular stand animation, needs accurate timer --------
-
Animation - Queue PG_Portal1's stand animation
-
Countdown Timer - Start PG_animationTimer1 as a One-shot timer that will expire in 3.00 seconds
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
PG_NumOfPortals Equal to 1
-
-
Then - Actions
-
-------- If portal number is 1, create second portal --------
-
-------- Update portal location, item user location, portal angle and portal number --------
-
Set PG_Portal2Location = Temp_location
-
Set PG_NumOfPortals = 2
-
Set PG_LastCreated = 2
-
Set PG_Portal2Angle = (Angle from PG_Portal2Location to Temp_location2)
-
-------- Debug Messages --------
-
Game - Display to (All players) the text: 2
-
Game - Display to (All players) the text: (Portal2Location: + ((String((X of PG_Portal2Location))) + (String((Y of PG_Portal2Location)))))
-
Game - Display to (All players) the text: (PG_NumOfPortals: + (String(PG_NumOfPortals)))
-
Game - Display to (All players) the text: (PG_LastCreated: + (String(PG_LastCreated)))
-
-------- Place teleport to specified location and unhide --------
-
Unit - Move PG_Portal2 instantly to PG_Portal2Location
-
Unit - Make PG_Portal2 face PG_Portal2Angle over 0.00 seconds
-
Unit - Unhide PG_Portal2
-
-------- Play a snappy portal birth animation --------
-
Animation - Change PG_Portal2's animation speed to 300.00% of its original speed
-
Animation - Play PG_Portal2's birth animation
-
-------- Prepare reset to regular stand animation, needs accurate timer --------
-
Animation - Queue PG_Portal2's stand animation
-
Countdown Timer - Start PG_animationTimer2 as a One-shot timer that will expire in 3.00 seconds
-
-------- There are now two portals, turn on teleportation system --------
-
Trigger - Turn on PG Unit wants to teleport from 1 to 2 <gen>
-
Trigger - Turn on PG Unit wants to teleport from 2 to 1 <gen>
-
Trigger - Turn on PG Unit no longer wants to teleport <gen>
-
Trigger - Turn on PG Move Units from 1 to 2 <gen>
-
Trigger - Turn on PG Move Units from 2 to 1 <gen>
-
-------- Debug Messages --------
-
Game - Display to (All players) the text: teleportation trigg...
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
PG_LastCreated Equal to 2
-
-
Then - Actions
-
-------- If portal number is not 0 or 1 and portal2 was the previous portal, move portal 1 --------
-
-------- Update portal 1 location, item user location, portal 1 angle and portal number --------
-
Set PG_Portal1Location = Temp_location
-
Set PG_NumOfPortals = 2
-
Set PG_LastCreated = 1
-
Set PG_Portal1Angle = (Angle from PG_Portal1Location to Temp_location2)
-
-------- Debug Messages --------
-
Game - Display to (All players) the text: 3
-
Game - Display to (All players) the text: (Portal1Location: + ((String((X of PG_Portal1Location))) + (String((Y of PG_Portal1Location)))))
-
Game - Display to (All players) the text: (PG_NumOfPortals: + (String(PG_NumOfPortals)))
-
Game - Display to (All players) the text: (PG_LastCreated: + (String(PG_LastCreated)))
-
-------- Place teleport to specified location --------
-
Unit - Move PG_Portal1 instantly to PG_Portal1Location
-
Unit - Make PG_Portal1 face PG_Portal1Angle over 0.00 seconds
-
-------- Play a snappy portal birth animation --------
-
Animation - Change PG_Portal1's animation speed to 300.00% of its original speed
-
Animation - Play PG_Portal1's birth animation
-
-------- Prepare reset to regular stand animation, needs accurate timer --------
-
Animation - Queue PG_Portal1's stand animation
-
Countdown Timer - Start PG_animationTimer1 as a One-shot timer that will expire in 3.00 seconds
-
-
Else - Actions
-
-------- If portal number is not 0 or 1 and portal1 was the previous portal, move portal 2 --------
-
-------- Update portal 2 location, item user location, portal 2 angle and portal number --------
-
Set PG_Portal2Location = Temp_location
-
Set PG_NumOfPortals = 2
-
Set PG_LastCreated = 2
-
Set PG_Portal2Angle = (Angle from PG_Portal2Location to Temp_location2)
-
-------- Place teleport to specified location --------
-
Unit - Move PG_Portal2 instantly to PG_Portal2Location
-
Unit - Make PG_Portal2 face PG_Portal2Angle over 0.00 seconds
-
-------- Debug Messages --------
-
Game - Display to (All players) the text: 4
-
Game - Display to (All players) the text: (Portal2Location: + ((String((X of PG_Portal2Location))) + (String((Y of PG_Portal2Location)))))
-
Game - Display to (All players) the text: (PG_NumOfPortals: + (String(PG_NumOfPortals)))
-
Game - Display to (All players) the text: (PG_LastCreated: + (String(PG_LastCreated)))
-
-------- Play a snappy portal birth animation --------
-
Animation - Change PG_Portal2's animation speed to 300.00% of its original speed
-
Animation - Play PG_Portal2's birth animation
-
-------- Prepare reset to regular stand animation, needs accurate timer --------
-
Animation - Queue PG_Portal2's stand animation
-
Countdown Timer - Start PG_animationTimer2 as a One-shot timer that will expire in 3.00 seconds
-
-
-
-
-
-
-
Custom script: call RemoveLocation(udg_Temp_location)
-
Custom script: call RemoveLocation(udg_Temp_location2)
-
-
In the end I resorted to using two preplaced portals, which I hide before they get used and then just move those two around and play some animations. This did work as long as I did not use point variables, but referencing unit location repeatedly is inefficient and leaks points. There's also the issue of crashing due to unknown reasons.
The system works by adding any units that are ordered to move to either portal to a unit group, which is then a condition for teleport in the two later triggers where a unit gets close to a portal. This way a unit can hang around the portal or move close to the portal and not get teleported (like Waygates work). Units only get teleported if the player commands them to move through the portal. The triggers repeat the move order with a slight offset, as just asking a unit to follow the portal would not move it close enough.
I currently use multiple triggers instead of one for easier troubleshoot, even though currently I have to repeat a lot of myself in the code.
-
PG Unit wants to teleport from 1 to 2
-
Events
-
Unit - A unit Is issued an order targeting an object
-
-
Conditions
-
(Target unit of issued order) Equal to PG_Portal1
-
-
Actions
-
-------- "PG unit wants to teleport" 1 and 2 are two separate ones. I had previously only one trigger with both portals as references for the trigger event, but the teleportation system did not work. --------
-
-------- Set up the variable referencing the ordered unit. Triggering unit does not work here for some reason. --------
-
Set PG_OrderedToPortal = (Ordered unit)
-
-------- Debug messages --------
-
Game - Display to (All players) the text: (PG_OrderedToPortal: + (Name of PG_OrderedToPortal))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of PG_OrderedToPortal) Equal to PG_OwnerOfUser
-
-
Then - Actions
-
-------- First, the ownership of unit is confirmed, although the portals should be safe from random AI targeting as they belong to Neutral Passive (see init trigger) --------
-
-------- Then check if the ordered unit is already within the transportation range of the clicked teleport. --------
-
-------- Should use temp_location and portal location variables for comparison, as other location references leak --------
-
-------- the teleportation is bugged if the preplaced unit location is not referenced via the function "Position of unit". Variable does not work for some reason --------
-
Set Temp_location = (Position of PG_OrderedToPortal)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between Temp_location and PG_Portal1Location) Less than or equal to 100.00
-
-
Then - Actions
-
-------- Move unit instantly if already close to portal. this should be the same as in triggers "PG Move Units" --------
-
Unit - Move PG_OrderedToPortal instantly to PG_Portal2Location
-
Custom script: call RemoveLocation(udg_Temp_location)
-
-
Else - Actions
-
-------- If unit is not in range, order to move within teleport range, add to units wanting to teleport --------
-
Custom script: call RemoveLocation(udg_Temp_location)
-
-------- PG_UnitsToPortal1 is for units ordered to move to portal 1 (to teleport to portal 2), and vice versa --------
-
Unit Group - Add PG_OrderedToPortal to PG_UnitsToPortal1
-
Trigger - Turn off PG Unit no longer wants to teleport <gen>
-
Unit - Order PG_OrderedToPortal to Move To (PG_Portal1Location offset by 1.00 towards 0.00 degrees)
-
Trigger - Turn on PG Unit no longer wants to teleport <gen>
-
-
-
-
Else - Actions
-
-
-
-
PG Unit wants to teleport from 2 to 1
-
Events
-
Unit - A unit Is issued an order targeting an object
-
-
Conditions
-
(Target unit of issued order) Equal to PG_Portal2
-
-
Actions
-
-------- These triggers are two separate ones. I had previously only one trigger with both portals as references for the trigger event, but the teleportation system did not work. --------
-
-------- Set up the variable referencing the ordered unit. Triggering unit does not work here for some reason. --------
-
Set PG_OrderedToPortal = (Ordered unit)
-
Game - Display to (All players) the text: (PG_OrderedToPortal: + (Name of PG_OrderedToPortal))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of PG_OrderedToPortal) Equal to PG_OwnerOfUser
-
-
Then - Actions
-
-------- First, the ownership of unit is confirmed, although the portals should be safe from random AI targeting as they belong to Neutral Passive (see init trigger) --------
-
-------- Then check if the ordered unit is already within the transportation range of the clicked teleport. --------
-
-------- Should use temp_location and portal location variables for comparison, as other location references leak --------
-
-------- the teleportation is bugged if the preplaced unit location is not referenced via the function "Position of unit". Variable does not work for some reason --------
-
Set Temp_location = (Position of PG_OrderedToPortal)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between Temp_location and PG_Portal2Location) Less than or equal to 100.00
-
-
Then - Actions
-
-------- Move unit instantly if already close to portal. this should be the same as in triggers "PG Move Units" --------
-
Unit - Move PG_OrderedToPortal instantly to PG_Portal1Location
-
Custom script: call RemoveLocation(udg_Temp_location)
-
-
Else - Actions
-
-------- If unit is not in range, order to move within teleport range, add to units wanting to teleport --------
-
Custom script: call RemoveLocation(udg_Temp_location)
-
-------- PG_UnitsToPortal1 is for units ordered to move to portal 1 (to teleport to portal 2), and vice versa --------
-
Unit Group - Add PG_OrderedToPortal to PG_UnitsToPortal2
-
Trigger - Turn off PG Unit no longer wants to teleport <gen>
-
Unit - Order PG_OrderedToPortal to Move To (PG_Portal2Location offset by (1.00, 0.00))
-
Trigger - Turn on PG Unit no longer wants to teleport <gen>
-
-
-
-
Else - Actions
-
-
-
-
PG Unit no longer wants to teleport
-
Events
-
Unit - A unit Is issued an order targeting an object
-
Unit - A unit Is issued an order targeting a point
-
Unit - A unit Is issued an order with no target
-
-
Conditions
-
((((Triggering unit) is in PG_UnitsToPortal1) Equal to True) and ((Target unit of issued order) Not equal to PG_Portal1)) or ((((Triggering unit) is in PG_UnitsToPortal2) Equal to True) and ((Target unit of issued order) Not equal to PG_Portal2))
-
-
Actions
-
-------- If unit in wanting to teleport from 1 to 2 is ordered to somewhere else than portal 1, remove said unit from group --------
-
-------- If unit in wanting to teleport from 2 to 1 is ordered to somewhere else than portal 2, remove said unit from group --------
-
-------- Setting up variable only for leak prevention, if a point is referenced in the event of this trigger --------
-
Set Temp_location = (Target point of issued order)
-
Custom script: call RemoveLocation(udg_Temp_location)
-
-------- PG_UnitsToPortal1 is for units ordered to move to portal 1 (to teleport to portal 2), and vice versa --------
-
Unit Group - Remove (Triggering unit) from PG_UnitsToPortal1
-
Unit Group - Remove (Triggering unit) from PG_UnitsToPortal2
-
Game - Display to (All players) the text: (No longer wants to teleport: + (Name of (Triggering unit)))
-
-
I could make the portal system more beautiful by adding effects/sounds and tweaking animation times etc. but honestly I think I should at least make it work first...
-
PG Animation Reset 1
-
Events
-
Time - PG_animationTimer1 expires
-
-
Conditions
-
Actions
-
Animation - Change PG_Portal1's animation speed to 100.00% of its original speed
-
-
-
PG Animation Reset 2
-
Events
-
Time - PG_animationTimer2 expires
-
-
Conditions
-
Actions
-
Animation - Change PG_Portal2's animation speed to 100.00% of its original speed
-
-
-
PG Move Units from 1 to 2
-
Events
-
Unit - A unit comes within 100.00 of Shimmering Portal 0011 <gen>
-
-
Conditions
-
((Triggering unit) is in PG_UnitsToPortal1) Equal to True
-
-
Actions
-
-------- As unit ordered to the portal gets close enough to said portal, teleport unit --------
-
-------- Units that just move close to portal won't get moved --------
-
Unit - Move (Triggering unit) instantly to PG_Portal2Location
-
Wait 0.00 seconds
-
-------- To make unit just stop at the other portal, order it to move just a bit forward --------
-
Unit - Order (Triggering unit) to Move To (PG_Portal2Location offset by 200.00 towards PG_Portal2Angle degrees)
-
-------- This last action does not work at all for some reason. --------
-
-------- Even if teleportation works (with references to "location of unit" instead of "PG_PortalXLocation" variable), units get ordered behind the portal or to the other portal. --------
-
-------- The PG portal angle and portal location variables break the entire portal system for some unknown reason --------
-
-
-
PG Move Units from 2 to 1
-
Events
-
Unit - A unit comes within 100.00 of Shimmering Portal 0012 <gen>
-
-
Conditions
-
((Triggering unit) is in PG_UnitsToPortal2) Equal to True
-
-
Actions
-
-------- As unit ordered to the portal gets close enough to said portal, teleport unit --------
-
-------- Units that just move close to portal won't get moved --------
-
Unit - Move (Triggering unit) instantly to PG_Portal1Location
-
Wait 0.00 seconds
-
-------- To make unit just stop at the other portal, order it to move just a bit forward --------
-
Unit - Order (Triggering unit) to Move To (PG_Portal1Location offset by 200.00 towards PG_Portal1Angle degrees)
-
-------- This last action does not work at all for some reason. --------
-
-------- Even if teleportation works (with references to "location of unit" instead of "PG_PortalXLocation" variable), units get ordered behind the portal or to the other portal. --------
-
-------- The PG portal angle and portal location variables break the entire portal system for some unknown reason --------
-
-
-
spell out variables
-
Events
-
Player - Player 1 (Red) types a chat message containing pg variables as An exact match
-
-
Conditions
-
Actions
-
Cinematic - Ping minimap for (All players) at PG_Portal1Location for 5.00 seconds
-
Cinematic - Ping minimap for (All players) at PG_Portal2Location for 5.00 seconds
-
Game - Display to (All players) the text: (PG_User: + (Name of PG_User))
-
Game - Display to (All players) the text: (PG_NumOfPortals: + (String(PG_NumOfPortals)))
-
-
As you hopefully can see, I've tried multiple different approaches, and none of them gives me the behaviour I want, is stable AND does not leak. I'm open to any suggestions, although I must warn you that I need handholding with JASS. I only know GUI and Google-fu...
Map posted below, there are some test spells there too. But the problem can't be that I'm approaching the "script limit" or whatever-one-calls-that, can it?
I'm a very inexperienced scripter, and even though I could just leave the custom spells from my map, this Portal Gun item is integral to the design and I need it to work. I'll gladly answer any questions.
If someone actually wants to use my scripts, feel free. If you can get them to work...