holding Decors

holding Decors

Postby yizhe » 4 October 2019, 12:50

How do i make my character hold onto a can of soda (decor) ?
Meep!
User avatar
yizhe
Android T-01187 [200]
 
Posts: 224
Joined: 5 February 2014, 09:26
Location: Advance level editor

Re: holding Decors

Postby Jason Eden » 4 October 2019, 13:27

What do you mean "hold onto a can of soda"? You want to create a prop hunt map or make your character hold a can in his hand? If it's first one, then make your character smaller and invisible, then attach a decoration (can) to a door, then make door follow the character's position. If it's second option of what you meant, then I feel like it's a waste of time to try to make that. So don't try that.
User avatar
Jason Eden
Falkok [250]
 
Posts: 275
Joined: 8 December 2018, 14:30

Re: holding Decors

Postby yizhe » 4 October 2019, 13:46

my character holding onto a can of soda
Meep!
User avatar
yizhe
Android T-01187 [200]
 
Posts: 224
Joined: 5 February 2014, 09:26
Location: Advance level editor

Re: holding Decors

Postby ziomke » 5 October 2019, 19:44

Jason Eden wrote:[...]it's a waste of time to try to make that.[...]


Exactly. It is very hard because the character is moving its hands and theoretically you can't do that.


http://plazmaburst2.com/images/professor.png
User avatar
ziomke
Civil Security Lite [100]
 
Posts: 139
Joined: 29 June 2017, 09:37
Location: hell

Re: holding Decors

Postby jeje52 » 6 October 2019, 03:52

The first thing is you have to hold any gun, like a grenade set to slot 1 or the new invisible gun, because your hands won't move towards the cursor any other way. You can ignore this step if you don't care about the can hovering in front of you rather than you holding it.

And for moving the can, you can do it by using basic trigonometry with the player-cursor angle. Then if you already have the soda can image uploaded you can move it in the character's hand, but you'll have to also rotate it a bit using the angle I mentioned previously.

I was able to get it working quite nicely using just the barrel decoration scaled down to half size. I can upload a map demonstrating it if you'd like.
User avatar
jeje52
Advanced Usurpation Soldier [150]
 
Posts: 153
Joined: 13 April 2018, 19:52

Re: holding Decors

Postby ditzy » 6 October 2019, 08:22

It is possible! Jeje55 explained most of the basics, but I want to talk about the math behind this.

Map demo: https://www.plazmaburst2.com/?s=2&map=d ... rimental=1
Map source: https://www.plazmaburst2.com/level_edit ... zy-soda&a=

Spoiler: Show More
Let's say you're holding a can of soda 2 feet away from you, at arm level (0°). Now let's say you lower your arm. The soda is still 2 feet away from you, but now it's 30° below your shoulders. Let's say you raise your arm. The soda is now 30° above your shoulders.

Not only do we need to figure out how far away the can of soda is from our player, but we need to know at what angle it is.

How do we find the angle? We can use the atan2 method.

Atan2 calculates the angle of two points: point A and point B. In this instance point A will be our arm, and point B will be our hand. (In PB2, 0° is directly down, or a vertical line, not horizontal)

If you take a look at the atan2 trigger action, you'll notice that there's only room to input the x and y positions of 1 point. That's because the atan2 method actually calculates the angle between point B and grid position 0,0 (This is what the computer considers point A).

However, we need point A to be the location of the arm to get accurate angles. How do we do this? If we subtract the position of the arm from the position of the hand, the result will give us a position that's relative to grid position 0,0. We can put that relative value into the atan2 method to get us an angle that accurately reflects the angle of the player's hands.

Now that we have the angle that the player is holding the can of soda, we need to figure out how far away the can of soda is from the player. Doing that is simple enough. We perform the sin and cos methods on our angle. We can then multiply the sin and cos values by the distance our can of soda had when at arms level (0°).

