Jump to content

Random Icarus elements


Mook
Go to solution Solved by NAB622,

Recommended Posts

Posted

I saw this video on Youtube from Tx606 . 


Where he's showing off an icarus script that let's him spin an md3 bottle and it'll stop on a random angle and it seems to work.
But I've been incabable of reproducing it, so now I'm puzzled just how he did it exactly, and whether or not there's any Icarus geniuses around here on the Forum who dare to imagine how he might have accomplished it.
I thought Icarus Expressions might be how, but that just throws an error and does not function the way I was expecting expr to work.

I can use Icarus for other things just fine, but I have to know whether or not this is some kind of state machine or something lol.
As far as I can tell this has never been released anywhere to look at unfortunately.

Modding gods of the JKA community I call upon you all for Help lol

bigphil2695 likes this
Posted

What part specifically are you having trouble with? I can definitely help you get that working.

The random choice of angles should be pretty easy with a random number put into a global variable or SET_PARM. Then use IF blocks to determine which way to point, based on the random value.

To rotate the MD3, use a misc_model, then target it at a func_static or some other func_ entity.

Finally, to rotate the bottle, just make the script rotate the func_ whatever-you-used. The misc_model will copy all movement and angle changes from the targeted entity.

 

I highly recommend completely encasing the entire rotational area of the bottle in textures/system/clip, because if a player gets anywhere in that space the movement of the bottle will be interrupted and it will look weird.

Posted
53 minutes ago, NAB622 said:

What part specifically are you having trouble with? I can definitely help you get that working.

The random choice of angles should be pretty easy with a random number put into a global variable or SET_PARM. Then use IF blocks to determine which way to point, based on the random value.

To rotate the MD3, use a misc_model, then target it at a func_static or some other func_ entity.

Finally, to rotate the bottle, just make the script rotate the func_ whatever-you-used. The misc_model will copy all movement and angle changes from the targeted entity.

 

I highly recommend completely encasing the entire rotational area of the bottle in textures/system/clip, because if a player gets anywhere in that space the movement of the bottle will be interrupted and it will look weird.

Very cool!
Thanks for answering.
I can program a little bit, so I think I went in expecting to set and use variables very easy, but it's not looking so inuitive when I'm getting down to business in Icarus.
My issue is that I do not understand how to set a variable and then use it for setting the angle or in the rotate event.

If you have a Discord I can reach you on I would like to ask a few more questions about it when you have time.

Edit: Sorry, I went to get breakfast and had a moment of clarity I think.
I'm guessing that you can't make a Variable that stores a random value that you then use as a vector.

I'm guessing it really is if-statements, and some get-set shenanigans like  SET_ANGLE depending on If statements being cycled through from that Random number variable.

But what I would like to learn more about is how you set those variables, and what they work with.
Cause I was doing it wrong and thinking I could use a variable where I want, that's obviously wrong.

If you could write a little more about this later or give an example with a screenshot, then you are my hero and I won't bother you anymore lol.
I read the manual, but without a visual to go with it, I just can't put together how it works compared to just writing in IDE or something that Variable = ThisThing and then it just works and you can call on it for anything.   In Icarus it feels like there's -one- right way to use it.

I understood the Declare Event and Set can do stuff, but understanding the panel itself is giving me some trouble.

  • Solution
Posted
3 hours ago, Mook said:

I'm guessing that you can't make a Variable that stores a random value that you then use as a vector.

I'm guessing it really is if-statements, and some get-set shenanigans like  SET_ANGLE depending on If statements being cycled through from that Random number variable.

You are correct. Set random value on a variable, then IF...ELSE to determine which way to point the bottle based on the random value, then execute your rotation and other fun stuff. There is no way to do any math or comparison on vectors in ICARUS, so this is the only option.

I have to assume you are using BehavED, it's the only method I've ever used. If you initialize a variable like so:

cc_8.jpg

 

Then to give it a random value, set it like so:

cc_22.jpg

On the left is the necessary line to use the variable you created.

The center just gets an = sign.

On the right, input your min and max values for the range at the bottom, then click rnd. BehavED will input the necessary command for you.

I use this same username on discord, and I think I'm in the JKHub Discord server, too. I'm not hard to find if you need help. 😉

Posted
2 minutes ago, NAB622 said:

You are correct. Set random value on a variable, then IF...ELSE to determine which way to point the bottle based on the random value, then execute your rotation and other fun stuff. There is no way to do any math or comparison on vectors in ICARUS, so this is the only option.

I have to assume you are using BehavED, it's the only method I've ever used. If you initialize a variable like so:

cc_8.jpg

 

Then to give it a random value, set it like so:

cc_22.jpg

On the left is the necessary line to use the variable you created.

The center just gets an = sign.

On the right, input your min and max values for the range at the bottom, then click rnd. BehavED will input the necessary command for you.

I use this same username on discord, and I think I'm in the JKHub Discord server, too. I'm not hard to find if you need help. 😉

This is exactly what I needed, huge help.
Thanks mate.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...