I mean the same as UnitRevive , I'm pretty sure I could use custom scripts in SC2engine , But is there such a thing as CustomScript PlaySoundtrack (); or whatever for SC2?
Yes you can add custom scripts. Right click new->New Custom Script. To play a sound you can use Play Sound, Play Sound At Point or Play Sound On Unit. If you want to have Chrono Boost autocast, then you should enable the autocast flag under the ability in the data editor.
Hey man, I want to help too, but you're going to have to tell us exactly what it is you're trying to do here:
I just can't understand what you want. You said: "About making a pick how do I change the Custom Script? thanks for the reply btw." I just don't quite understand what you mean about making a Pick.... do you mean, you'd like to Pick a different sound? You'd like to be able to change which sound the custom script will play while the game is running?
What it kind of sounds like you want might be...
Do you want to be able to specify what sound to play on the fly? Maybe... using a String variable?
Tell us what exactly you want and we'll be happy to help you.
It is pretty easy to use a String variable to play whatever files you want on the fly for this application.
What you'll need is:
A String Variable (or, if you want to make an Action/Function that does the action via a parameter, a String Parameter)
One simple line of code that executes a Sound via input of a String (ie. name of sound link)
I have attached a map that has two functions in it:
RunSoundLink
RunSoundTrack
To use the two actions, just give it a string, and it plays the SoundLink, or starts the SoundTrack with that exact name. You can also play the map for a demo of how it works, and then look at the code under the "Chat" trigger to see how I am executing the code.
For future reference, in the trigger editor, you can press CTRL+ F11 to view the Custom Script source of any GUI Code you make. If you make a command with the GUI, and would like to see what that command looks like in Custom Script, just push CTRL + F11. You will be shown a window containing ALL of the trigger code in your map organized by the order from top to bottom of all of your GUI and Custom Scripts. You can scroll down to find any code you have in the Map, including the Custom Script view of all GUI code.
So, if you want to know how to do a GUI command in Custom Script, first write the code with the GUI editor, and then push CTRL + F11 to scroll down to where that code is to see how it looks in Custom Script.
I realize you've got the answer now, but I'll share a quick tip for this type of thing.
If you press control + D while in the trigger editor, it replaces all the action labels with their internal script name (you can press ctrl + D again to toggle this back). This is a quick and easy way to see how the code is set up for any existing GUI action.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
To post a comment, please login or register a new account.
Just a quick question , How do I custom script a certain Sound File of my choice, The same as UnitRevive (lv_);
and how do I make the Chrono Boost Self Cast btw?
Custom Script?? what do u mean??
I mean the same as UnitRevive , I'm pretty sure I could use custom scripts in SC2engine , But is there such a thing as CustomScript PlaySoundtrack (); or whatever for SC2?
Yes you can add custom scripts. Right click new->New Custom Script. To play a sound you can use Play Sound, Play Sound At Point or Play Sound On Unit. If you want to have Chrono Boost autocast, then you should enable the autocast flag under the ability in the data editor.
For example:
@Exaken: Go
About making a pick how do I change the Custom Script? thanks for the reply btw.
Hey man, I want to help too, but you're going to have to tell us exactly what it is you're trying to do here:
I just can't understand what you want. You said: "About making a pick how do I change the Custom Script? thanks for the reply btw." I just don't quite understand what you mean about making a Pick.... do you mean, you'd like to Pick a different sound? You'd like to be able to change which sound the custom script will play while the game is running? What it kind of sounds like you want might be...
Do you want to be able to specify what sound to play on the fly? Maybe... using a String variable?
Tell us what exactly you want and we'll be happy to help you.
@gerudobombshell: Go
Regarding about how to play a Variable Soundtrack or a built-in soundtrack through a Custom Script.
It is pretty easy to use a String variable to play whatever files you want on the fly for this application.
What you'll need is:
I have attached a map that has two functions in it:
To use the two actions, just give it a string, and it plays the SoundLink, or starts the SoundTrack with that exact name. You can also play the map for a demo of how it works, and then look at the code under the "Chat" trigger to see how I am executing the code.
For future reference, in the trigger editor, you can press CTRL+ F11 to view the Custom Script source of any GUI Code you make. If you make a command with the GUI, and would like to see what that command looks like in Custom Script, just push CTRL + F11. You will be shown a window containing ALL of the trigger code in your map organized by the order from top to bottom of all of your GUI and Custom Scripts. You can scroll down to find any code you have in the Map, including the Custom Script view of all GUI code.
So, if you want to know how to do a GUI command in Custom Script, first write the code with the GUI editor, and then push CTRL + F11 to scroll down to where that code is to see how it looks in Custom Script.
Hope that helps!
I realize you've got the answer now, but I'll share a quick tip for this type of thing.
If you press control + D while in the trigger editor, it replaces all the action labels with their internal script name (you can press ctrl + D again to toggle this back). This is a quick and easy way to see how the code is set up for any existing GUI action.