Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0942bd6
Remove .vscode
Declan-Reid Jan 28, 2024
43dce0f
Remove extra instance of AmmoText and apparently update files?
Declan-Reid Feb 6, 2024
3e6167b
Make Water_cover scroll with water
Declan-Reid Feb 6, 2024
7c89788
Gun icon is now visible
Declan-Reid Feb 6, 2024
2d27466
Remove instance of mouse_point.
Declan-Reid Feb 6, 2024
e902ea1
Add layer-correction.py which corrects z-layers according to
Declan-Reid Apr 20, 2024
9692c28
Add a script to collect data about instances. Currently only collects…
Declan-Reid Apr 20, 2024
e2d9632
Merge branch 'master' of https://github.com/Declan-Reid/GDevelop-Open…
Declan-Reid Apr 20, 2024
76d478c
Update z-layers in city1.json
Declan-Reid Apr 20, 2024
915bc6a
Test MacOS build update
Declan-Reid Apr 20, 2024
f2dcde2
manual dispatch
Declan-Reid Apr 20, 2024
481d287
Temp change url for testing purposes
Declan-Reid Apr 20, 2024
0005680
Revert build changes
Declan-Reid Apr 20, 2024
fa6a84d
Redirect python to python3 in builds for mac
Declan-Reid Apr 20, 2024
3aea7f0
Use sudo in alias
Declan-Reid Apr 20, 2024
f67154b
Change to installing python
Declan-Reid Apr 20, 2024
972238b
Change python version
Declan-Reid Apr 20, 2024
165c259
Remove .18 from python version
Declan-Reid Apr 20, 2024
50f3f4a
Different approach
Declan-Reid Apr 20, 2024
75420a4
I forgot the 3
Declan-Reid Apr 20, 2024
7d5fb5b
move command and fix path
Declan-Reid Apr 20, 2024
bd57889
Merge branch 'master' into pr/209
TheGemDev Apr 20, 2024
5262031
Merge branch 'Gdevelop-game:master' into master
Declan-Reid Apr 26, 2024
8bee421
Update example usage
Declan-Reid Apr 26, 2024
7a86dfd
Add a changes check
Declan-Reid Apr 26, 2024
f228713
haha build go brrr
Declan-Reid Apr 26, 2024
4d3c3c9
better
Declan-Reid Apr 26, 2024
ec36e7f
Merge branch 'Gdevelop-game:master' into master
Declan-Reid Jun 23, 2024
be5fd1c
Fix Z-Layering of some objects
Declan-Reid Jun 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ jobs:
cd Project/build/gdExport
npm i --save-dev electron-builder
export PYTHON_PATH=/usr/bin/python3
./node_modules/.bin/electron-builder -m dmg
./node_modules/.bin/electron-builder

- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
# Upload all potential executables
name: mac
path: Project/build/gdExport/dist/*.dmg
path: Project/build/gdExport/dist/*.*

build_for_windows:
runs-on: windows-latest
Expand Down
72 changes: 72 additions & 0 deletions scripts/collect-layout-data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# Declan Reid 2024
#
# This is a simple script to collect all the data from a
# layout file in a format usable in scripts.
#
# To run this script, invoke it from the root of the repo as such:
# $ python3 scripts/collect-layout-data.py src/layouts/{scene}.json
# For example:
# $ python3 scripts/collect-layout-data.py src/layouts/city.json
# This will generate a new version of the file in the root of the repo.
# You can then open this file and use the data to your heart's content.
#


#
# THIS SCRIPT IS NOT COMPLETE, BUT IS FUNCTIONAL IN SOME FORM
#

import sys
import json

if len(sys.argv) < 2:
print("There's not enough arguments!")
exit()

filePath = sys.argv[1]

print("Opening "+str(filePath)+"...")

try:
fileToConvert = open(filePath, 'r')
print("Success!")
except FileNotFoundError:
print("Failed! That file doesn't seem to exist!")
exit()

print("Converting the file to JSON type...")

try:
fileJSON = json.loads(fileToConvert.read())
fileToConvert.close()
print("Success!")
except json.decoder.JSONDecodeError:
print("Failed! Something about that JSON isn't right!")
exit()

print("Collecting objects...")

try:
objects = fileJSON["instances"]
print("Success!")
except KeyError:
print("Failed! The objects section (instances) was unable to be found!")
exit()

print("Time to iterate!")

object_names = [

]

for object in objects:
if object["name"] not in object_names:
object_names.append(object["name"])

print(object_names)

# print('{')
# for name in sorted(object_names):
# print('"'+name+'": 1,')
# print('}')
148 changes: 148 additions & 0 deletions scripts/layer-correction.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
#
# Declan Reid 2024
#
# This is a simple script to fix z-layers on objects.
# This will set all objects to an established "correct" height,
# ensuring that we aren't getting objects with a Z Order of 12643524.
#
# To run this script, invoke it from the root of the repo as such:
# $ python3 scripts/layer-correction.py src/layouts/{scene}.json
# For example:
# $ python3 scripts/layer-correction.py src/layouts/city.json
# This will generate a new version of the file in the root of the repo.
# You can then copy this file into the layouts folder.
#

values = {
"AmmoText": 98, # How much ammo you have
"Fences": 5, # Fences
"Health": 98, # Health
"Niko": 50, # Player
"Placeholder": 49, # This acts as the player collision
"Transitions": 1, # Fading into rooms
"Water": 0, # This is water
"Water_cover": 0, # This is non-swimmable water, used under sand edges
"Wheel_info": 98, # Which weapon is being used
"You_lose": 99, # WASTED
"ammo": 45, # Ammo found that you can reload with
"beach_sand_1": 1, # The main sand on a beach
"beach_sand_2": 1, # The outer sand on a beach
"bridge": 10, # The frame above the bridge
"concrete_1": 1, # Pathing on the side of the bridge
"crossair": 100, # Crosshair
"deco": 55, # Things like umbrellas
"door": 1, # Door trigger
"energy": 45, # Ammo for taser
"flame_thrower_fire": 53, # Fire from the flamethrower
"flame_thrower_fire_collision": 53, # Collision for the fire from the flamethrower
"foliage": 54, # Trees
"grass_tiled": 1, # Grass
"green_leaves_particle": 48, # Particles from walking into a tree
"ground_1": 1, # The basketball ground
"ground_elements": 1, # Lines on the court
"gun1": 1, # Pistol
"gun2": 1, # Rifle
"gun3": 1, # Flamethrower
"gun4": 1, # Sniper
"gun5": 1, # Rocket Launcher
"hidden_separate": 1, # Used as bridge border
"mele1": 1, # Taser
"mele2": 1, # Knife
"mouse_point": 100, # Little black square. Perhaps the old crosshair
"reloading": 1, # "Reloading" text
"road": 1, # This is all forms of the road
"road_1": 1, # This is an extra version of the road, used in the lower map.
"road_2": 1, # This is an extra version of the road, used in the lower map.
"road_3": 1, # This is an extra version of the road, used in the lower map.
"road_4": 1, # This is an extra version of the road, used in the lower map.
"road_block": 4, # Temp road barriers
"roof_tops": 60, # Roof
"sand": 1, # This is all forms of sand
"sand_1": 1, # This is an extra version of the sand, used in the lower map.
"sand_2": 1, # This is an extra version of the sand, used in the lower map.
"sports_equipments": 6, # Basketball hoop
"sports_equipments_movable": 6, # Basketball
"trash_movable": 6, # The pushable boxes
"weapon_icons": 98, # Weapon icons
"weaponholding": 98, # Name of held weapon
}




import sys
import json

if len(sys.argv) < 2:
print("There's not enough arguments!")
exit()

filePath = sys.argv[1]

print("Opening %s..." % filePath)

try:
fileToConvert = open(filePath, 'r')
print("Success!")
except FileNotFoundError:
print("Failed! That file doesn't seem to exist!")
exit()

print("Converting the file to JSON type...")

try:
fileJSON = json.loads(fileToConvert.read())
fileToConvert.close()
print("Success!")
except json.decoder.JSONDecodeError:
print("Failed! Something about that JSON isn't right!")
exit()

print("Collecting objects...")

try:
instances = fileJSON["instances"]
print("Success!")
except KeyError:
print("Failed! The objects section (instances) was unable to be found!")
exit()

print("Time to iterate!")

try:
changedThings = False

for instance in instances:
if instance["name"] in values:
if not instance["zOrder"] == values[instance["name"]]:
instance["zOrder"] = values[instance["name"]]
changedThings = True
print('Changed the zOrder of %s with uuid %s to %s' % (instance["name"], instance["persistentUuid"], values[instance["name"]]))
else:
print('Instance of %s and uuid %s did not have a set value and was not changed.' % (instance["name"], instance["persistentUuid"]))

if not changedThings:
print('Nothing changed! Exiting...')
exit()

except Exception as e:
print('An exception occured while iterating through instances.')
print(e)
exit()

print('Saving instances list back to json')
fileJSON["instances"] = instances

fileName = filePath.split('/')[-1]
print("Saving json to file %s" % fileName)

try:
file = open(fileName, 'w')
file.write(str(fileJSON).replace('\'', '"').replace('True', 'true').replace('False', 'false'))
file.close()
except Exception as e:
print('Some went wrong while saving to %s' % fileName)
print(e)
exit()

print('Done!')
2 changes: 2 additions & 0 deletions src/eventsFunctionsExtensions/alignobject.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"I0kdjvsICFML0APq45CZjZ6PyEQ2"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"description": "Align object to horizontal center in screen.",
Expand Down
Loading