diff --git a/Advanced templates/example_asymmetricalrotation_7statesfull_animated/properties.txt b/Advanced templates/example_asymmetricalrotation_7statesfull_animated/properties.txt index 5ed24ab2f750a5f1f01f656c05665d2db6f85c8b..86cf4892781fbe3ca657eee64d65b638fac6f2dc 100644 --- a/Advanced templates/example_asymmetricalrotation_7statesfull_animated/properties.txt +++ b/Advanced templates/example_asymmetricalrotation_7statesfull_animated/properties.txt @@ -18,6 +18,8 @@ "mode_explanation": "If floating (0) or on the ground (1).", "scale": 1, "scale_explanation": "(in Fracunits) Scale relative to the player's. Value entered will be inserted as [value] * FRACUNIT", + "scale_divide": 1, + "scale_divide_explanation": "The value that the follower's scale will be divided by. Value entered will be inserted as [scale] * FRACUNIT / [scale_divide]. Combine with scale to make fractionary scales such as 2/5 (e.g. scale is set to 2 and scale_divide is set to 5), most useful for hi-res sprites.", "bubblescale": 0, "bubblescale_explanation": "(in Fracunits) Bubble scale relative to the player scale. If not set, no bubble will spawn.", "atangle": 230, diff --git a/Advanced templates/example_asymmetricalrotation_7statesfull_animated_chaoillustration/properties.txt b/Advanced templates/example_asymmetricalrotation_7statesfull_animated_chaoillustration/properties.txt index 5ed24ab2f750a5f1f01f656c05665d2db6f85c8b..86cf4892781fbe3ca657eee64d65b638fac6f2dc 100644 --- a/Advanced templates/example_asymmetricalrotation_7statesfull_animated_chaoillustration/properties.txt +++ b/Advanced templates/example_asymmetricalrotation_7statesfull_animated_chaoillustration/properties.txt @@ -18,6 +18,8 @@ "mode_explanation": "If floating (0) or on the ground (1).", "scale": 1, "scale_explanation": "(in Fracunits) Scale relative to the player's. Value entered will be inserted as [value] * FRACUNIT", + "scale_divide": 1, + "scale_divide_explanation": "The value that the follower's scale will be divided by. Value entered will be inserted as [scale] * FRACUNIT / [scale_divide]. Combine with scale to make fractionary scales such as 2/5 (e.g. scale is set to 2 and scale_divide is set to 5), most useful for hi-res sprites.", "bubblescale": 0, "bubblescale_explanation": "(in Fracunits) Bubble scale relative to the player scale. If not set, no bubble will spawn.", "atangle": 230, diff --git a/Advanced templates/example_symmetricalrotation_7statesfull_animated/properties.txt b/Advanced templates/example_symmetricalrotation_7statesfull_animated/properties.txt index 7e65f55bff36b393be8bdb75cf9f7d8b99ea5c2a..eff742c89cce1a56f8c060b25b8acdbece49f512 100644 --- a/Advanced templates/example_symmetricalrotation_7statesfull_animated/properties.txt +++ b/Advanced templates/example_symmetricalrotation_7statesfull_animated/properties.txt @@ -18,6 +18,8 @@ "mode_explanation": "If floating (0) or on the ground (1).", "scale": 1, "scale_explanation": "(in Fracunits) Scale relative to the player's. Value entered will be inserted as [value] * FRACUNIT", + "scale_divide": 1, + "scale_divide_explanation": "The value that the follower's scale will be divided by. Value entered will be inserted as [scale] * FRACUNIT / [scale_divide]. Combine with scale to make fractionary scales such as 2/5 (e.g. scale is set to 2 and scale_divide is set to 5), most useful for hi-res sprites.", "bubblescale": 0, "bubblescale_explanation": "(in Fracunits) Bubble scale relative to the player scale. If not set, no bubble will spawn.", "atangle": 230, diff --git a/Advanced templates/example_symmetricalrotation_7statesfull_animated_chaoillustration/properties.txt b/Advanced templates/example_symmetricalrotation_7statesfull_animated_chaoillustration/properties.txt index 7e65f55bff36b393be8bdb75cf9f7d8b99ea5c2a..eff742c89cce1a56f8c060b25b8acdbece49f512 100644 --- a/Advanced templates/example_symmetricalrotation_7statesfull_animated_chaoillustration/properties.txt +++ b/Advanced templates/example_symmetricalrotation_7statesfull_animated_chaoillustration/properties.txt @@ -18,6 +18,8 @@ "mode_explanation": "If floating (0) or on the ground (1).", "scale": 1, "scale_explanation": "(in Fracunits) Scale relative to the player's. Value entered will be inserted as [value] * FRACUNIT", + "scale_divide": 1, + "scale_divide_explanation": "The value that the follower's scale will be divided by. Value entered will be inserted as [scale] * FRACUNIT / [scale_divide]. Combine with scale to make fractionary scales such as 2/5 (e.g. scale is set to 2 and scale_divide is set to 5), most useful for hi-res sprites.", "bubblescale": 0, "bubblescale_explanation": "(in Fracunits) Bubble scale relative to the player scale. If not set, no bubble will spawn.", "atangle": 230, diff --git a/Basic templates/example/properties.txt b/Basic templates/example/properties.txt index 9d862e19a59bbc89c57873557e60e6578f16ac46..03c7bb7f7ec5b6679763f0b55b073199f6282805 100644 --- a/Basic templates/example/properties.txt +++ b/Basic templates/example/properties.txt @@ -18,6 +18,8 @@ "mode_explanation": "If floating (0) or on the ground (1).", "scale": 1, "scale_explanation": "(in Fracunits) Scale relative to the player's. Value entered will be inserted as [value] * FRACUNIT", + "scale_divide": 1, + "scale_divide_explanation": "The value that the follower's scale will be divided by. Value entered will be inserted as [scale] * FRACUNIT / [scale_divide]. Combine with scale to make fractionary scales such as 2/5 (e.g. scale is set to 2 and scale_divide is set to 5), most useful for hi-res sprites.", "bubblescale": 0, "bubblescale_explanation": "(in Fracunits) Bubble scale relative to the player scale. If not set, no bubble will spawn.", "atangle": 230, diff --git a/Basic templates/example_animated/properties.txt b/Basic templates/example_animated/properties.txt index 4c0a70ca1e40531088534273ab38030d0f1abf6a..9cf14e549e56c6fd5625cb2513bfb196aa323bd6 100644 --- a/Basic templates/example_animated/properties.txt +++ b/Basic templates/example_animated/properties.txt @@ -18,6 +18,8 @@ "mode_explanation": "If floating (0) or on the ground (1).", "scale": 1, "scale_explanation": "(in Fracunits) Scale relative to the player's. Value entered will be inserted as [value] * FRACUNIT", + "scale_divide": 1, + "scale_divide_explanation": "The value that the follower's scale will be divided by. Value entered will be inserted as [scale] * FRACUNIT / [scale_divide]. Combine with scale to make fractionary scales such as 2/5 (e.g. scale is set to 2 and scale_divide is set to 5), most useful for hi-res sprites.", "bubblescale": 0, "bubblescale_explanation": "(in Fracunits) Bubble scale relative to the player scale. If not set, no bubble will spawn.", "atangle": 230, diff --git a/Basic templates/example_asymmetricalrotation/properties.txt b/Basic templates/example_asymmetricalrotation/properties.txt index f26301a2bf2c104d00a64ae9faf515fb6f7b8a31..0987b3131e85bedefd296e7aefa43b2c6b55610e 100644 --- a/Basic templates/example_asymmetricalrotation/properties.txt +++ b/Basic templates/example_asymmetricalrotation/properties.txt @@ -18,6 +18,8 @@ "mode_explanation": "If floating (0) or on the ground (1).", "scale": 1, "scale_explanation": "(in Fracunits) Scale relative to the player's. Value entered will be inserted as [value] * FRACUNIT", + "scale_divide": 1, + "scale_divide_explanation": "The value that the follower's scale will be divided by. Value entered will be inserted as [scale] * FRACUNIT / [scale_divide]. Combine with scale to make fractionary scales such as 2/5 (e.g. scale is set to 2 and scale_divide is set to 5), most useful for hi-res sprites.", "bubblescale": 0, "bubblescale_explanation": "(in Fracunits) Bubble scale relative to the player scale. If not set, no bubble will spawn.", "atangle": 230, diff --git a/Basic templates/example_asymmetricalrotation_animated/properties.txt b/Basic templates/example_asymmetricalrotation_animated/properties.txt index 096a05ad2a2f14ea6516a7c6a9f749faeae2e85d..8a6136a54ec81e19d285b665356838a1c0cc1703 100644 --- a/Basic templates/example_asymmetricalrotation_animated/properties.txt +++ b/Basic templates/example_asymmetricalrotation_animated/properties.txt @@ -18,6 +18,8 @@ "mode_explanation": "If floating (0) or on the ground (1).", "scale": 1, "scale_explanation": "(in Fracunits) Scale relative to the player's. Value entered will be inserted as [value] * FRACUNIT", + "scale_divide": 1, + "scale_divide_explanation": "The value that the follower's scale will be divided by. Value entered will be inserted as [scale] * FRACUNIT / [scale_divide]. Combine with scale to make fractionary scales such as 2/5 (e.g. scale is set to 2 and scale_divide is set to 5), most useful for hi-res sprites.", "bubblescale": 0, "bubblescale_explanation": "(in Fracunits) Bubble scale relative to the player scale. If not set, no bubble will spawn.", "atangle": 230, diff --git a/Basic templates/example_symmetricalrotation/properties.txt b/Basic templates/example_symmetricalrotation/properties.txt index 454a00766417e54bbf4d0d0ffeb7a963c34e3d26..1f6b6826962f9b5f5c03cf8dca57da161175c733 100644 --- a/Basic templates/example_symmetricalrotation/properties.txt +++ b/Basic templates/example_symmetricalrotation/properties.txt @@ -18,6 +18,8 @@ "mode_explanation": "If floating (0) or on the ground (1).", "scale": 1, "scale_explanation": "(in Fracunits) Scale relative to the player's. Value entered will be inserted as [value] * FRACUNIT", + "scale_divide": 1, + "scale_divide_explanation": "The value that the follower's scale will be divided by. Value entered will be inserted as [scale] * FRACUNIT / [scale_divide]. Combine with scale to make fractionary scales such as 2/5 (e.g. scale is set to 2 and scale_divide is set to 5), most useful for hi-res sprites.", "bubblescale": 0, "bubblescale_explanation": "(in Fracunits) Bubble scale relative to the player scale. If not set, no bubble will spawn.", "atangle": 230, diff --git a/Basic templates/example_symmetricalrotation_2states_animated/properties.txt b/Basic templates/example_symmetricalrotation_2states_animated/properties.txt index e54b26ecf5ca661bf70c21a5f0f3951258aae633..1ee6f697b8ea02b1a9ccf4b9e2d93f1f5e09f5b7 100644 --- a/Basic templates/example_symmetricalrotation_2states_animated/properties.txt +++ b/Basic templates/example_symmetricalrotation_2states_animated/properties.txt @@ -18,6 +18,8 @@ "mode_explanation": "If floating (0) or on the ground (1).", "scale": 1, "scale_explanation": "(in Fracunits) Scale relative to the player's. Value entered will be inserted as [value] * FRACUNIT", + "scale_divide": 1, + "scale_divide_explanation": "The value that the follower's scale will be divided by. Value entered will be inserted as [scale] * FRACUNIT / [scale_divide]. Combine with scale to make fractionary scales such as 2/5 (e.g. scale is set to 2 and scale_divide is set to 5), most useful for hi-res sprites.", "bubblescale": 0, "bubblescale_explanation": "(in Fracunits) Bubble scale relative to the player scale. If not set, no bubble will spawn.", "atangle": 230, diff --git a/Basic templates/example_symmetricalrotation_7states_animated/properties.txt b/Basic templates/example_symmetricalrotation_7states_animated/properties.txt index 26707d26d8a8481a02bc5d7376b39be0ccf537ce..889507a9297a6a884dc2c73f5c5d8f8f58b7313f 100644 --- a/Basic templates/example_symmetricalrotation_7states_animated/properties.txt +++ b/Basic templates/example_symmetricalrotation_7states_animated/properties.txt @@ -18,6 +18,8 @@ "mode_explanation": "If floating (0) or on the ground (1).", "scale": 1, "scale_explanation": "(in Fracunits) Scale relative to the player's. Value entered will be inserted as [value] * FRACUNIT", + "scale_divide": 1, + "scale_divide_explanation": "The value that the follower's scale will be divided by. Value entered will be inserted as [scale] * FRACUNIT / [scale_divide]. Combine with scale to make fractionary scales such as 2/5 (e.g. scale is set to 2 and scale_divide is set to 5), most useful for hi-res sprites.", "bubblescale": 0, "bubblescale_explanation": "(in Fracunits) Bubble scale relative to the player scale. If not set, no bubble will spawn.", "atangle": 230, diff --git a/Basic templates/example_symmetricalrotation_animated/properties.txt b/Basic templates/example_symmetricalrotation_animated/properties.txt index bee2ea02d8f41e3c18c1fd0e98d2f0246c9d927d..61bc6beb5c5ddacea67fc0f1bdd20d172e6488ea 100644 --- a/Basic templates/example_symmetricalrotation_animated/properties.txt +++ b/Basic templates/example_symmetricalrotation_animated/properties.txt @@ -18,6 +18,8 @@ "mode_explanation": "If floating (0) or on the ground (1).", "scale": 1, "scale_explanation": "(in Fracunits) Scale relative to the player's. Value entered will be inserted as [value] * FRACUNIT", + "scale_divide": 1, + "scale_divide_explanation": "The value that the follower's scale will be divided by. Value entered will be inserted as [scale] * FRACUNIT / [scale_divide]. Combine with scale to make fractionary scales such as 2/5 (e.g. scale is set to 2 and scale_divide is set to 5), most useful for hi-res sprites.", "bubblescale": 0, "bubblescale_explanation": "(in Fracunits) Bubble scale relative to the player scale. If not set, no bubble will spawn.", "atangle": 230, diff --git a/src/main.c b/src/main.c index ee4470f784edbac0204eff5fc5bb2effec168538..c968c15a4e4e7659c883073705c535fd82e38650 100644 --- a/src/main.c +++ b/src/main.c @@ -35,7 +35,7 @@ #define MAX_IMAGE_SIZE 256*256 // it's only a snippet, the whole thing can't be a macro since it's variable now -#define FOLLOWER_SOC_SNIPPET_TEMPLATE "%s\nFOLLOWER\nName = %s\nIcon = ICOF%s\nCategory = %s\nHornSound = DSFH%s\nDefaultColor = %s\nMode = %s\nScale = %d*FRACUNIT\nBubbleScale = %d*FRACUNIT\nAtAngle = %d\nDistance = %d*FRACUNIT\nHeight = %d*FRACUNIT\nZOffs = %d*FRACUNIT\nHorzLag = %d*FRACUNIT\nVertLag = %d*FRACUNIT\nAngleLag = %d*FRACUNIT\nBobAmp = %d*FRACUNIT\nBobSpeed = %d*FRACUNIT\nHitConfirmTime = %d\nRingTime = %d\n" +#define FOLLOWER_SOC_SNIPPET_TEMPLATE "%s\nFOLLOWER\nName = %s\nIcon = ICOF%s\nCategory = %s\nHornSound = DSFH%s\nDefaultColor = %s\nMode = %s\nScale = %d*FRACUNIT/%d\nBubbleScale = %d*FRACUNIT\nAtAngle = %d\nDistance = %d*FRACUNIT\nHeight = %d*FRACUNIT\nZOffs = %d*FRACUNIT\nHorzLag = %d*FRACUNIT\nVertLag = %d*FRACUNIT\nAngleLag = %d*FRACUNIT\nBobAmp = %d*FRACUNIT\nBobSpeed = %d*FRACUNIT\nHitConfirmTime = %d\nRingTime = %d\n" #define FOLLOWERNAMESIZE 16 @@ -72,6 +72,7 @@ struct followerstructthingwhatever { char prefcolor[32]; char mode[8]; // if floating or on ground char scale; + char scale_divide; char bubblescale; short atangle; char distance; @@ -777,6 +778,8 @@ void addFollower(struct wadfile* wad) if (cJSON_GetObjectItem(metadata, "scale")) kfollower.scale = cJSON_GetObjectItem(metadata, "scale")->valueint; + if (cJSON_GetObjectItem(metadata, "scale_divide")) + kfollower.scale_divide = cJSON_GetObjectItem(metadata, "scale_divide")->valueint; if (cJSON_GetObjectItem(metadata, "bubblescale")) kfollower.bubblescale = cJSON_GetObjectItem(metadata, "bubblescale")->valueint; if (cJSON_GetObjectItem(metadata, "atangle")) @@ -1035,6 +1038,7 @@ void addFollower(struct wadfile* wad) kfollower.prefcolor, kfollower.mode, kfollower.scale, + kfollower.scale_divide, kfollower.bubblescale, kfollower.atangle, kfollower.distance,