Nix | Jan 05, 2012 2:46 pm |
---|---|
Subject: Re: Couple of questions I think I got the sentry thing working decently: Replaced Quote: in unit.cpp file lines 319, 475 and 748 toif (sentryActive || data.canAttack) Quote: if ((sentryActive || (isBuilding () == false && !data.canDisable && isUnitBuildingABuilding () == false) || (isBuilding () && data.canAttack)) Considering I'm not a programming person at all, I'm pretty proud of that change ![]() There's still something wrong though. The shortcut for sentry works on removing sentry on all the "support" units (surveyors, engineers, minelayers etc.), but you can't set them to sentry with the shortcut, but only with the mouse menu. Any idea what's going on in there? :O |
Nix | Jan 05, 2012 9:57 pm |
---|---|
Subject: Re: Couple of questions I made a similar function to GetNextVehicle (basically the "Next unit" button), that browses idle production buildings. Any hints how this could be merged to the "Next unit" button? I think I'll add an extra button for the time being ![]() Quote:
|
Toranaga | Jan 05, 2012 10:29 pm |
---|---|
Subject: Re: Couple of questions Hi Nix, you're no programming person? But looks like it ![]() At least you find your way in code and know how to compile something. And your solution for the sentry looks good (and you found all relevant places). ![]() For the "next/prev unit" function, that combines vehicles and buildings: Maybe two functions "getNextUnit/getPrevUnit" would be better suited. Else it might be difficult to merge the buildings and the vehicles lists in a consistent way. When you put it in one function, you could for example first search the vehicles list, then when its end is reached continue with the buildings. Just an idea... Do you plan to send your code as patch to someone who can put it in the svn? Or is it mainly for your own use? ![]() Anyway I would like to look at that unit-cycle topic (I didn't use that feature myself before, but now I like it) and implement it completely (also the "done" functionality) when I have time for it. But if you do all the changes, it would be ok for me. |
Nix | Jan 06, 2012 1:39 am |
---|---|
Subject: Re: Couple of questions Quote by Toranaga: Hi Nix, Well I know the programming basics and know how to get around and look for stuff (and copy paste :)). You (or any of the devs) can use my sentry line and add it to SVN if you want? It's basically only that change I mentioned above, nothing else. I'd appreciate if someone with some C++ experience would try to figure why the "S" shortcut doesn't work on non-combat units to activate sentry. Sentry deactivation works with shortcut and activation works through mouse menu only on my solution. It's a minor nuisance but would be cool if it worked like the real thing ![]() Next/Prev unit and Done: I was thinking also about merging the "GetNextVehicle" with buildings to GetNextUnit function, but not sure if my copy/paste skills work with that kind of task any more... I was thinking that the "Done" state could be implemented with tagging units with "IsDone" or something like that, and GetNextUnit/GetPrevUnit checks that tag/status and skips the unit if "IsDone == true". I might actually get kinda hooked on programming here, I've browsed the source files all day today (was on sick leave) ![]() Oh one question: my compiled maxr.exe works fine on my comp, but when I sent it to my friend it didn't work because of some missing MSVCP100D.dll libraries. Alzis SVN exe worked fine on him. What's different on my compiled .exe? While we're at it, a second question! Do I remember right that in original MAX, units stopped when a new enemy entered their scan range? I didn't find a ticket on this issue. This could be slipped somehow into "cVehicle::makeDetection()", I guess? |
Nix | Jan 06, 2012 10:55 am |
---|---|
Subject: Re: Couple of questions So glad I'm on sick leave ![]() I think I got the "Done" button working now. It doesn't execute move command paths (should be easy to fix I guess), but removes vehicles from GetNextVehicle cycle until they're selected again or turn ends. I also added builder units that have finished building to the GetNextVehicle cycle, very important thing imo. I'm working on adding the idle production buildings to GetNextVehicle cycle now. I also have a temproary solution, an extra button to scroll through those, I think that'd be even better idea than merging the lists, if it was made a bit more visually pleasing ![]() |
ness | Jan 06, 2012 11:41 am |
---|---|
Subject: Re: Couple of questions Quote by Nix:
You should have build in debug mode. Try to rebuild in release ![]() |
Nix | Jan 06, 2012 12:06 pm |
---|---|
Subject: Re: Couple of questions Quote by ness:
Of course! Thanks for the answer ![]() |
alzi | Jan 06, 2012 1:20 pm |
---|---|
Subject: Re: Couple of questions Quote by ness:
It's not about debug or release here. This comes because you link your application against the dynamic Visual C++ runtime libraries but any other computer that has not installed Visual Studio does not have them. There are two ways of fixing this: The first one is to install the runtime on the computer of your friend. You can get it here. The other way is to link your application against the runtime statically (that's what I do). To do this you have to go into the preferences of your project, select C/C++ -> Code Generation and then change "Runtime Library" from "Multithreaded Debug DLL" to the same without "DLL" (and for the release mode of course without Debug). The problem with this is that all the libraries you use have to be build with the same setting, what for maxr means that you may have to rebuild the SDL libraries as well. |
Nix | Jan 06, 2012 2:28 pm |
---|---|
Subject: Re: Couple of questions Quote by alzi: The problem with this is that all the libraries you use have to be build with the same setting, what for maxr means that you may have to rebuild the SDL libraries as well. Can you give me a hint how do I rebuild the SDL libraries and what do I do with them? :O |
alzi | Jan 06, 2012 5:22 pm |
---|---|
Subject: Re: Couple of questions Quote by Nix:
Yes I can ![]() The same procedure has to be done for SDL_mixer and SDL_net afterwards. This was just a short description and I hope I could explain everything sufficient. Maybe I will extend the Visual Studio How-To when I have time for it. Edit: Just found a much more easy way: I zipped the libs that I build for myself and uploaded them here ![]() |