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.


Messages - djaydino

Pages: 1 ... 146 147 [148] 149 150 151
2206
Playmaker Help / Re: Rifle aim pro
« on: November 23, 2014, 09:40:48 PM »
yes, that can be done.

here's a video on how to communicate scrips with playmaker

2207
Playmaker Help / Re: Please help! Can't get Playmaker to start
« on: November 23, 2014, 09:25:04 PM »
try installing it directly from the asset store :

click window / asset store (or ctrl9)

login if not logged in,

search for playmaker.

click on import , import all

and that should work


edit : i just noticed on the picture that your folder is now PlayMaker/PlayMaker

try dragging the folder on the right side to the center (root)

2208
Android Help / Re: OnMouse_ event handlers error..Need Help..!!
« on: November 23, 2014, 07:26:36 AM »
you should use touch actions for mobile instead of mouse down action

the "error" you get is not an error but a warning
It will give this warning even if you are not using any on mouse
but does not give any problems

2209
Playmaker Help / Re: Move Towards, unable to define target
« on: November 21, 2014, 11:06:20 AM »
when you drag in a object into a state it will ask this and you can then get or set anything on that object (position,color,material, etc.)

what action are you using?
did you try to drag / drop on a different action?

2210
Playmaker Help / Re: Memory Game
« on: November 21, 2014, 10:47:47 AM »
you can find it Here
i can't find it on the Ecosystem tho

2211
yes you can.
But i haven't use Github yet so i might need a little help to get started :)
I have send you a pm with my e-mail  connected to github.

2212
i was actually thinking that it would be nice if it would be added in the original Actions on a next update.
but it can be done in custom actions also,
any suggestion how to name them?
 
sorry for this late reaction, i went to Philippines and it took a while to get some decent internet connection.

i will try to get them done as soon as i can
what do i need to do to work directly on the ecosystem ?

greetings djaydino

2213
i just noticed that in "Random event" No Repeat is used, i will edit this script and set it to No Repeat also for better clarity.

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2014. All rights reserved.
/*--- __ECO__ __ACTION__ ---*/
// http://hutonggames.com/playmakerforum/index.php?topic=8665.msg41731#msg41731

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Math)]
[Tooltip("Pick a random weighted Int picked from an array of Ints.")]
public class RandomWeightedInt : FsmStateAction
{
[CompoundArray("Ints", "Int", "Weight")]
public FsmInt[] ints;
[HasFloatSlider(0, 1)]
public FsmFloat[] weights;

[RequiredField]
[UIHint(UIHint.Variable)]
public FsmInt result;
[Tooltip("Don't repeat the same Int twice in a row.")]
public FsmBool noRepeat;

private int randomIndex;
private int lastIndex = -1;

public override void Reset()
{
ints = new FsmInt[3];
ints[0] = 1;
ints[1] = 2;
ints[2] = 3;
weights = new FsmFloat[] {1,1,1};
result = null;
noRepeat = false;
}
public override void OnEnter()
{

PickRandom();
Finish ();
}

void PickRandom()
{
if (ints.Length ==  0)
{
return;
}

if (noRepeat.Value)
{
do
{
randomIndex = ActionHelpers.GetRandomWeightedIndex(weights);
} while ( randomIndex == lastIndex);

lastIndex = randomIndex;
result.Value = ints[randomIndex].Value;

}else
{
randomIndex = ActionHelpers.GetRandomWeightedIndex(weights);
result.Value = ints[randomIndex].Value;
}
}
}
}
when i have some extra time i will make a bundle from the other randoms and implement No Repeat to them.

2214
bumb:

i bumbed this because i did not see a reply yet and i think it is important that the Random Weighted int works correctly :)

2215
Playmaker Help / Re: Random X Y movement - Please assist.
« on: November 01, 2014, 04:35:25 AM »
did you look @ the tutorial videos?

if you follow those (and some tutorials in the playmaker tutorials section )
that should get you started.

2216
Playmaker Help / Re: Unity 5 WebGL - Playmaker
« on: November 01, 2014, 04:27:49 AM »
i think it's better you post in unity3d's forum.

