4 Commits
Author SHA1 Message Date
NyakoFox 135763066e Add different size modes to damage blocks
This commit adds some `p3` values to damage blocks:
- `1` simulates "top spikes", which have a flatter top.
- `2` simulates "bottom spikes", which have a flatter bottom.
- `3` simulates "side spikes", which do both.

These match the damage blocks that get spawned by spike entities. If we
add editor tools, that means it'll be possible to simulate new spikes
without having to use a script to place them.
2026-11-13 15:58:50 -05:00
NyakoFoxandDav999 7d163c0f93 Add edentity blocks & associated script commands
This PR is a redo of #909 which improves the edentity handling,
abstracting activity zone types to level data rather than being a part
of entity data. This commit allows users to place down the game's
"blocks" in the editor, being collision blocks, hurt boxes, gamestate
triggers, script boxes, activity zones, "safe" boxes, and one-ways.

Activity zones now have some level XML to allow defining new activity
zone IDs:
```xml
<ActivityZones>
    <activityZone id="36" colour="red"></activityZone>
    <activityZone id="37" colour="orange">Press {button} to do something</activityZone>
</ActivityZones>
```

These add IDs 36 and 37 (with 0-35 replacing the built-in ones), for
use with custom spawned or placed activity zones. If the text is empty,
it will use the built-in localization string "Press {button} to
interact", and if "colour" is missing, it will default to "orange".

New commands:

- `createcollision(x,y,w,h)` - Creates a collision block
- `createtrigger(x,y,w,h,gamestate)` - Creates a gamestate trigger
- `createscript(x,y,w,h,script)` - Creates a (custom!) script box
- `createdamage(x,y,w,h)` - Creates a damage block
- `createdirectional(x,y,w,h,dir)` - Creates a "directional" block
- `createsafe(x,y,w,h)` - Creates a "safe" block
- `createactivity(x,y,w,h,script[,id])` - Creates an activity zone

If `id` is not passed into `createactivity`, it will default to 35.

Custom activity zones created this way can also be affected by
`setactivitytext`, `setactivitycolour` and `setactivityposition`.

Co-authored-by: Dav999 <dav999.tolp@gmail.com>
2026-11-13 15:58:50 -05:00
Terry Cavanagh fc89b2e7bf added "non-commercial" to the total conversation exception
I think this basically guards against most bad actors I can think of, e.g. people using the music for an unrelated commercial project
2026-11-13 14:32:50 +00:00
Terry Cavanagh f97197458a Update License exceptions.md 2026-11-13 14:32:50 +00:00
10 changed files with 293 additions and 13 deletions

No files matched your search

