-
Notifications
You must be signed in to change notification settings - Fork 7
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
Added some console commands. #213
base: master
Are you sure you want to change the base?
Conversation
Also added an optional 4th parameter to creature.create specifying the number of creatures to generate.
For giving multiple traps or doors at once.
gameadd.classic_bugs_flags is a word, not a dword.
Including one to restart the level (thanks to Ed).
Unlike the cheat menu, this lets you place non-standard terrain.
You can also now specify the owner.
It now defaults to 1 if omitted.
Useful for comparing what ADiKtEd does to what the game does.
I also made the whole thing case-insensitive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are many, many useful commands here. I'm assuming though that this can no longer be merged into the new master without handling several conflicts.
Also, for further testing and future use, could you document it like this here:
https://github.com/dkfans/keeperfx/wiki/Console-commands
if (load_game(slot_num)) | ||
{ | ||
player = get_player(plyr_idx); | ||
set_flag_byte(&game.operation_flags,GOF_Paused,false); // unpause, because games are saved whilst puased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: paused
} | ||
else { | ||
JUSTLOG("No campaign specified. Default campaign loaded for selected level (%d).", start_params.selected_level_number); | ||
ERRORLOG("Unable to load campaign associated with the specified level CMD Line parameter, default loaded."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really an error? Won't this happen if you simply use -level without specifying the campaign?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. I think I had some help doing the restart level feature.
@@ -4513,9 +4535,18 @@ void wait_at_frontend(void) | |||
if ((game.operation_flags & GOF_SingleLevel) != 0) | |||
{ | |||
faststartup_network_game(); | |||
if (restart_level) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking really weird. Could you explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's weird about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (restart_level) {
restart_level = false;
}
Do both of these need to be restart_level? Why would you even need the if statement in this case, you could just set restart_level to false if not. I'm thinking you want one to reference a function and the other to a variable, and if that's the case, you want to have them be different names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the if (restart_level)s is in another if statement and before a return statement (though I suppose I could move this to before that if statement).
Which one should reference a function? restart_level is a boolean variable.
@@ -255,7 +255,8 @@ TbBool slab_kind_is_animated(SlabKind slbkind) | |||
{ | |||
if (slab_kind_is_door(slbkind)) | |||
return true; | |||
if ((slbkind == SlbT_GUARDPOST) || (slbkind == SlbT_BRIDGE) || (slbkind == SlbT_GEMS)) | |||
// if ((slbkind == SlbT_GUARDPOST) || (slbkind == SlbT_BRIDGE) || (slbkind == SlbT_GEMS)) | |||
if (slbkind >= 50) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we really sure all slabs over 50 are animated?
And even if we are, it would still be better to refer to the enum value of 50, so that if slabs are added in between the function keeps working as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that all slabs over 50 are animated.
These are commands for, amongst other things, creating things, placing slabs, testing stuff such as sound, and manipulating things such as creature health and the creature pool.