Artie Tweaks


(Artie) #1

Here are the blox I used for my game. I’m calling them tweaks cause I basically used the same bloxs we know and added a different variety to them. That and I’m still getting used to scripting ^^

Time Scale - Scaling time using float number. This changes the whole game’s time.and anything that uses Time.time. Using Ugui or onGui is fine.

Find Targetable Character’s Main Cam - Instead of raycasting thru the player’s forward. It’s using the Character’s Cam forward. Basically if you wanted to target things on what you see and not behind the camera. I use it for the Kingdom Hearts or Zelda style so it’s always auto-targeting something in an onupdate event. Also it doesn’t target the player cause you’ll always be looking at the player in third person.

Use Bag on specific slot - It’s similar to “Use Item in Bag” cept it’s for people who has multiple button that has same item stacks. This is used to prevent on use the first slot button if your selecting a similar item on another button.
Another purpose is the use of a loop if you’re making your own Ugui to determine which slot you want to use. No matter how many similar stacked items in other slots, if that Item in that slot runs out, it’ll not use the others. USE only the variable from the loop counter or an int number, not the (get item) blox.

example below. (this uses all items at once)

If slot Contains - Just a bool True and false if there are items in that specific slot.

Get Item Max Stack Size - Int of what the max slot size of that item is given. If it’s written 0, it’ll be shown as 1 because there is an item currently.

artieBlox.zip (6.2 KB) (2/04/15)


Drag and Drop Inventory
Bug? Use Item from Bag Slot
How to use or equip Items from bag
Custom Block - Add to slot
(RaiuLyn) #2

I hear ya. Making blocks for something can be daunting at times. You’ll get used to it after a few hair losses like I did with third party tools. :smile:

Both are handy to have. I have always wanted to try a Kingdom Hearts-style combat game ever since I played the first one, I’ll do it one day maybe.


(Artie) #3

Yup doing simple things I find easy is always a good practice.

Updated with another block that I find useful. We have the (get item weight) so here’s a (get item max Stack).
Ganna use it to check if you have itemMaxStack = slotStackSize so it would tell me you can’t get anymore of that item or else you’re just getting nothing without knowing it.
If it’s written 0, it’ll be shown as 1 because there is an item currently. Cause silly items…you can’t be 0.

Yhea kh is fun but complex Lol the amount of airtime and physics effects is ganna be crazy making it but that’s what I’m doing xD Woot!


(Marshall Heffernan) #4

Time Scale is sweet, thanks @artie.


(Treane) #5

error
Assets/artieBlox/A_Timescale_plyBlock.cs(14,22): error CS0101: The namespace plyGame' already contains a definition forArtie_Timescale_plyBlock’

I do not understand how to use Find Targetable Character’s Main Cam :C


(Artie) #6

Looks like there is another file or a duplicate file that has my namespace? Strange.
Are you using the command line made by march by any chance?

The “find targetable main camera” targets hostile enemy from and near within your main camera view. If the hostile enemy is not within the camera’s view, it won’t target it. And it returns that gameobject. This is a nit-pick feature as I believe being in 3rd person view, it feels better to target what you see. Try Debug it first will tell you that too. I believe it already finds the player’s main camera so make sure that is no disabled when using this block.

P.S. If you saw my recent video near the end, you see yellow target markers swapping to different enemies. That is an example to that blox I made: TailBlade - Hack n Slash
It allows me to autotarget and have my character face that enemy when attacking. When the vignette appears around the screen, that’s when I locked it and just used the native plygame’s target.


(Jamie pearce) #7

That mean you already have a time scale script with the same name definition


(Treane) #8

Help a newbie to understand how to make auto target T.T
I do not understand how to do the same :frowning:
pls help


(Artie) #9

hope this helps. This is a snippet of my auto target logic. It returns the component of your NPC. With this I attach it to the “set selected” blox so it’s automatic and you don’t need to do this by clicking.
For optional effect, if you attack by pressing the attack button, you can use turn to face that selected object so it auto rotates your player to it.


(Treane) #10

Thanks!


(Treane) #11

when using the skill, the character does not rotate in the direction of the enemy


(Artie) #12

In the skill active event in the skill, add the blox “rotate towards” target. Be sure to add if target is = to hostile to check it first


(Treane) #13

You can clearly show?
I do not understand how to do (


(Treane) #14

please help, how to make?(


(Treane) #15

please explain in detail
how to make


(Artie) #16

this would be fine for what you are doing. It turns the player automatically towards the enemy.


(Treane) #17

it works, but sometimes the camera jerks
dramatically changes the angle of view for a moment and comes back, you do not know because of what it is?


(Artie) #18

Are you using top-down camera or 3rd person camera? I only work with top down and tweak it to look like 3rd person. Mainly cause 3rd person locks your rotation to the player as i remembered.


[Solved] Camera problem
(Marshall Heffernan) #19

Correcto.

If you don’t want the camera “stuck to the player’s back”, then don’t use the third person controller.


(Treane) #20

camera top-down and 1 controller top-down