i don't think this is a playmaker bug, but a unity3d bug
can you build into a different platform? (for testing if the bug still there)

2217
Ok i think i got this to work now  :o

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2014. All rights reserved.
/*--- __ECO__ __ACTION__ ---*/

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Math)]
[Tooltip("Pick a random weighted Int picked from an array of Ints.")]
public class RandomWeightedInt : FsmStateAction
{
[CompoundArray("Ints", "Int", "Weight")]
public FsmInt[] ints;
[HasFloatSlider(0, 1)]
public FsmFloat[] weights;

[RequiredField]
[UIHint(UIHint.Variable)]
public FsmInt result;
[Tooltip("Can hit the same number twice in a row")]
public FsmBool canHitTwiceInARow;

private int randomIndex;
private int lastIndex = -1;

public override void Reset()
{
ints = new FsmInt[3];
ints[0] = 0;
ints[1] = 2;
ints[2] = 3;
weights = new FsmFloat[] {1,1,1};
result = null;
canHitTwiceInARow = false;
}
public override void OnEnter()
{
if (ints.Length > 0)
{


if (randomIndex != -1)
{
if (canHitTwiceInARow.Value)
{
randomIndex = ActionHelpers.GetRandomWeightedIndex(weights);
result.Value = ints[randomIndex].Value;
Finish();
}
else
{

{
do
{
randomIndex = ActionHelpers.GetRandomWeightedIndex(weights);
} while ( randomIndex == lastIndex);

lastIndex = randomIndex;
result.Value = ints[randomIndex].Value;
Finish();
}
}
}
}
}
}
}

you can copy this to your script if you want.

greetings kurt

2218
i think i got it to work properly now, i commented out parts from your script and added some other, here is the script :

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2014. All rights reserved.
/*--- __ECO__ __ACTION__ ---*/

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Math)]
[Tooltip("Pick a random weighted Int picked from an array of Ints.")]
public class RandomWeightedInt : FsmStateAction
{
[CompoundArray("Ints", "Int", "Weight")]
public FsmInt[] ints;
[HasFloatSlider(0, 1)]
public FsmFloat[] weights;

[RequiredField]
[UIHint(UIHint.Variable)]
public FsmInt result;

// private int randomIndex;
//        private int lastIndex = -1;

public override void Reset()
{
ints = new FsmInt[3];
ints[0] = 0;
ints[1] = 2;
ints[2] = 3;
weights = new FsmFloat[] {1,1,1};
result = null;

}
public override void OnEnter()
{
if (ints.Length > 0)
{
int randomIndex = ActionHelpers.GetRandomWeightedIndex(weights);

if (randomIndex != -1)
{

result.Value = ints[randomIndex].Value;
Finish();


return;
}
}

Finish();
}
// public override void OnEnter()
// {
// if (ints.Length > 0)
// {
// do
            // {
                // randomIndex = ActionHelpers.GetRandomWeightedIndex(weights);
            // } while ( randomIndex == lastIndex);

// lastIndex = randomIndex;
// result.Value = ints[randomIndex].Value;
// }

// Finish();
// }

}
}

i think it has something to do with these lines :
Code: [Select]
// } while ( randomIndex == lastIndex);

// lastIndex = randomIndex;
// result.Value = ints[randomIndex].Value;

you can change your script if you want to.

i can see some usefulness the way your script works now tho (if you don't want to hit the same number 2x in a row or spawn an object)
maybe a good idea is to add a check-box that says "Can Hit twice in a row"
so both methods can be used. i will play around some more with your script (sounds kinda weird huh  :P ) and i will post it if i get it to work.

greeting,

Dino

2219
i have been testing with some different weight settings with 6 numbers) and i noticed that the random can't hit the same number 2x in a row.

i don't think the Random is supposed to be like that.
i tested also the random int action and that seems to be ok
and i tested the Random event and that does what i was expecting.

i will mess around with the script and let u know if i found the problem

2220
Playmaker Help / Re: Compare multiple ints
« on: October 29, 2014, 05:43:01 PM »
do you know some good tutorial videos for array maker?

Pages: 1 ... 146 147 [148] 149 150 151