+6 -1
View File
@@ -1,7 +1,10 @@
VVVVVV's source code is made available under a [custom license](LICENSE.md), which states that you must not distribute any materials from the game (i.e. the game's assets) which are not included in this repo unless approved by us in writing. In general, if you're interested in creating something that falls outside the license terms, get in touch with [Terry](http://distractionware.com/email/)!
There is an important general exception: if you're compiling a [Make
There are three important general exceptions:
- If you're compiling a [Make
and Play](https://thelettervsixtim.es/makeandplay/) version of the game, then you can you freely distribute the game's assets.
- If you are making a non-commercial "total conversion", that is, a modified version of VVVVVV that does not contain the game's original levels, then you can freely distribute the game's assets.
- If you're making a non-commercial port of the game for a platform that doesn't already have an official build (currently: Windows, Mac, Linux, iOS, Android, Nintendo 3DS, Nintendo Switch, Sony PS4, Sony PS5, Sony PSVita, OUYA), then you can freely distribute the game's assets.
The following is a list of projects which have been given permission by Terry to distribute the assets with distributions of the game, and under what conditions.
@@ -11,6 +14,8 @@ Exceptions granted to the VVVVVV source code license
| Project | Creator | Description | Conditions | Link |
|---|---|---|---|---|
| Any distribution of the VVVVVV: Make and Play edition | | All distributions and packages of the Make and Play edition can freely distribute the data assets, so long as they compile with the makeandplay define and do not distribute the original levels.| Must compile with the makeandplay define set, cannot distribute the original levels. | |
| Non-Commercial Total conversions of VVVVVV | | Non-Commercial Total conversions of VVVVVV can freely distribute the data assets, so long as they do not distribute the original levels.| Cannot distribute the original levels. | |
| Non-Commercial ports to platforms that don't have an official version of the game | | Non-Commercial ports of VVVVVV can freely distribute the data assets, so long as they are not for platforms that already have an official build (currently: Windows, Mac, Linux, iOS, Android, Nintendo 3DS, Nintendo Switch, Sony PS4, Sony PS5, Sony PSVita, OUYA).| Platform must not have an official build already. | |
| VVVVVV: Make and Play Edition |[Terry Cavanagh](http://distractionware.com/)|The free and official version of VVVVVV that includes player levels, and the tools to create your own levels, but does not include the original levels from the game.| Must compile with the makeandplay define set, cannot distribute the original levels. | [download](https://thelettervsixtim.es/makeandplay/) |
| Ved | [Dav999 and InfoTeddy](https://github.com/Daaaav/Ved/graphs/contributors) | An external editor for VVVVVV levels. | No conditions. | [download](https://tolp.nl/ved/), [github repo](https://github.com/Daaaav/Ved) |
| VVVVVV: Community Edition | https://github.com/v6cord/VVVVVV-CE/graphs/contributors | Community fork of VVVVVV focused on expanding the capabilities of player levels. | Must compile with the makeandplay define set, cannot distribute the original levels. | [github repo](https://github.com/v6cord/VVVVVV-CE) |
+6
View File
@@ -5,6 +5,12 @@
#include <stdint.h>
#include <string>
struct ActivityZone
{
std::string colour;
std::string text;
};
class blockclass
{
public:
+46
View File
@@ -7,6 +7,7 @@
#include <tinyxml2.h>
#include "Alloc.h"
#include "BlockV.h"
#include "Constants.h"
#include "Editor.h"
#include "Enums.h"
@@ -406,6 +407,8 @@ void customlevelclass::reset(void)
map.specialroomnames.clear();
player_colour = 0;
custom_activity_zones.clear();
}
const int* customlevelclass::loadlevel( int rxi, int ryi )
@@ -1430,6 +1433,49 @@ next:
player_colour = help.Int(pText);
game.savecolour = player_colour;
}
if (SDL_strcmp(pKey, "ActivityZones") == 0)
{
for (tinyxml2::XMLElement* activityZoneElement = pElem->FirstChildElement(); activityZoneElement; activityZoneElement = activityZoneElement->NextSiblingElement())
{
if (SDL_strcmp(activityZoneElement->Value(), "activityZone") == 0)
{
int id = -1;
activityZoneElement->QueryIntAttribute("id", &id);
if (id < 0)
{
continue;
}
const char* colour = activityZoneElement->Attribute("colour");
const char* text = activityZoneElement->GetText();
ActivityZone zone;
if (colour != NULL)
{
zone.colour = std::string(colour);
}
else
{
zone.colour = "";
}
if (text != NULL)
{
zone.text = std::string(text);
}
else
{
zone.text = "";
}
custom_activity_zones[id] = zone;
}
}
}
}
if (mapwidth < maxwidth)
+5
View File
@@ -2,9 +2,12 @@
#define CUSTOMLEVELS_H
#include <SDL3/SDL.h>
#include <map>
#include <string>
#include <vector>
#include "BlockV.h"
class CustomEntity
{
public:
@@ -172,6 +175,8 @@ public:
bool onewaycol_override;
int player_colour;
std::map<int, ActivityZone> custom_activity_zones;
};
bool translate_title(const std::string& title);
+90
View File
@@ -1117,6 +1117,96 @@ static void draw_entities(void)
font::print(PR_FONT_LEVEL | PR_BOR | PR_CJK_HIGH, x, y - 8, entity->scriptname, 210, 210, 255);
}
break;
case 20: // Activity Zones
graphics.draw_rect(x, y, entity->p1 * 8, entity->p2 * 8, graphics.getRGB(164, 164, 255));
graphics.draw_rect(x, y, 8, 8, graphics.getRGB(255, 255, 255));
if (i == edent_under_cursor)
{
font::print(PR_FONT_LEVEL | PR_BOR | PR_CJK_HIGH, x, y - 8, entity->scriptname, 210, 210, 255);
}
break;
case 21: // Collision Boxes
graphics.draw_rect(x, y, entity->p1 * 8, entity->p2 * 8, graphics.getRGB(255, 255, 255));
graphics.draw_rect(x, y, 8, 8, graphics.getRGB(255, 255, 255));
break;
case 22: // Damage Boxes
{
int draw_y = y;
int height = entity->p2 * 8;
switch (entity->p3)
{
default:
break;
case 1:
// Top Spikes
draw_y += 4;
height -= 4;
break;
case 2:
// Bottom Spikes
height -= 4;
break;
case 3:
// Side Spikes
draw_y += 3;
height -= 6;
break;
}
int skull_x = x + (entity->p1 - 1) * 4;
int skull_y = draw_y + (height - 8) / 2;
font::print(PR_FONT_8X8 | PR_BOR, skull_x, skull_y, "\xE2\x98\xA0", 255, 255, 255);
graphics.draw_rect(x, draw_y, entity->p1 * 8, height, graphics.getRGB(255, 164, 164));
graphics.draw_rect(x, y, 8, 8, graphics.getRGB(255, 255, 255));
break;
}
case 23: // Directional Boxes
{
// Move x and y to the center of the box
int arrow_x = x + (entity->p1 - 1) * 4;
int arrow_y = y + (entity->p2 - 1) * 4;
if (customentities[i].p3 == 0)
{
// UP ARROW
font::print(PR_FONT_8X8 | PR_BOR, arrow_x, arrow_y, "\xE2\x86\x91", 255, 255, 255);
}
else if (customentities[i].p3 == 1)
{
// DOWN ARROW
font::print(PR_FONT_8X8 | PR_BOR, arrow_x, arrow_y, "\xE2\x86\x93", 255, 255, 255);
}
else if (customentities[i].p3 == 2)
{
// LEFT ARROW
font::print(PR_FONT_8X8 | PR_BOR, arrow_x, arrow_y, "\xE2\x86\x90", 255, 255, 255);
}
else if (customentities[i].p3 == 3)
{
// RIGHT ARROW
font::print(PR_FONT_8X8 | PR_BOR, arrow_x, arrow_y, "\xE2\x86\x92", 255, 255, 255);
}
graphics.draw_rect(x, y, entity->p1 * 8, entity->p2 * 8, graphics.getRGB(255, 255, 164));
break;
}
case 24: // Safe Boxes
graphics.draw_rect(x, y, entity->p1 * 8, entity->p2 * 8, graphics.getRGB(164, 255, 255));
graphics.draw_rect(x, y, 8, 8, graphics.getRGB(255, 255, 255));
break;
case 25: // Gamestate Triggers
{
graphics.draw_rect(x, y, entity->p1 * 8, entity->p2 * 8, graphics.getRGB(164, 255, 164));
graphics.draw_rect(x, y, 8, 8, graphics.getRGB(255, 255, 255));
int arrow_x = x + (entity->p1 - 1) * 4;
int arrow_y = y + (entity->p2 - 1) * 4;
font::print(PR_FONT_LEVEL | PR_BOR | PR_CJK_HIGH, arrow_x, arrow_y, help.String(entity->p3), 255, 255, 255);
break;
}
case 50: // Warp Lines
if (entity->p1 >= 2) // Horizontal
{
+37 -8
View File
@@ -3,6 +3,7 @@
#include <SDL3/SDL.h>
#include "BlockV.h"
#include "CustomLevels.h"
#include "Font.h"
#include "Game.h"
@@ -776,7 +777,7 @@ void entityclass::generateswnwave( int t )
}
}
void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= 0*/, const std::string& script /*= ""*/, bool custom /*= false*/)
void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= 0*/, const std::string& script /*= ""*/, ActivityContext context /*= ActivityContext_NORMAL*/)
{
k = blocks.size();
@@ -853,6 +854,8 @@ void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*=
block.hp = h;
block.rectset(xp, yp, w, h);
int original_trig = trig;
//Ok, each and every activity zone in the game is initilised here. "Trig" in this case is a variable that
//assigns all the details.
switch(trig)
@@ -1068,7 +1071,7 @@ void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*=
trig=0;
break;
case 35:
if (custom)
if (context != ActivityContext_NORMAL)
{
block.prompt = "Press {button} to interact";
}
@@ -1076,24 +1079,47 @@ void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*=
{
block.prompt = "Press {button} to activate terminal";
}
block.script = "custom_"+customscript;
block.script = "custom_" + customscript;
block.setblockcolour("orange");
trig=0;
break;
}
default:
block.script = "custom_" + customscript;
block.prompt = "Press {button} to interact";
block.setblockcolour("orange");
break;
}
block.gettext = true;
if (context == ActivityContext_CUSTOM)
{
block.script = "custom_" + customscript;
}
// Handle custom-defined activity zones
if (cl.custom_activity_zones.count(original_trig) > 0)
{
ActivityZone zone = cl.custom_activity_zones[original_trig];
if (zone.colour != "")
{
block.setblockcolour(zone.colour.c_str());
}
if (zone.text != "")
{
block.prompt = zone.text;
block.gettext = false;
}
}
if (customactivitytext != "")
{
block.prompt = customactivitytext;
block.gettext = false;
customactivitytext = "";
}
else
{
block.gettext = true;
}
if (customactivitycolour != "")
{
@@ -1111,6 +1137,9 @@ void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*=
block.activity_y = 0;
}
break;
}
if (!reuse)
{
blocks.push_back(block);
+8 -1
View File
@@ -20,6 +20,13 @@ enum
ACTIVITY = 5
};
enum ActivityContext
{
ActivityContext_NORMAL = 0,
ActivityContext_INTERACT = 1,
ActivityContext_CUSTOM = 2
};
class entityclass
{
public:
@@ -52,7 +59,7 @@ public:
void generateswnwave(int t);
void createblock(int t, int xp, int yp, int w, int h, int trig = 0, const std::string& script = "", bool custom = false);
void createblock(int t, int xp, int yp, int w, int h, int trig = 0, const std::string& script = "", ActivityContext context = ActivityContext_NORMAL);
bool disableentity(int t);
+49 -1
View File
@@ -90,6 +90,8 @@ mapclass::mapclass(void)
currentregion = 0;
SDL_zeroa(region);
tempscriptbox = 0;
}
static char roomname_static[SCREEN_WIDTH_CHARS];
@@ -1815,7 +1817,9 @@ void mapclass::loadlevel(int rx, int ry)
// Entities have to be created HERE, akwardly
int tempcheckpoints = 0;
int tempscriptbox = 0;
tempscriptbox = 0;
for (size_t edi = 0; edi < customentities.size(); edi++)
{
// If entity is in this room, create it
@@ -1954,6 +1958,50 @@ void mapclass::loadlevel(int rx, int ry)
obj.createblock(TRIGGER, ex, ey, ent.p1 * 8, ent.p2 * 8, 300 + tempscriptbox, "custom_" + ent.scriptname);
tempscriptbox++;
break;
case 20: // Activity Zone
obj.customscript = ent.scriptname;
obj.createblock(ACTIVITY, ex, ey, ent.p1 * 8, ent.p2 * 8, ent.p3, "custom_" + ent.scriptname, ActivityContext_CUSTOM);
break;
case 21: // Collision Box
obj.createblock(BLOCK, ex, ey, ent.p1 * 8, ent.p2 * 8);
break;
case 22: // Damage Box
{
int y = ey;
int height = ent.p2 * 8;
switch (ent.p3)
{
default:
break;
case 1:
// Top Spikes
y += 4;
height -= 4;
break;
case 2:
// Bottom Spikes
height -= 4;
break;
case 3:
// Side Spikes
y += 3;
height -= 6;
break;
}
obj.createblock(DAMAGE, ex, y, ent.p1 * 8, height);
break;
}
case 23: // Directional Box
obj.createblock(DIRECTIONAL, ex, ey, ent.p1 * 8, ent.p2 * 8, ent.p3);
break;
case 24: // Safe Box
obj.createblock(SAFE, ex, ey, ent.p1 * 8, ent.p2 * 8);
break;
case 25: // Trigger
obj.createblock(TRIGGER, ex, ey, ent.p1 * 8, ent.p2 * 8, ent.p3);
break;
case 50: // Warp Lines
obj.customwarpmode=true;
switch (ent.p1)
+2
View File
@@ -230,6 +230,8 @@ public:
int regionwidth, regionheight;
MapRenderData get_render_data(void);
int tempscriptbox;
};
#ifndef MAP_DEFINITION
+44 -2
View File
@@ -1048,6 +1048,47 @@ void scriptclass::run(void)
words[8] = word8;
words[9] = word9;
}
else if (words[0] == "createcollision")
{
obj.createblock(BLOCK, ss_toi(words[1]), ss_toi(words[2]), ss_toi(words[3]), ss_toi(words[4]));
}
else if (words[0] == "createtrigger")
{
obj.createblock(TRIGGER, ss_toi(words[1]), ss_toi(words[2]), ss_toi(words[3]), ss_toi(words[4]), ss_toi(words[5]));
}
else if (words[0] == "createscript")
{
if (INBOUNDS_ARR(map.tempscriptbox, game.customscript))
{
game.customscript[map.tempscriptbox] = words[5];
}
obj.createblock(TRIGGER, ss_toi(words[1]), ss_toi(words[2]), ss_toi(words[3]), ss_toi(words[4]), 300 + map.tempscriptbox, "custom_" + words[5]);
map.tempscriptbox++;
}
else if (words[0] == "createdamage")
{
obj.createblock(DAMAGE, ss_toi(words[1]), ss_toi(words[2]), ss_toi(words[3]), ss_toi(words[4]));
}
else if (words[0] == "createdirectional")
{
obj.createblock(DIRECTIONAL, ss_toi(words[1]), ss_toi(words[2]), ss_toi(words[3]), ss_toi(words[4]), ss_toi(words[5]));
}
else if (words[0] == "createsafe")
{
obj.createblock(SAFE, ss_toi(words[1]), ss_toi(words[2]), ss_toi(words[3]), ss_toi(words[4]));
}
else if (words[0] == "createactivity")
{
int id = 35;
if (argexists[6])
{
id = ss_toi(words[6]);
}
obj.customscript = words[5];
obj.createblock(ACTIVITY, ss_toi(words[1]), ss_toi(words[2]), ss_toi(words[3]), ss_toi(words[4]), id, words[5], ActivityContext_CUSTOM);
}
else if (words[0] == "createcrewman")
{
// Note: Do not change the "r" variable, it's used in custom levels
@@ -1894,11 +1935,11 @@ void scriptclass::run(void)
int crewman = obj.getcrewman(crew_color);
if (INBOUNDS_VEC(crewman, obj.entities) && crew_color == EntityColour_CREW_GREEN)
{
obj.createblock(5, obj.entities[crewman].xp - 32, obj.entities[crewman].yp-20, 96, 60, i, "", (i == 35));
obj.createblock(5, obj.entities[crewman].xp - 32, obj.entities[crewman].yp-20, 96, 60, i, "", (i == 35) ? ActivityContext_INTERACT : ActivityContext_NORMAL);
}
else if (INBOUNDS_VEC(crewman, obj.entities))
{
obj.createblock(5, obj.entities[crewman].xp - 32, 0, 96, 240, i, "", (i == 35));
obj.createblock(5, obj.entities[crewman].xp - 32, 0, 96, 240, i, "", (i == 35) ? ActivityContext_INTERACT : ActivityContext_NORMAL);
}
}
else if (words[0] == "setactivitycolour")
@@ -2773,6 +2814,7 @@ void scriptclass::startgamemode(const enum StartMode mode)
add_default_colours();
cl.onewaycol_override = false;
cl.player_colour = 0;
cl.custom_activity_zones.clear();
break;
}