playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Red

Pages: 1 ... 8 9 [10]
136
PlayMaker Help / Creating new actions...
« on: June 07, 2011, 06:01:48 AM »
Can any script be used so long as it's noted properly? even if it's a javascript?

reason i ask is i have a camera control script that i like and it's pretty good for what i need it for... but for reasons of efficiency (translation: lazyness ;) ) i would like to see about adding it to the library of actions available so that it's a simple matter of adding it... this would also allow me to create an easier method to control cutscenes with the camera... toggling off the script and getting it to move to a specific location when a certain event is met.

for note, the script i use is here and as follows. it was created by cobbling together script snippets from the unity forum and unity answers website so i can't lay claim to it (though i forget who authored the bits used.)

Code: [Select]
using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour
{
    public GameObject player;
//The offset of the camera to centrate the player in the X axis
public float offsetX = -5;
//The offset of the camera to centrate the player in the Z axis
public float offsetY = 0;

public float offsetZ = 0;
//The maximum distance permited to the camera to be far from the player, its used to     make a smooth movement
    public float maximumDistance = 2;
//The velocity of your player, used to determine que speed of the camera
public float playerVelocity = 10;

    private float movementX;
private float movementZ;
private float movementY;

// Update is called once per frame
    void Update ()
    {
        movementX = ((player.transform.position.x + offsetX - this.transform.position.x))/maximumDistance;
        movementY = ((player.transform.position.y + offsetY - this.transform.position.y))/maximumDistance;
        movementZ = ((player.transform.position.z + offsetZ - this.transform.position.z))/maximumDistance;
        this.transform.position += new Vector3((movementX * playerVelocity * Time.deltaTime), (movementY * playerVelocity * Time.deltaTime), (movementZ * playerVelocity * Time.deltaTime));
    }
}

as you can tell, it exposes the offsets needed to allow for proper camera placement. it doesn't (yet) take into account the rotation of the camera and when i come across a need for such control, i'll probably try and work that in but for now, it does what i need it to.

so... how can i turn this into an action? (yes, i am a newb and i am not very good at coding. i can barely scratch by but that's kinda the reason i purchased playmaker, to avoid the headaches of having to learn code instead of actually just getting to making my games.)

yeah, i realize now that this is a C# script... guess that goes to show how noobish i am with coding when i can't determine at a glance wether a script is java or C# :lol:

137
General Discussion / Pseudocode...!
« on: May 31, 2011, 09:55:16 AM »
yeah, i'm starting to realize the importance of adding pseudocode snippets to the info boxes.

for example, say i need enemy#1 to find enemy#2, team up and patrol together?

have enemy find location of other enemy
if locations are not the same, move towards eachother.
if distance from eachother is 1 unit, begin patrolling
- patrolling: if not over path node, look for path node
-- if distance is greater than 1 unit, go towards next path node

that kinda thing.

so, how about a pseudocode jam-session? i mean, since the actions use-able with playmaker can easily apply to real world events and such, why not practice getting into the headspace and brainstorming pseudocode for various tasks you could use in game...?

just an idea to get people active ;)

138
PlayMaker Tips & Tricks / MouseWheel
« on: May 28, 2011, 06:30:18 PM »
any idea how to get that into playmaker?

... or am i seriously overlooking something?

139
General Discussion / Screencast Software?
« on: May 28, 2011, 04:58:37 AM »
hey all, kinda had some thoughts about recording some of the processes i've been using to cobble together what i'm aiming for and posting them to youtube or something... sort of a "here's what i did and how i did it" kinda thing.

with that in mind, what sort of software would you recommend for recording (ideally with audio through a microphone or soemthing) screencasts?

140
Action Requests / Text, font, etc... over object
« on: May 28, 2011, 04:31:29 AM »
if you play any of the MMO's out there from WoW to DCUO to Runescape, you'll know that there are those numbers that float above the enemy or players head that denote how much damage, wether you missed/dodged and other such things.

i was wondering if there would be a way to make text appear as something like that...?

i can imagine a couple workarounds such as creating a prefab for numbers and having it float above the character, but a simple action with options such as font, value (either from a variable or manually entered, capable of handling either string, int or float) and maybe making an option as to wether you want to animate said text (to make it float upwards for damage, shake for a "CRITICAL HIT!!!" kidna deal or sink down to the ground.) and this could also be used to have the players' handle above their heads and viewable by other players...

unless i'm mistaken and there already is an action that does this and i haven't found it yet ;)

141
PlayMaker Help / Newbie Question: Detecting Collisions
« on: May 27, 2011, 10:57:05 AM »
Okay... so, i've read through this subforum, checked the reference manual but for some reason i've tried the "collision event" on a bullet prefab to test what it's colliding with (so i can allocate damage, change animation, etc...) but i don't seem to understand what's going on here.

i've told it to call the "collision detected" event and threaded that FSM up to it like all the tutorials say for handling FSMs.

and i've also tested that the delete fsm works (alt+click while running)

i just can't seem to get it to work. (i'm sure i could find a workaround but this seems like something i would need to know how to use properly.)

any tutorials or anything out there to point me in the right direction? it just doesn't seem to be detecting the event... (do i have to set a trigger object in there somewhere? i ask this because i had thought that unity's default colliders were meant to handle that kinda thing.)

Pages: 1 ... 8 9 [10]