Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upMilitary Vehicle Group and Source Changes #12926
Conversation
This comment has been minimized.
This comment has been minimized.
|
Ah, I knew I'd mess something up. :V EDIT: Scheisse. Am I missing additional inclusions, or is the problem something else? |
added some commits
Jul 13, 2015
This comment has been minimized.
This comment has been minimized.
|
Ah...hah...scheisse squared. |
This comment has been minimized.
This comment has been minimized.
|
Meh. For now it seems at least mapgen.cpp can be messed with. |
This comment has been minimized.
This comment has been minimized.
KiwiTrinsic
commented
Jul 15, 2015
|
From a quick glance, I'm guessing that the problem is that the veh_type variable is of vproto_id, while you are trying to assign a vgroup_id to it. That won't work. vgroup_id can handle individual vehicle types as well as groups, but vproto_id can only handle individual vehicle types. The map's add_vehicle function can accept either a vproto_id or a v_group_id without problem, which is why the changes in mapgen.cpp work. You should be able to get the mapgen_functions.cpp change to work if you change veh_type from vproto_id to vgroup_id. Doing that you will need to change all the assigns to veh_type to vgroup_id. Example: vproto_id("bubble_car") needs to become vgroup_id("bubble_car") |
This comment has been minimized.
This comment has been minimized.
|
Ah, I see. The error that kept showing up was "candidate function (the implicit copy assignment operator) not viable: no known conversion from |
This comment has been minimized.
This comment has been minimized.
|
Right, and |
This comment has been minimized.
This comment has been minimized.
|
Hmm, I see. I could've sworn mapgen.cpp used both vproto_id and vgroup_id though. EDIT: Yeah, even the military checkpoint spawning demonstrates it. |
This comment has been minimized.
This comment has been minimized.
KiwiTrinsic
commented
Jul 15, 2015
|
Yes, the map add_vehicle function can handle either a vproto_id or a vgroup_id. You still cannot assign a vgroup_id value to a vproto_id variable ;) |
This comment has been minimized.
This comment has been minimized.
|
Hmm. So what I need to do is figure out how to change the add_vehicle function as defined in mapgen_functions.cpp and get it to take vgroup_id instead? Still unsure. :V |
This comment has been minimized.
This comment has been minimized.
KiwiTrinsic
commented
Jul 15, 2015
|
The way mapgen_functions.cpp is working right now is that it creates a variable veh_type of vproto_id. Then it will put the value into that variable. That is the part where you see veh_type = vproto_id( "military_cargo_truck" ), veh_type = vproto_id( "bubble_car" ), and so on. Because veh_type is a vproto_id variable, it can only be assigned a vproto_id value. If you change veh_type to be a vgroup_id variable, you will then be able to assign it a vgroup_id value. This means that all the vproto_id values will have to be changed to vgroup_ids or you will have the same problem you are having now, except in reverse (trying to put a vproto_id value into a vgroup_id variable.) |
This comment has been minimized.
This comment has been minimized.
|
...no. Your variable named It's no longer there in the latest commit, suggesting you did something to fix it. Most likely this part of the diff: https://github.com/chaosvolt/Cataclysm-DDA/commit/4a01afe2ff808e5f70475a684d001d7c9dd339e1#diff-59604ea2f6e3da1d8c5be9188964f1c9R1794. |
This comment has been minimized.
This comment has been minimized.
|
Also, is the pull request builder busted again? Edit: Nevermind, I kicked it regardless. |
This comment has been minimized.
This comment has been minimized.
|
Hmm. I undid my changes to mapgen_functions is why it isn't there, because it was breaking. But does it at least function correctly in mapgen.cpp? If it's instead trying to spawn a VEHICLE named "military_vehicles" I'm going to be several different kinds of annoyed. ;-; |
This comment has been minimized.
This comment has been minimized.
|
Also also, yeah it looks like something broke on the pull request builder, as update 4 hasn't been checked. O.o |
This comment has been minimized.
This comment has been minimized.
|
Oh, no, I see what's going on now -- that "Update 4" is actually a reference:
Incidentally, it would be really nice if your commit titles were more informative. "Update 4" doesn't tell me anything, and if I'm looking at abbreviated |
This comment has been minimized.
This comment has been minimized.
KiwiTrinsic
commented
Jul 15, 2015
|
Everything looks fine to me in the mapgen.cpp code. It is calling directly to the add_vehicle function with the vgroup_id instead of using a variable so it won't have the same problems you are having in mapgen_functions.cpp. |
Coolthulhu
self-assigned this
Jul 15, 2015
This comment has been minimized.
This comment has been minimized.
Sorry about that. I usually list changes in the notes for it, but I probably should start titling commits with what I'm changing instead of numbering them. @_@ |
This comment has been minimized.
This comment has been minimized.
|
In any case, hope the mergening goes well. |
Coolthulhu
added a commit
that referenced
this pull request
Jul 15, 2015
Coolthulhu
merged commit db4a2b1
into
CleverRaven:master
Jul 15, 2015
1 check passed
This comment has been minimized.
This comment has been minimized.
|
And thank you for the merge. |
chaosvolt
deleted the
chaosvolt:military-vehiclegroup
branch
Jul 16, 2015
This comment has been minimized.
This comment has been minimized.
|
Also @Coolthulhu if you know what I messed up in that initial commit, it would be nice to know. Was it a lack of additional includes like my guess was, what KiwiTrinsic guessed was the cause, or something else entirely? |
This comment has been minimized.
This comment has been minimized.
It's what KiwiTrinsic guessed was the cause. You're assigning to the variable Those are both ids, but they are ids of different things. It would similarly fail if you try to assign a martial art style ( You can try to spawn from the group there directly (call Besides the whole if-else block should be moved to JSON, I think the vehicle group system allows that now. |
This comment has been minimized.
This comment has been minimized.
|
Hmm, I see. No doubt if I tried to puzzle out how to get that to work, I would've broke it even harder. ;w; |
This comment has been minimized.
This comment has been minimized.
KiwiTrinsic
commented
Jul 16, 2015
|
@BevapDin Yeah, I've taken another look at the code and it is basically trying to hard code a vehicle group. I'll look into ripping the whole thing out and replacing it with a json vehicle group. |
chaosvolt commentedJul 13, 2015
I'm always leery of messing with the source, so I'm hoping I don't screw
up.
predominates, with other existing vehicles increasingly rare.
a cargo truck, and the turret result for military checkpoints.
I am assuming that the chicken walker and tank drone are much bulkier
than a pair or turrets and need a cargo truck to haul them, so those
spawn results are unchanged. I am likewise leaving the truck spawning in
the hazardous waste sarcophagus unchanged.