Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm trying to give a player a certain potion effect when he walks over a specified block. Unforunately I couldn't figure it out.
What I already tried:
-I searched on youtube for tutorials but haven't found any
I am not sure if this is the absolute best way, but this is how I would do it. I would create a playerMoveEvent (called every time the player moves). Then check to see what the block is under that player by way of getting the location of the player then setting a block object equal to the getblock method in the location class. After that it is a matter of testing to see if it is the block that you want and then applying the potion effect!
Example (Take with grain of salt, I do not have an environment to test this right now):
#EventHandler
public void onPlayerMove(PlayerMoveEvenet event) {
Player p = event.getPlayer();
//This might not be the way to get the players location. Bukkit vs Spigot thing
Location l = p.getLocation();
l.add(0, -1, 0);
Block b = l.getBlock();
if(b.getType() == Material.WHATEVERBLOCKITIS){
p.addPotionEffect(WHATEVERPOTIONEFFECT);
}
}
If you need help with adding an event to your plugin you can read more about it here.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Do you have a good example of html code of a variable, my teacher confuse me and I have no idea how to learn it, I just need an easy example of a code i can look on and a little explanation , sorry for bad english. My question is, what is a variable?
HTML doesn't have variables, as it is a markup language, not a programming language.
Javascript, on the other hand, does allow variable use. For example, you can initialize a variable:
let x = 3
Compare the variable to other values:
if (x === 4) {
console.log("x is equal to 4!");
}
And even reassign it!
x = 4
This is useful if you want to implement a counter; you can have a variable initialized at 0 and then increment it each time a user presses a button (by setting an onclick handler).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Is there a way to take a screenshot in UE4 while in-game and save it somewhere so that I can use it again as an image or something?
There is a HighResShot solution, but that saves it somewhere outside the range of the editor (you cannot reach it programmatically), is there another way of doing it, that allows me to access it in-game?
I would recommend using HighResShot for taking the screenshots. As you mention, it saves this outside the range of the engine, in the "saved" folder. (In packaged builds, the saved content is in the user's appdata.) You can actually get this with ProjectSavedDir(), which returns this saved directory. https://docs.unrealengine.com/en-US/API/Runtime/Core/Misc/FPaths/index.html
It's C++, but you can expose this to Blueprints fairly easily. You can get the ProjectSavedDir()/Screenshots directory and load the images in-game. For doing this, I recommend the Ramas plugin (https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/4014-39-rama-s-extra-blueprint-nodes-for-you-as-a-plugin-no-c-required?3851-(39)-Rama-s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required=)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm a beginner in MonoGame development, and I try to develop a memory game for mobile,for doing that, I want to make some effects like flipping an image, page curling,...
Some advice/tutorials to start please?
If you want to get in touch with monogame shader effects you should first read this article:
https://github.com/mono/MonoGame/wiki/Effects-And-Shaders
Generaly you could easily port shaders made for XNA.
There is some curling shader but it seems it has to be ported to monogame:
Could a vertex shader be used for a page turn effect?
As i remember correctly you have to use vs_4_0_level_9_1 or ps_4_0_level_9_1 for the compile directive in the shader on Win8 mobile. Like this:
technique MyTechnique
{
pass Pass1
{
PixelShader = compile ps_4_0_level_9_1 main();
}
}
PS: You can flip texture using SpriteEffects parameter in SpriteBatch::Draw() method call.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I was looking at the Soundlcoud Widget docs
http://developers.soundcloud.com/docs/widget#
I noticed there is a parameter for 'download'. I tried it on the HTML5 sharing widget it didn't turn on the download link. Is there a way to show the Download link?
Example
http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F46911134&auto_play=false&show_artwork=true&color=ff7700&download=true&sharing=false
Thanks
This is actually the intended behaviour. A lot of the time, the widget is displayed in a relatively small frame, and showing all the buttons creates too much visual clutter. A redesign (to use icons, for example) is coming, but I can't give you a date on when that will be ready. In the meantime, the documentation will be updated.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want to use the addmusic example that apple have created for the IPod library access and be able to play the music in MY application; I however dont know which files to copy and how to combine the two... can someone please tell me what to do?
I already have created a button in MY application which will then upon click do the same thing that the button in the AddMusic example does to open up the Mediapicker thing.
Any help will be greatly appreciated.
You don't need to copy any specific files from the example, just some of the functions.
To pick the music you use MPMediaPickerController , look at AddMusicOrShowMusic in MainViewController.m to see how to instantiate that and what delegate methods you need to implement.
The important class you need to use to play the music is MPMusicPlayerController. In MainViewController.m you'll see the methods you need to implement and how to use it, see - (IBAction) playOrPauseMusic: (id)sender { for example.
Essentially you'll take the media items returned by MPMediaPickerController and call setQueueWithItemCollection on the MPMediaPickerController to queue up the music. After that it's really just a case of calling play/pause/etc and updating your interface.
The code you need is all in there, you just need to pull out the right bits.