Customizable placement of buildings
Moderator: Moderators
Customizable placement of buildings
In my last game my base was built up the way that i had to place my gantry pretty stupid to get my mechs out.
So what about beeing able to rotate buildings? Could this be done somehow in a comfortable way?
Maybe showing an arrow in placement box and being able to switch direction with some key.
So what about beeing able to rotate buildings? Could this be done somehow in a comfortable way?
Maybe showing an arrow in placement box and being able to switch direction with some key.
-
- Posts: 578
- Joined: 19 Aug 2004, 17:38
-
- Posts: 578
- Joined: 19 Aug 2004, 17:38
If I didn't have so much trouble reading your code, I may have attempted to do it. So far I understood that unit yardmap, if present, is loaded at the start of the game, and once the building is placed, it is counted as a SolidObject, and its yardmap is applied to the map via AddGroundBlockingObject. I can't pinpoint the sequence of events from building being selected for construction to starting building construction though. Presuming you can help me with that in any way(and presuming you can get me the 1.33.1 boost libs for VC71 so I can compile the thing), I'll gladly help you out. :)Tobi wrote:That sounds like a perfect junior job then, if it's that easy. I'm awaiting your patch.
There could be a problem with one yardmap being used for all buildings of one type though, so an alternative means would be to load four versions of the yardmap (have yardmapN, yardmapE, yardmapS and yardmapW variables instead of just yardmap), and have each instance of a building bear a tag, N, E, S or W, according to where the building was oriented when placed. I think the Num_Enter is disused at the moment, so it can work as a switch button. For ALL built buildings, so you don't have to re-rotate them for each instance placed.
Sean Mirrsen:
I think you're on the right track. If the yardmap is stored in the UnitDef (which I'm pretty sure it is), you'd probably want 4 yardmaps in different rotations, plus the var which remembers for every building which orientation it has.
Also, AddGroundBlockingObject (or whatever it was called) must be modified to put the right map on the blockingmap.
As for the exact equence of events from building selection to building, I'm no expert in that part of the code so I don't know it out of my head. I may see if I understand it later.
As for boost, I don't use MSVC and hence I don't have boost libs for MSVC and can't give them to you... Either ask a dev who does use MSVC, compile boost yourself, change the project file to use 1.33 instead, or any other workaround.
I think you're on the right track. If the yardmap is stored in the UnitDef (which I'm pretty sure it is), you'd probably want 4 yardmaps in different rotations, plus the var which remembers for every building which orientation it has.
Also, AddGroundBlockingObject (or whatever it was called) must be modified to put the right map on the blockingmap.
As for the exact equence of events from building selection to building, I'm no expert in that part of the code so I don't know it out of my head. I may see if I understand it later.
As for boost, I don't use MSVC and hence I don't have boost libs for MSVC and can't give them to you... Either ask a dev who does use MSVC, compile boost yourself, change the project file to use 1.33 instead, or any other workaround.
-
- Posts: 578
- Joined: 19 Aug 2004, 17:38
-
- Posts: 578
- Joined: 19 Aug 2004, 17:38
-
- Posts: 578
- Joined: 19 Aug 2004, 17:38
-
- Posts: 578
- Joined: 19 Aug 2004, 17:38
Well, not exactly, no. (so you can, like, "unbow", if you wish
) Since I've done so many random changes trying to find what exactly I needed to do, I made Spring crash the moment any units appear in-game, even in debug mode it crashes without doing anything else. So I currently reverted back to the original code, and will now employ step-by-step "add and check" tactics to see what could have caused the crash. At least I know what to do now. Except one thing - I still don't know how to rotate the building model, both after completion, and when it's selected for building.
P.S. To be honest, I've never finished any project that I have started myself. Ever.
So chances are good that this one will suffer the same fate. Don't get your hopes up.
![Razz :P](./images/smilies/icon_razz.gif)
P.S. To be honest, I've never finished any project that I have started myself. Ever.
![Sad :(](./images/smilies/icon_sad.gif)