-
Notifications
You must be signed in to change notification settings - Fork 77
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
SWAP_CREATURE script command #1484
Conversation
SWAP_CREATURE(NEW_CREATURE_A,[creature]) will now replace the [creature] with whatever is in the test_demon.cfg file
src/config_creature.c
Outdated
newcrtr_desc[n].name = gameadd.crtr_conf.model[n + 1].name; | ||
newcrtr_desc[n].num = n + 1; | ||
n++; | ||
if (n + 1 >= CREATURE_TYPES_MAX) |
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 believe this should be SWAP_CREATURE_TYPES_MAX instead of the normal one, also use that constant for the 128 up top, and check all new CREATURE_TYPES_MAX if they should SWAP_CREATURE_TYPES_MAX instead
src/lvl_script_commands_old.c
Outdated
check_and_auto_fix_stats(); | ||
creature_stats_updated(crtr_id); | ||
//TODO SCRIPT rewrite from DD | ||
//WARNMSG("Swapping creatures is only supported in Deeper Dungeons"); |
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 it now works this comment can go
src/game_merge.h
Outdated
@@ -203,6 +203,7 @@ struct GameAdd { | |||
|
|||
struct Objects thing_objects_data[OBJECT_TYPES_COUNT]; | |||
struct ObjectsConfig object_conf; | |||
struct CreatureModelConfig swap_creature_models[CREATURE_TYPES_MAX]; |
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.
shouldn't it be SWAP_CREATURE_TYPES_MAX here?
src/lvl_script_commands_old.c
Outdated
do_creature_swap(ncrt_id, crtr_id); | ||
return true; | ||
} | ||
|
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.
for both do_creature_swap and swap_creature if it's not directly logic related to level scripts them selves it shouldn't really be in the lvl_script files
because information does not weigh anything
The CreatureData and Creature structs do not seem to fully come from the configs. |
SWAP_CREATURE([new_creature],[old_creature])
Where: the new creature comes from
SwapCreatures
in the [common] block of creatures.cfg.If this is keeperfx.cfg
Then you can put a file called wubble.cfg in your
creatrs
folder or your campaign/pack specific creatures folder.Then if you put
SWAP_CREATURE(WUBBLE,HORNY)
in the level script, it would load the creature specific in wubble.cfg instead of the one from horny.cfg