[These are the triggers that set the boolean variable "Shooting" to true/false by clicking LMB.]
Start Shooting
Events
UI - Player 1 clicks Left mouse button Down.
Local Variables
Conditions
And
Conditions
(PlayerUnit is alive) == True
Actions
Variable - Set Shooting = True
Stop Shooting
Events
UI - Player 1 clicks Left mouse button Up.
Local Variables
Conditions
And
Conditions
(PlayerUnit is alive) == True
Actions
Variable - Set Shooting = False
So these ones I made myself, they were not in there before. Next is the original trigger, which I tweaked a little. I removed the cooldown triggers (don't see how that could mess up anything) and I added a generic timer instead of just having a Mouse click event. Also I made it check if the Shooting variable is true.
Shoot
Events
Timer - Every 0.01 seconds of Game Time
Local Variables
Player = (Triggering player) <Integer>
Conditions
And
Conditions
(PlayerUnit is alive) == True
Shooting == True
CurAmmo > 0
W == False
A == False
S == False
D == False
Actions
- Fire a projectile if you have ammunition available
Variable - Modify CurAmmo: - 1
UI - Set boss bar 2 current value to CurAmmo (Do refresh the boss bar)
- Reload
General - If (Conditions) then do (Actions) else do (Actions)
If
CurAmmo == 0
Then
Variable - Set Reloading = True
Trigger - Run Reload (Ignore Conditions, Don't Wait until it finishes)
Else
- Shoot projectile
Animation - Play Attack animation for (Actor for PlayerUnit) as Default, using No Options options and Default Time blend time
Traceline(Player)
- Check if a unit was hit
General - If (Conditions) then do (Actions) else do (Actions)
If
TargetUnit != No Unit
Then
Environment - Execute Marine - Guass Rifle (Damage) on TargetUnit from PlayerUnit
Unit - Order TargetUnit to ( Attack targeting PlayerUnit) (Replace Existing Orders)
Else
- If above is false, shoot terrain
General - If (Conditions) then do (Actions) else do (Actions)
If
TargetPoint != No Point
Then
Environment - Execute Marine - Guass Rifle (Damage) at TargetPoint from PlayerUnit
Else
Sound - Play Immortal_AttackLaunch for (All players) (at 50.0% volume, skip the first 0.0 seconds)
And that's about it, there might be more things you need for me to post but the other things are only the traceline and reload things and stuff, which I haven't touched.
Thanks again in advance for any help
Edit: Ew dunno why the trigger text came out that ugly :(
Edit: could it be that this problem has to do with the Traceline not updating or something like that?
Edit#2: Might be worth to mention that as soon as I change the event of the Shoot trigger to Left Mouse button click Down everything works fine, except for the fact that it only shoots once when I want it to continue firing until I click LMB up.
These are the two, atm it's working since the type of shooting isn't automatic (I want it to be automatic), whenever I change the event to a Periodic Timer and check for LMB pressed down everything stops working.
I think the issue is that for periodic events there is no triggering player (obviously ;) ). The function "Triggering Player" will then return something like 0 (or, even worse, something negative). So your local variable "Player" won't have a valid value and "Traceline(Player)" doesn't work. To fix this, just set "Player" to 1 or use a loop.
By the way, I am currently working on the TPS and RPG engine Orion, which is a Mod and provides you with many useful functions and mechanics. As the mod is still in progress, I have not yet created an English presentation (just a German one), but if you are interested in this, just take a look at the map "Orion Sample" or write me a PM.
I think the issue is that for periodic events there is no triggering player (obviously ;) ). The function "Triggering Player" will then return something like 0 (or, even worse, something negative). So your local variable "Player" won't have a valid value and "Traceline(Player)" doesn't work. To fix this, just set "Player" to 1 or use a loop.
By the way, I am currently working on the TPS and RPG engine Orion, which is a Mod and provides you with many useful functions and mechanics. As the mod is still in progress, I have not yet created an English presentation (just a German one), but if you are interested in this, just take a look at the map "Orion Sample" or write me a PM.
Hope I could help,
Sanktoras
Omg man it worked perfectly! And such a little change I had to do aswell! A hundred thanks man, such a relief to be without that problem. I'll be sure to check out your map! Cheers
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Could you post the related source-code right here?
Just select all lines of your trigger, right-click and chose "copy as text".
Thanks for the reply.
[These are the triggers that set the boolean variable "Shooting" to true/false by clicking LMB.] Start Shooting Events UI - Player 1 clicks Left mouse button Down. Local Variables Conditions And Conditions (PlayerUnit is alive) == True Actions Variable - Set Shooting = True
Stop Shooting Events UI - Player 1 clicks Left mouse button Up. Local Variables Conditions And Conditions (PlayerUnit is alive) == True Actions Variable - Set Shooting = False
So these ones I made myself, they were not in there before. Next is the original trigger, which I tweaked a little. I removed the cooldown triggers (don't see how that could mess up anything) and I added a generic timer instead of just having a Mouse click event. Also I made it check if the Shooting variable is true.
Shoot Events Timer - Every 0.01 seconds of Game Time Local Variables Player = (Triggering player) <Integer> Conditions And Conditions (PlayerUnit is alive) == True Shooting == True CurAmmo > 0 W == False A == False S == False D == False Actions
-Fire a projectile if you have ammunition available Variable - Modify CurAmmo: - 1 UI - Set boss bar 2 current value to CurAmmo (Do refresh the boss bar)-Reload General - If (Conditions) then do (Actions) else do (Actions) If CurAmmo == 0 Then Variable - Set Reloading = True Trigger - Run Reload (Ignore Conditions, Don't Wait until it finishes) Else-Shoot projectile Animation - Play Attack animation for (Actor for PlayerUnit) as Default, using No Options options and Default Time blend time Traceline(Player)-Check if a unit was hit General - If (Conditions) then do (Actions) else do (Actions) If TargetUnit != No Unit Then Environment - Execute Marine - Guass Rifle (Damage) on TargetUnit from PlayerUnit Unit - Order TargetUnit to ( Attack targeting PlayerUnit) (Replace Existing Orders) Else-If above is false, shoot terrain General - If (Conditions) then do (Actions) else do (Actions) If TargetPoint != No Point Then Environment - Execute Marine - Guass Rifle (Damage) at TargetPoint from PlayerUnit Else Sound - Play Immortal_AttackLaunch for (All players) (at 50.0% volume, skip the first 0.0 seconds)And that's about it, there might be more things you need for me to post but the other things are only the traceline and reload things and stuff, which I haven't touched. Thanks again in advance for any help
Edit: Ew dunno why the trigger text came out that ugly :(
Bump
Edit: could it be that this problem has to do with the Traceline not updating or something like that? Edit#2: Might be worth to mention that as soon as I change the event of the Shoot trigger to Left Mouse button click Down everything works fine, except for the fact that it only shoots once when I want it to continue firing until I click LMB up.
bumpity
Would you mind taking screenshots of your triggers? I'm feeling a bit exasperated trying to read that stuff. :)
These are the two, atm it's working since the type of shooting isn't automatic (I want it to be automatic), whenever I change the event to a Periodic Timer and check for LMB pressed down everything stops working.
Hi DeepCover187,
I think the issue is that for periodic events there is no triggering player (obviously ;) ). The function "Triggering Player" will then return something like 0 (or, even worse, something negative). So your local variable "Player" won't have a valid value and "Traceline(Player)" doesn't work. To fix this, just set "Player" to 1 or use a loop.
By the way, I am currently working on the TPS and RPG engine Orion, which is a Mod and provides you with many useful functions and mechanics. As the mod is still in progress, I have not yet created an English presentation (just a German one), but if you are interested in this, just take a look at the map "Orion Sample" or write me a PM.
Hope I could help,
Sanktoras
Omg man it worked perfectly! And such a little change I had to do aswell! A hundred thanks man, such a relief to be without that problem. I'll be sure to check out your map! Cheers