The visibility checking may also be used to check if the player is looking at any point on the map. For example, can make CPU intensive effects only visible when the player is looking at it and not behind.
Interruptions now effect the cast bar
Tiny notification class added to replace the debug message used previously to make any errors clearly visible. Font size, colour, position, family will change to be a little more attractive in future demos.
Edit 2: New solution is prepended to the original post.
Edit: I just realised the solution below won't work since our original problem of the mouse cursor being hidden arises again and the Highlighted Unit variable will be emptied as when the camera is activated, the Highlight Off event is triggered.
Another work around can be added though to check if the same unit is still hovered when the mouse is released, and then select it. But make sure that if you click an empty area then release the mouse while hovering on a unit, that unit isn't selected.
Original Post
You bring up some good points. The reason the deselection action is in there is because without it, any units you click will be appended to the original selection instead of just one unit being selected.
As for the dragging issue, perhaps try utilising the Mouse Up trigger. For example:
Mouse Down
Set Variable - Mouse Down Unit <Unit> = Highlighted Unit.
Mouse Up
If Highlighted Unit = Mouse Down Unit
Then
Select Highlighted Unit
I haven't tested this yet, but it should select the unit when you release the mouse and complete a click action.
Still texturing, still placing doodads, and need to fix the terrain cliffs (thanks Xaragoth ;) )
It's built using the Starcrafter Engine I'm making. Combat system is still being fine tweaked and abilities to add. But hope you can at least enjoy the layout!
I've been playing with your system a bit further and I really enjoy it. I had to change the mover to Cliff Jumper to prevent path finding around walls. Lag online is a tad less than what is seen with most systems too, but unfortunately still a factor for anyone wanting to create any twitch mods.
My question is this, I would really like to implement your system, but is movement as dynamic as seen in the video above possible with it? i.e. The sprinting, the strafing and the rest (using data editor of course)?
There's about a 0.5 - 1 second delay after pressing a movement key on Battle.net. And that's with our shoddy latency here in Australia. It still felt quite playable though.
Offline it's as smooth as any other game you might play. programmer's solution is a very good one, but there's a slight pause between pressing a key and the unit(s) moving offline, otherwise I'd probably incorporate it. You should all check it out though, it's very impressive. But since the main part of Starcrafter will take part offline, I'm happy to continue developing and wait to see if Blizzard ever find a solution for similar game types. :P
If they don't...i'm sure the online entertainment value will outweigh the problem of the lag.
cecilofs' post below made a good point that the unit is deselected whenever you want to look with the camera. I've attached v2 of the solution below. Once "Lock Camera Mouse Relative Mode" is called, the unit is technically no longer highlighted because the cursor is automatically hidden.
The new solution makes use of the original, but now the unit is stored in another variable when the mouse is down. And when the mouse is released (Up), the "Highlight On" trigger will be called if a unit is highlighted. The new version checks that the mouse up highlighted unit is the same one as when the mouse was pressed down and highlights it if so!
Triggers
New Variable
Mouse Down
Setting new variable if highlighted unit exists
Highlight Off
Checks if highlighted unit is the same as the one when the mouse was pressed down
Original Post
Some of you may have played around with camera movement using the mouse. i.e. You click your mouse button and drag to move the camera around a point on the map. But there's one problem when using this technique: You can't click on anything to select it! This is a major problem for those wanting to be able to click as well as move the camera.
Following is a basic tutorial on my solution for this problem which works quite well. It also lets you de-select a unit by clicking on an empty space.
Here we go:
First we'll set up the camera. This will also allow you to see why the workaround is needed.
The Problem
Place your unit on the map. Here I chose an Archon since it's big and shiny.
Now make two triggers called "Mouse Down" and "Mouse Up". These will contain our events for when the mouse button is pressed down or up.
In your "Mouse Down" trigger, set it to look like the following:
"Mouse Up" should look like this, it's basically the opposite of the "Mouse Down" trigger since we just want to turn the camera rotation off.
Test the map! If you left click anywhere on the map and move your mouse you will see that the camera moves. But hang on, why don't you try and select your unit? You can't right? And there's the problem which we can fix with the following solution:
The Solution
The solution makes use of the in-built event that is triggered when you hover your mouse over a unit.
Add 2 new triggers called "Highlight On" and "Highlight Off" and 1 variable called "Highlighted Unit" and make its type a "Unit"
In "Highlight On" set it up to look like this:
"Highlight Off" is a little similar with a few tiny changes:
Head to your "Mouse Down" trigger and just before you turn on all the camera actions add the following: (Note that "deselect all units..." is called "Clear Unit Selection" in the action list.
That should be the last step right? Wrong. Last but not least we have to make the unit highlightable so that our highlight triggers actually work. To do this head into the Data Editor (Units), find your unit and uncheck Cannot Be Highlighted from Unit - Flags. I also unchecked Cannot Be Clicked purely for the sake of logic :P
Now test your map and you can see that you can not only move the camera with your mouse, but you may also click the unit and click off it to deselect! This should be very useful for those of you working on RPG type maps with a movable camera.
Here is a demo of the engine I've been building for Starcrafter [SCR].
It's a little bit jumpy due to the screen casting, but it's completely smooth when actually playing it.
It's a very basic demonstration on my test map of the movement system, running, turning, strafing, moving back, sprinting and moving with the right mouse and camera. Also shows right clicking an enemy to begin auto attacking it. Meaning the unit the player is controlling will attack the enemy while moving and even after moving away and back again.
The first attack the unit begins to move towards the enemy, this is something I must disable. But enjoy the demonstration. There will be more (prettier) ones to come.
I've just solved the problem a minute ago so expect a full tutorial in the coming day or two.
The problem is quite common, when using the mouse to look with the camera when holding the left mouse down the player becomes unable to click or make any selection.
OneTwo had a solution in one of his earlier tutorials, that being to move a small circular region to the point where the mouse was clicked and to pick a random unit from within that region to select and attack.
This was a good work around but only to a point. I wanted the player to actually be choosing the unit or object they want to select so I spent some time researching and fiddling around with certain triggers and digging through the data editor for some way to disable the cursor being hidden. None of this was very fruitful, but a very simple solution came to mind:
Keep in mind a full tutorial with images and steps will be available soon.
To start off you have your mouse looking triggers:
Mouse Down
Mouse Up
In 'Mouse Down' you would find a function to turn Lock Camera Mouse Relative Mode On.
And in 'Mouse Up' you would turn it off again.
To enable clicking (or a workaround) add a global variable called "Highlighted Unit" and then add two triggers:
Unit Highlighted
Event
Unit Selection - (Any Unit) is (Highlighted) by Player (Any Player)
Actions
Set Variable - (Highlighted Unit) = (Triggering Unit)
Unit Unhighlighted
Event
Unit Selection - (Highlighted Unit) is (Unhighlighted) by Player (Any Player)
Actions
Set Variable - (Highlighted Unit) = (No Unit)
Mouse Down
At the top of your mouse down trigger insert:
Unit Selection - Deselect all units for player (Player)
Unit Selection - (Select) (Highlighted Unit) for player (Player)
...Turn camera mouse relative mode on etc....
Data Editor
Now head to the data editor and find the unit you want to click and make sure the "Cannot be Highlighted" flag is disabled.
And that should be it! It also means that if you click on a space that isn't a unit, the previous selected unit will be unhighlighted.
The camera will always stay with the unit you originally set as your player unit. If you ever need to change the unit, just run the SCR_Add Player Unit action with the player number and the new unit.
On the units you want to select, make sure the "unselectable" flag is off.
I haven't tested this online, so I have no idea how much network traffic it causes. The arrays have 16 (15 minus pos 0) keys so I guess it's possible to have 15 players. I recoded it with a goal of making as little changes to movement as possible to save traffic, but a lot of movement functionality had to be sacrificed. I went with functionality at the moment until I get to testing it online.
EDIT:
Just tried it online and it suffers as any WASD movement suffers. i.e. won't trigger the move until 0.5-1 second past the actual key press. It still feels playable though, but only as an RPG.
Version 0.2 released. Comes in SC2Mod format, only one trigger required to initiate the entire system on any unit you want. System was recoded from scratch to make better use of in-built editor features.
I've been working on totally redoing the system to make better use of built in behaviours and animations. And to prevent using the 'Move Instantly To' functions to save network traffic.
The scroll wheel will be fixed in the new version :)
To make changes to the tooltip follow these steps:
Open your data editor (F7)
Actors
Change Data Type to "Actors".
Find the unit you want to edit the tooltip for.
Take note of what's written in the Unit Name field at the top, as we'll use this to find the respective unit.
Find UI - Highlight Tooltip and double click on it.
Change the Text Key field to something new. I like to use "Unit / <Unit Name> / Tooltip".
Write your new tooltip in the text box.
Click OK
Units
Change Data Type to "Units"
Find the unit that you saw in the Unit Name field of the actor.
Edit the Unit - Unit Flags
Uncheck the flag No Tooltip
Click OK
Place the unit on to your map and click Test Document
Now you can hover your mouse over the unit and see your new tooltip!
Data Screen
Actors
UI - Highlight Tooltip
Units
Unit - Unit Flags
In Game
Applying Styles
You can also apply styles to your tooltip like font style, font size, font colour and position. You can find a list of all styles and what they look like at the wiki entry ( Galaxy / Data / Actors / UI / Highlight Tooltip
Open the UI - Highlight Tooltip value in the data editor (actors) again.
Make sure Show Style Controls is checked. Display as Raw Text is optional. I recommend checking it as you can see exactly what's happening.
Highlight the text you want to add a style to.
The drop down box next to Apply Style should now be active.
Choose your style, and click the Apply Style button.
0
@theystolemynick: Go
I've set the values of the array just for the example. The debug line at the end simply outputs the lowest integer found.
0
Custom Made Cast Bar
Here is a demonstration of a custom made cast bar using dialog controls.
It is entirely dynamic, nothing is hard-coded. So the bar will fill up slower for spells with longer cast times.
I hope to release the cast bar and related actions in a library once it's completed. A tutorial may also be written.
v0.2
v0.1
0
@cecilofs: Go
Edit 2: New solution is prepended to the original post.
Edit: I just realised the solution below won't work since our original problem of the mouse cursor being hidden arises again and the Highlighted Unit variable will be emptied as when the camera is activated, the Highlight Off event is triggered.
Another work around can be added though to check if the same unit is still hovered when the mouse is released, and then select it. But make sure that if you click an empty area then release the mouse while hovering on a unit, that unit isn't selected.
Original Post
You bring up some good points. The reason the deselection action is in there is because without it, any units you click will be appended to the original selection instead of just one unit being selected.
As for the dragging issue, perhaps try utilising the Mouse Up trigger. For example:
Mouse Down
Mouse Up
I haven't tested this yet, but it should select the unit when you release the mouse and complete a click action.
0
Still texturing, still placing doodads, and need to fix the terrain cliffs (thanks Xaragoth ;) )
It's built using the Starcrafter Engine I'm making. Combat system is still being fine tweaked and abilities to add. But hope you can at least enjoy the layout!
It's built with a 4v4 in mind.
(Game is on lowest settings in video)
0
@progammer: Go
I've been playing with your system a bit further and I really enjoy it. I had to change the mover to Cliff Jumper to prevent path finding around walls. Lag online is a tad less than what is seen with most systems too, but unfortunately still a factor for anyone wanting to create any twitch mods.
My question is this, I would really like to implement your system, but is movement as dynamic as seen in the video above possible with it? i.e. The sprinting, the strafing and the rest (using data editor of course)?
0
The tutorial can be found here: http://forums.sc2mapster.com/resources/tutorials/10136-trigger-clicking-with-camera-mouse-enabled/
0
There's about a 0.5 - 1 second delay after pressing a movement key on Battle.net. And that's with our shoddy latency here in Australia. It still felt quite playable though.
Offline it's as smooth as any other game you might play. programmer's solution is a very good one, but there's a slight pause between pressing a key and the unit(s) moving offline, otherwise I'd probably incorporate it. You should all check it out though, it's very impressive. But since the main part of Starcrafter will take part offline, I'm happy to continue developing and wait to see if Blizzard ever find a solution for similar game types. :P
If they don't...i'm sure the online entertainment value will outweigh the problem of the lag.
0
Contents
Edit
cecilofs' post below made a good point that the unit is deselected whenever you want to look with the camera. I've attached v2 of the solution below. Once "Lock Camera Mouse Relative Mode" is called, the unit is technically no longer highlighted because the cursor is automatically hidden.
The new solution makes use of the original, but now the unit is stored in another variable when the mouse is down. And when the mouse is released (Up), the "Highlight On" trigger will be called if a unit is highlighted. The new version checks that the mouse up highlighted unit is the same one as when the mouse was pressed down and highlights it if so!
Triggers
Mouse Down
Highlight Off
Original Post
Some of you may have played around with camera movement using the mouse. i.e. You click your mouse button and drag to move the camera around a point on the map. But there's one problem when using this technique: You can't click on anything to select it! This is a major problem for those wanting to be able to click as well as move the camera.
Following is a basic tutorial on my solution for this problem which works quite well. It also lets you de-select a unit by clicking on an empty space.
Here we go:
First we'll set up the camera. This will also allow you to see why the workaround is needed.
The Problem
The Solution
The solution makes use of the in-built event that is triggered when you hover your mouse over a unit.
Now test your map and you can see that you can not only move the camera with your mouse, but you may also click the unit and click off it to deselect! This should be very useful for those of you working on RPG type maps with a movable camera.
0
Here is a demo of the engine I've been building for Starcrafter [SCR].
It's a little bit jumpy due to the screen casting, but it's completely smooth when actually playing it.
It's a very basic demonstration on my test map of the movement system, running, turning, strafing, moving back, sprinting and moving with the right mouse and camera. Also shows right clicking an enemy to begin auto attacking it. Meaning the unit the player is controlling will attack the enemy while moving and even after moving away and back again.
The first attack the unit begins to move towards the enemy, this is something I must disable. But enjoy the demonstration. There will be more (prettier) ones to come.
0
EDIT: Tutorial can be found here: http://forums.sc2mapster.com/resources/tutorials/10136-trigger-clicking-with-camera-mouse-enabled/
I've just solved the problem a minute ago so expect a full tutorial in the coming day or two.
The problem is quite common, when using the mouse to look with the camera when holding the left mouse down the player becomes unable to click or make any selection.
OneTwo had a solution in one of his earlier tutorials, that being to move a small circular region to the point where the mouse was clicked and to pick a random unit from within that region to select and attack.
This was a good work around but only to a point. I wanted the player to actually be choosing the unit or object they want to select so I spent some time researching and fiddling around with certain triggers and digging through the data editor for some way to disable the cursor being hidden. None of this was very fruitful, but a very simple solution came to mind:
Keep in mind a full tutorial with images and steps will be available soon.
To start off you have your mouse looking triggers: Mouse Down Mouse Up
In 'Mouse Down' you would find a function to turn Lock Camera Mouse Relative Mode On. And in 'Mouse Up' you would turn it off again.
To enable clicking (or a workaround) add a global variable called "Highlighted Unit" and then add two triggers:
Unit Highlighted
Event
Actions
Unit Unhighlighted
Event
Actions
Mouse Down
At the top of your mouse down trigger insert:
Data Editor
Now head to the data editor and find the unit you want to click and make sure the "Cannot be Highlighted" flag is disabled.
And that should be it! It also means that if you click on a space that isn't a unit, the previous selected unit will be unhighlighted.
Expect a prettier post soon.
0
@Mienk: Go
A list is also being compiled on the wiki: http://wiki.sc2mapster.com/galaxy/data/actors/ui/highlight-tooltip/
0
@MangledMind: Go
Hi MangledMind,
The camera will always stay with the unit you originally set as your player unit. If you ever need to change the unit, just run the SCR_Add Player Unit action with the player number and the new unit.
On the units you want to select, make sure the "unselectable" flag is off.
I haven't tested this online, so I have no idea how much network traffic it causes. The arrays have 16 (15 minus pos 0) keys so I guess it's possible to have 15 players. I recoded it with a goal of making as little changes to movement as possible to save traffic, but a lot of movement functionality had to be sacrificed. I went with functionality at the moment until I get to testing it online.
EDIT: Just tried it online and it suffers as any WASD movement suffers. i.e. won't trigger the move until 0.5-1 second past the actual key press. It still feels playable though, but only as an RPG.
0
Version 0.2 released. Comes in SC2Mod format, only one trigger required to initiate the entire system on any unit you want. System was recoded from scratch to make better use of in-built editor features.
0
@Sware: Go
Thank you for the feedback!
I've been working on totally redoing the system to make better use of built in behaviours and animations. And to prevent using the 'Move Instantly To' functions to save network traffic.
The scroll wheel will be fixed in the new version :)
0
Contents
Creating a Custom Tooltip
To make changes to the tooltip follow these steps:
Data Screen
Actors
UI - Highlight Tooltip
Units
Unit - Unit Flags
In Game
Applying Styles
You can also apply styles to your tooltip like font style, font size, font colour and position. You can find a list of all styles and what they look like at the wiki entry ( Galaxy / Data / Actors / UI / Highlight Tooltip
Data Screen
Actors
UI - Highlight Tooltip
In Game