Author Topic: Activate different parts of a brick?  (Read 3049 times)

Not too sure where to post this but I think mod help is fine.

I was looking at the interactive vehicles and how you can open the doors and trunks of cars and was wondering if this can be done with a brick? That is, looking at one part of a brick and "activating" it and it changes states or something and then looking at a different part of the same brick and "activating" it and it does something else. Basically creating zones on a brick that are clickable and react to whatever you want them to do.

I did a few quick searches and couldn't find anything out there that was similar to my curiosity so I'm hoping more experienced mod-makers can shed some light.

Thenks

Bricks have an orientation value called angleid which controls north, east, south and west. Using this in conjunction with some vector math (see: Pythagorean theorem, quadrants) and you can get which (side) your aim vector lands on. It would require a lot of fine tuning to get the exact sides you're clicking on, and would probably require you to take the size of the brick into factor. It probably wouldn't be an easy task for someone as inexperienced as you (no offense) vector math can be very difficult to work with

There might be a parameter under onactivate that already checks the side of collision being clicked on, but I wouldn't know

OnActivate is called from the engine. It sends in in addition to player and client, the position and vector. It is the same functionality as OnActivate on Vehicle. The position or vector is not send further, so a package is required in order to retrieve those.

It's probably better to package it through ontrigger then and fire a raycast

Thanks for the help. And yea there's plenty of info about vectors and raycasts out there, which was what I was expecting to be working with. It's just lots of trial and error (for me) to figure out how to tell the add-on what to do with that information once I technically have received it.

For someone who doesn't do this every day it can be a task. I like learning about it tho, just frustrating when I have all these ideas and don't know how to execute them all the way thru lol.

I will update if I have a breakthrough :)

if you keep coming up with crazy new and practical ideas but have no way to see them through yourself, just start posting it in suggestions or pming people like zeblote or port to make it for you.

dont pm port or zeblote to make stuff for you. both have receded from the community for this exact reason, people constantly asking them for stuff

dont pm port or zeblote to make stuff for you. both have receded from the community for this exact reason, people constantly asking them for stuff
I get that it can get annoying, but if you're like, the best person for a particular job, then of course you're gonna get a lot of attention for it

The reason they get messaged a lot is because they may know more about these kind of things than others, so they get recommended much more than others

This is the first time i'm hearing it, but if they really did bail, and for that reason, that's kind of selfish on their part
« Last Edit: February 24, 2018, 09:53:10 PM by Masterlegodude »

I get that it can get annoying, but if you're like, the best person for a particular job, then of course you're gonna get a lot of attention for it

The reason they get messaged a lot is because they may know more about these kind of things than others, so they get recommended much more than others

This is the first time i'm hearing it, but if they really did bail, and for that reason, that's kind of selfish on their part
idk man i wouldnt call it selfish. if everyone and their mother at your school/workplace always came to you for help, at some point id bet you'd get tired of it. even soup kitchens have holidays or days off - you can't assume these people will want to work for free constantly.

like sure, selfish by definition, but its not selfish in a bad way. i enjoy helping people, but id hate it if the second i come online on steam or blockland people pestered me about making stuff or helping them make stuff. it would make me want to cut ties with everyone cause its just a drain, i cant enjoy the game like that. sure, im the best person for the job, but im not there just to help you. and its kinda sad if it really is a fact of life that the second you get good at something, people stop respecting your free time and interests. i like to think people are willing to be respectful enough to give them space if they so wish it, and these two have done so by receding from the community.
« Last Edit: February 24, 2018, 10:35:27 PM by Conan »

First time hearing this as well :\ but no worries m8s, I've never asked anyone to make me something ;) I like to be as independent as I can when I try to make addons from ideas I have, that's part of the satisfaction! But there is much I do not know so I ask when I can't find an example to modify and whatnot. Maybe someday I will be able to write code out of thin air...

Back on track: I appreciate all of your replies! Not a whole lot closer to figuring out how to make this work but I have taken the advice into consideration and will update if I get supa close. Thanks!

This is the first time i'm hearing it, but if they really did bail, and for that reason, that's kind of selfish on their part
they have no obligation to sacrifice time and effort to help
shame but true



if you ever want to learn something code-like i suggest reverse engineering from other mods

they have no obligation to sacrifice time and effort to help
shame but true
While it's true, and while they have no obligation to do so, if they were willing to put in the time and effort to learn as much as they did, and do the things that they did, to get to where they did, they shouldn't have been so affected by the attention they got for doing what they did to actually drive them away

It's like becoming a celebrity, you get good at something, you become widely known for doing said thing, then you're bound to get people who want to talk to you and put your field of expertise to use

Do what you do, and enjoy doing it, but don't let the attention stop you from doing what you do, then all that time and work you put into learning something just goes to waste

Quit if you must, but quitting just because people know you're capable of doing such things that others may not be able to is just awful IMO, if anything, take the attention as a compliment and as a sign that people look up to you and admire your work

While it's true, and while they have no obligation to do so, if they were willing to put in the time and effort to learn as much as they did, and do the things that they did, to get to where they did, they shouldn't have been so affected by the attention they got for doing what they did to actually drive them away

It's like becoming a celebrity, you get good at something, you become widely known for doing said thing, then you're bound to get people who want to talk to you and put your field of expertise to use

Do what you do, and enjoy doing it, but don't let the attention stop you from doing what you do, then all that time and work you put into learning something just goes to waste

Quit if you must, but quitting just because people know you're capable of doing such things that others may not be able to is just awful IMO, if anything, take the attention as a compliment and as a sign that people look up to you and admire your work
just like celebrity status, not everyone wants it or enjoys it, once they get it. there's a non-trivial number of people out there who also prefer lower level jobs compared to management. its similarly not unheard of for someone to decline a promotion to keep the job they love, or to avoid a job they dislike.

if people were only encouraged to git good if they want attention, then there wouldnt be any engineering geniuses like wozniak. for him, the attention over apple is/was a compliment, but an unwelcome one, as he only ever wanted to do the stuff cause he enjoyed hacking together parts and making new stuff. he didnt stop cause he got the limelight, but he definitely receded from public view and just did what he enjoyed on his own time, without people bugging him about apple. port's in the same boat too - he still does stuff with BL, but almost always privately now.

also to finally give something on topic: one thing you need to consider is what do the events include? onActivateNorth/South/East/West/Top/Bottom? or onActivateFront/Back/Left/Right/Top/Bottom?

what about activating the ramp portion of a brick, or the wedge portion of a wedge? should it just pretend its like a cuboid brick and handle the activation as if the person clicked a normal cuboid brick from that angle?

also to finally give something on topic: one thing you need to consider is what do the events include? onActivateNorth/South/East/West/Top/Bottom? or onActivateFront/Back/Left/Right/Top/Bottom?

what about activating the ramp portion of a brick, or the wedge portion of a wedge? should it just pretend its like a cuboid brick and handle the activation as if the person clicked a normal cuboid brick from that angle?

Kinda sorta. Basically, I have a box with a lid, and I'd like the lid to open when clicked and the "body" of the box to to something else (lock/unlock for example) when clicked.

The only add-on I see where you can "activate" different parts of a single object is Barnabas' Interactive Vehicles, and that uses a sort of placement of "zone" objects/areas as far as I know.