Autohoykey - Hold down multiple keys for different time intervals - autohotkey

I want to create an AHK for pressing down multiple different keys, but pressing and releasing them at different times, all in the same AHK. For example, hold down forward to walk in a game, then hold left/right while still walking forward to turn. I am very new to this so any help is appreciated.
I have tried creating different scripts, both using the same key to active, but only 1 activates at a time.

Related

Bind and distinguish 2 equals joysticks new input system Unity3d

I am making a Pad Dance Game. I have 2 pad dances, they works like a joystick on Pc, they almost have the same number/button sequence(because they are not from the same company). The problem is when I click one pad and the other has the same gamepad number the action works in both player. I need the input system to distinguish if I am pressing the same number button from joystisck one or two. The image below shows how the input system detect the binding for the up arrow icon on the pad 1("botao1") and 2("botao11"), there is no difference if I am pressing joystick one or two. I tried to create 2 differents Action Map, didn't work, because the biding system don't recognize if am pressing joystick one or two. Any clues? Tks in advance
You need to duplicate the inputs, one for each pad (so for example "Left_Player1" and "Left_Player2"). You configure both inputs identically, except that they must have different JoyNum values.

Why is my sprite constant in mint language?

He only moves a little bit and not moves forever
The (move 10 steps) block will only move your player by a tiny bit. It moves in the direction that your sprite is facing.
If you would like to have it moving for a longer period of time, (and smoother), I'd recommend using a loop of some kind.
Putting a Forever() loop around it will have it always move forward.
Repeat(number of times to repeat) will move it forward however many times you want.
Try to experiment with more of these loops and see which one best fits your project and goals.
You have multiple options. The first is to put the 'move 10 steps' block into a forever loop, so you code goes like the first one in the image and that will make your sprite move 10 blocks until the stop button is pressed.
Or alternatively, you could use a repeat (no. of times to repeat) block, like the second one:
Two Block Options
That's all!

Unity - random looping idle

Here is a basic setup of locomotion.
It works this way it is connected, I have walk and run animation, and stand as idle, I added 3 new stand("Idle") animations, and cant figure a way to make them random pick after walk is finished, and loop till next destination is given.
I tried adding new substate machine, but still cant figure a way to connect it the proper way.
Here is the image of current setup, this way when agent stops, it returns to idle state, and animation loops till new destination is given.
I want the same behavior but when he returns to idle, I want it to randomly loop with 3 new states
You can use BlendTree for that.
Just set Random float using Random class and use BlendTree to blend animations using that tree.

Adding and removing multiple nodes efficiently, without any lag

In my game, at specific intervals, a function is called that adds multiple nodes to the scene (between 2 and 6 nodes). These individual nodes are all the same - they consist of the same blender model, same SCNCone, same spotlight and same physics bodies - (The blender model is low-poly, nothing extreme).
When it's time to call the next interval of nodes, the nodes that were called previously are removed (including their actions). This process repeats until the player has died. Now when the nodes are removed and new ones are added, it creates noticeable lag for roughly a second, and doesn't appear smooth.
I'm wondering whether there is a more efficient way to add and remove these nodes that could possibly eliminate lag? Since these nodes are all visibly the same, would cloning a node multiple times be better than re-creating the same node over and over within a for loop?
Any advice on efficiency or better practises would be greatly appreciated too.
Thanks!
Edit: Just a thought, should I have a node at every required position, and basically un-hide and give them actions when needed, and once they've done their job, fade out, put back at initial position, remove actions and hide?
This would mean I would need about 20 nodes in the scene at all times, but at least there would be no need to add any more, or remove any.
Start by turning ON statistics.
scnView.showStatistics = YES;
Click on the + at the bottom left of the screen to the stats screen.
What could be causing the lag? Quick things to check are:
1. Is the geometry too complex?
2. Are the textures too large?
3. Are there too many draw calls?
Cloning is better.
Yes, I think your idea at the end will avoid the lag. If the nodes being added are the same as the nodes being removed it will be more efficient just to hide and reset them.
If you are creating the nodes each time it is likely that is causing the lag, and you could even remove and add them from the scene but instead of creating them when needed store them in an array ready to be reused.

SpriteKit & Swift: How to create level "segments" that are randomly "stitched" together to create an endless game?

The concept that I am talking about is similar to the style of game seen in many minimalistic, popular mobile games such as Color Switch, the Line Zen, Phases, or Bounce. These are endless games composed of a series of "levels" or "rooms" that are placed in a random order, and are one after another, creating the effect of an endless game. The key thing is that the challenges in each level are not random, they are drawn up before, and if that certain level is chosen randomly, it appears on the screen and the player moves through that level.
I think this concept might be called procedural generation, though I'm not positive.
How would I do this in SpriteKit using Swift? I'm not really sure where to start, maybe create a function for each level segment and, every few seconds, choose a random one to put on the screen?
Any help is appreciated!
Thanks so much!
Procedural generation is the name of the concept you are describing.
The approach will change a bit depending on the type of game you are trying to make but let's look at procedural generation in an infinite runner game. What you want to do is set up a buffer of level segments. The total size of the segments in your buffer should be at least twice the size of the screen. Every segment should be a child of the same segments node and they should be positioned so that each starts right after the previous one ends.
When a segment moves off screen (the player passed it):
remove that segment from the segments node
initialize a new segment (probably from a sks file)
add the new segment to the segments node
position it behind the last segment in the segments node.
The logic you use for choosing the next "random segment" is up to you. It can be truly random or you can fine tune it for the best user experience (avoid repeating segments, avoid segments that would ruin the flow, etc).
The key is to remove segments as they go offscreen and add a new one at the end of the buffer. This must be position based, not time based (time is less reliable even when the game scrolls at a constant speed).