haxball / haxball-issues

115 stars 43 forks source link

new property in stadium file - activation, new RoomObject - gameStatus #667

Open TurboFalafel opened 5 years ago

TurboFalafel commented 5 years ago

I came up with the idea of a new property of haxball stadium file - activation (working title). It could let you specify in which part of game an object (segment, plane, [disc?] ) will be "active". Idea includes creating a new RoomObject in Headless Host API: room.setGameStatus(gameStatus: float/int) • default "activation" property of segment/disc/plane is 0 and it means that it is active (collide with cMask) during the whole game • default gameStatus is 0 - all segments/planes/discs are active, excluding the ones with "activation" property different from 0 • room.setGameStatus(2) - changes gameStatus to 2, from now only segments with "activation" 0 (default) or 2 will be active For example, this segment:

{ "v0" : 1, "v1" : 2,, "bCoef" : 0.25, "cMask" : ["red","blue","ball" ], "activation" : 1 }

will collide with players and ball only if gameStatus is changed to 1. If gameStatus != 1, this segment will not collide with anything. I think it could be a milestone in creating maps. Connection between gameStatus and "activation" could let us make projects such as penalty kicks during the match, position setting and more, depending on creativity.

Leo-MapCreator commented 5 years ago

This solves my problems in #666 and #664 @basro

subxqns commented 5 years ago

are all of the objects visible all the time (if they are), do the visibility change according to the gamestatus, or how would you manage that?

Leo-MapCreator commented 5 years ago

visibility does not have to change according to gameStatus, just collision, at least that's what i think he is asking

subxqns commented 5 years ago

yeah i get that, so they'd still be visible even when they're not "active"

Leo-MapCreator commented 5 years ago

yeah, that's not a big problem tbh

TurboFalafel commented 5 years ago

yep, visibility of such a segment is not a problem, moreover you can add property "vis" : false

olehmisar commented 5 years ago

What about dynamic stadiums?

room.getStadiumProperty(key)
room.setStadiumProperty(key, value)
room.deleteStadiumProperty(key)

key i a path to property separated with dots and square brackets with indeces:

room.getStadiumProperty('name')
room.setStadiumProperty('vertexes[0].x', 120)
room.deleteStadiumProperty('traits.ballArea.cMask')
Leo-MapCreator commented 5 years ago

I think its good, but very far from our current reality

ghost commented 5 years ago

Good idea, but yeah it certainly would be more work than any other requested feature. Not that it's unreachable or that far from status quo, but unrealistic to get implemented imo