-
-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'every' parameter to setElementDimension #111
Add 'every' parameter to setElementDimension #111
Conversation
Good idea. |
186490a
to
ec2b440
Compare
2a431f1
to
9276b42
Compare
Ignore the "cached" commits shown by GitHub above - they are not actually in the branch... whilst making the modifications I made reverts, but decided to modify your original commit instead (to preserve history). Sorry about the potential email spam. |
bf9644c
to
942165a
Compare
I think we should go for local nextDimension = getElementDimension(element) + 1 Generally speaking, I like the idea though. |
@ccw808 English isn't my first language, so i didn't knew what word was the correct so i ended up using every, but we can change that if needed. @qaisjp Thanks for fixing that. VS messed up the withespaces and i didn't saw it, sorry. @Jusonex When the programmer choose use the parameter every anywhere he should know that getElementDimension will return "every", that's the expected behaviour, I think that introducing a new function for this will be strange, i.e. what is suposed to happen when you make the element visible in every dimension and then try to change its dimension? It would return false? and what about getElementDimension? it would return the previously set dimension when in reality the element isn't in a specific dimension? Thanks for the feedback guys 😃 |
I'm just curious, why do you even need this for your multigamemode system? Usually each arena has its own dimension so you won't see other players. . |
@zneext a possible answer to your question
i.e, setting the dimension to 3, then making it visible in all dimensions will,
|
Why don't we assign -1 to 'dimensionless'? |
@Bonsai11 What do you mean? It's not a multigamemode system, it has only one gamemode but different lobbies, with different matches running on, That's why i came up with this, otherwise i'd have to either create the object on every dimension i need or set all the objects' dimension right after the player join a lobby, Sorry if i haven't made it clear enought on the first post :) I think that using -1 instead of "every" is the best solution, we won't need to create another functions and it will be compatible with older codes (as getElementDimension would return a number too), WDYGT? |
Please let me know how you guys want this, I'd love to get this feature in the next update if possible. |
What about a range instead: setElementDimension( object, first, last )
first, last = getElementDimension( object ) |
Doesn't it cause problems if an element can be in multiple dimensions? If a player could be two dimensions, he would be visible to players of each of these dimensions. In case its only about objects, I think there might be a similar problem with objects that can be destroyed or explode. A vehicle crashes into a multi dimensional barrel and it will explode for everyone, even though only the driver's dimension can see him crash. |
"What about a range instead:" Yea but then what if you you want it visible in dimension 1,3, 5? I think you should go for an array, which is customisable. If the array contents equals to -1, then every dimension. |
The advantage of a range over an array is we can avoid -1 (which seems a bit hacky). However using range/array is overcomplicating things, so let's just go with -1 |
Good job! |
Sorry for the delay, I've had some problems with this branch so today i rewrote this entire feature, New PR: #112 |
In the future, instead of fragmenting conversation and making multiple pull requests, ask for assistance. Run these commands on the command line, it should fix the issue:
If your remote is not called |
942165a
to
f696b76
Compare
Sorry about that @qaisjp, Running these commands fixed the issue. |
That's great to hear! No problem. |
While developing my server (which has multiple lobbies (same gamemode but in different dimensions)) i realized that there wasn't any "easy" way to make an object visible in every dimension (and thus not having to create every object in every dimension or dealing with setElementDimension) so i came up with this, it allows us to use setElementDimension ( object, "every" ) to make an object visible in every dimension. It also reads dimension="every" from .map files.
It's my first time dealing with serverside functions which call their client counterpart so i don't know if i did everything correct, Please point any mistakes i've made. 😃