Finally, with a little more math(mainly finishing the calculations for the player's position) we have a finished trigger system that allows you to hold a can of soda!
Sometimes draws ponies
Sometimes draws ponies
Sometimes draws ponies
User avatar
ditzy
Advanced Usurpation Soldier [150]
 
Posts: 169
Joined: 1 December 2017, 01:20
Location: Ponyville

Re: holding Decors

Postby yizhe » 6 October 2019, 16:07

WOW! Thank you for the teachings! but what if its a AI? There is no cursor...
Meep!
User avatar
yizhe
Android T-01187 [200]
 
Posts: 224
Joined: 5 February 2014, 09:26
Location: Advance level editor

Re: holding Decors

Postby jeje52 » 6 October 2019, 20:34

yizhe wrote:but what if its an AI? There is no cursor...

AI characters do actually have a cursor.
You can move a region to it by using the "Move region 'A' to cursor of player 'B'" trigger action. Despite it saying "player", it can be used on AI characters as well.
User avatar
jeje52
Advanced Usurpation Soldier [150]
 
Posts: 153
Joined: 13 April 2018, 19:52

Re: holding Decors

Postby Jason Eden » 6 October 2019, 20:41

You guys waste the time. What's the use of that technology anyway? Making a soda drinking animation with outstretched arm or creating a laggy Captain America's shield?
User avatar
Jason Eden
Falkok [250]
 
Posts: 275
Joined: 8 December 2018, 14:30

Re: holding Decors

Postby Civil-Lite » 6 October 2019, 21:58

Pretty sure that’s what the genuine idea for a decoration resembling a character holding a can of soda was meant to be. And for the use of that technology, whether it’s just for show or not, that’s down to the map makers decision.
User avatar
Civil-Lite
Janitor
 
Posts: 550
Joined: 30 January 2015, 02:44
Location: Searching your feelings...

Re: holding Decors

Postby jeje52 » 6 October 2019, 22:38

Jason Eden wrote:You guys waste the time. What's the use of that technology anyway? Making a soda drinking animation with outstretched arm or creating a laggy Captain America's shield?

I see no use for holding a can of soda, and I don't know what yizhe plans to do with it. I just made it because I like challenges, it didn't take too long. I can come up with a similar use for this, which is making completely custom guns. You can upload a model, move it to your hands and use an invisible gun to do the shooty part of the gun. But that's still kind of impossible as there's no good way to check what gun a player is holding, or where the gun is when it's dropped.
User avatar
jeje52
Advanced Usurpation Soldier [150]
 
Posts: 153
Joined: 13 April 2018, 19:52

Re: holding Decors

Postby ditzy » 7 October 2019, 01:30

yizhe wrote:WOW! Thank you for the teachings! but what if its a AI? There is no cursor...


It should be possible, but I haven't tested that yet so you should take what I say with a grain of salt.

Theoretically, the system would function much the same as it would with a player, but with a few extra steps. You'd have to get an inactive AI, force it to look at a specific point (That point is set via region), and force its shoot action to 'true' (value 1).
Sometimes draws ponies
Sometimes draws ponies
Sometimes draws ponies
User avatar
ditzy
Advanced Usurpation Soldier [150]
 
Posts: 169
Joined: 1 December 2017, 01:20
Location: Ponyville

Re: holding Decors

Postby Jason Eden » 7 October 2019, 10:27

jeje52 wrote:I see no use for holding a can of soda, and I don't know what yizhe plans to do with it. I just made it because I like challenges, it didn't take too long. I can come up with a similar use for this, which is making completely custom guns. You can upload a model, move it to your hands and use an invisible gun to do the shooty part of the gun. But that's still kind of impossible as there's no good way to check what gun a player is holding, or where the gun is when it's dropped.

If you like challenges, then why won't you create something that is challenging, but also very practical and that can be used by all community members to make their maps better? Like, I don't know, an ultrarealistic multilevel elevator that is also SYNCHRONIZED in multiplayer? Why don't you make this instead of a can of soda?

You're a very talented guy. I think you should not waste your talent on making cans. Do you understand me?
User avatar
Jason Eden
Falkok [250]
 
Posts: 275
Joined: 8 December 2018, 14:30

Re: holding Decors

Postby jeje52 » 7 October 2019, 23:32

Jason Eden wrote:If you like challenges, then why won't you create something that is challenging, but also very practical and that can be used by all community members to make their maps better? Like, I don't know, an ultrarealistic multilevel elevator that is also SYNCHRONIZED in multiplayer? Why don't you make this instead of a can of soda?

You're a very talented guy. I think you should not waste your talent on making cans. Do you understand me?

I can't come up with anything that's challenging and also practical. Sometimes I find a use for the stuff I make. I have a couple of unpublished maps that use trigonometry and angle calculation to make stuff that's impossible without the math. I doubt that you've ever used that fancy password panel of yours, it's not practical but you still made it.
User avatar
jeje52
Advanced Usurpation Soldier [150]
 
Posts: 153
Joined: 13 April 2018, 19:52

Re: holding Decors

Postby Jason Eden » 8 October 2019, 09:17

jeje52 wrote:I can't come up with anything that's challenging and also practical. Sometimes I find a use for the stuff I make. I have a couple of unpublished maps that use trigonometry and angle calculation to make stuff that's impossible without the math. I doubt that you've ever used that fancy password panel of yours, it's not practical but you still made it.

I just gave you an idea what is challenging and practical at the same time. The elevator.

I didn't use my password system because I'm not as active in map making as I used to be back in 2011. I did use password systems many times, but not on this account though and not during last few years. I'm pretty much done with map making. I'm finishing my last project and quitting the game. If I had a desire to stay and continue making maps, I would certainly use stuff from my OS1 and OS2 maps, because that stuff is very useful and practical for any map existing in PB2. That's the exact reason why I made them - for other people to use in their maps.

"Password panel not practical"? Listen to yourself. This sounds just ridiculous.
User avatar
Jason Eden
Falkok [250]
 
Posts: 275
Joined: 8 December 2018, 14:30

Re: holding Decors

Postby Fan Fan1 » 8 October 2019, 11:27

Okay, we all have uses for our own trigger systems. That is the summary. We don't need to go on critisising other peoples trigger system ideas just because we cannot think of a useful application for it. Everyone makes certain trigger systems because they themselves feel it is useful and that is what matters most. It is not anyone's decision to say that a certain trigger system is not useful, because only the map maker should be making that decision. The poor guy, yizhe, just wanted to know how to make a character hold on to a soda can.

It is not about what the trigger system does. It is about how you use it.

So, instead of critising other people's trigger systems, let's just support the fact that yizhe has an idea for a map and that he is trying his best to work on it. Let's support the fact that jeje52 has an idea for a map with a custom gun. Let's support the fact that Jason Eden is compiling a list of trigger systems that may benefit him (and maybe others) in the future. We are all map makers. We give our support and feedback towards the end result other people's map. We do not make any critisisms without knowing the end result of the map. This is the map making community that I used to know, so let's not taint the community's name any further and just accept each other's ideas. Afterall, it is those ideas that gave every map maker the end result.
User avatar
Fan Fan1
Cyber Grub [25]
 
Posts: 39
Joined: 30 July 2013, 23:44
Location: Save File 666

Re: holding Decors

Postby yizhe » 8 October 2019, 11:43

Disappointed that a simple question had caused childish squabbles of who is being lame. Jason Eden, while i do appreciate your input in this topic, whether it is a waste of time, its not for you to decide. After all, we do have different ideas for different maps. Hope you can respect other players’ map ideas. Locking the topic.
Meep!
User avatar
yizhe
Android T-01187 [200]
 
Posts: 224
Joined: 5 February 2014, 09:26
Location: Advance level editor


Return to Bug Reporting Archive

Who is online

Users browsing this forum: No registered users



cron