You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The only place where apply_script gets called
It itself gets only called in server.py run() and only on files game_modes and scripts/ folder
I'm pretty sure the fix is to simply to call apply_script in the same manner as in run.py whenever the map changes/loads
Repro (not sure if the func is correct since I never got it to run) Test.txt:
name = 'Test'
version = '1.0'
author = 'Dany0'
description = 'Chungus.'
print("inside script for Test")
def apply_script(protocol, connection, config):
print("Applying script for Test")
class TestConnect(connection):
def on_spawn(self, pos):
print("entered on_spawn")
return connection.on_spawn(self, pos)
return protocol, TestConnect
stdout:
2024-02-29T00:02:27+0100 [stdout#info] inside script for Test
2024-02-29T00:02:27+0100 [piqueserver.map#info] Loading map 'Test'...
... nothing after
Expected:
inside script for Test
Applying script for Test
entered on_spawn (when player spawns)
The text was updated successfully, but these errors were encountered:
You're right, it seems like this was a planned feature that was never finished since we never actually call <map instance>.apply_script(...).
IMO, map config files should have as little scripting as possible. If you need anything more complex than setting the player / tent / intel spawn positions, you should make a script or gamemode instead.
I think our future goal is to have a safe, non-scripted but extensible map format, so adding such a feature right now would not make much sense.
Unless there's a use case I can't think of right now, I'm probably gonna remove this apply_script() code entirely to prevent confusion.
utf-4096
added
wontfix
The maintainers deem this issue as not worthy of fixing for some reason
and removed
discussion
This issue is used only for discussion of a certain topic so the community can be heard
labels
May 15, 2024
piqueserver/piqueserver/map.py
Line 123 in 87c9f09
Unlikely this is a regression? Guessing it was just never implemented fully
piqueserver/piqueserver/extensions.py
Line 147 in 87c9f09
The only place where apply_script gets called
It itself gets only called in server.py run() and only on files game_modes and scripts/ folder
I'm pretty sure the fix is to simply to call apply_script in the same manner as in run.py whenever the map changes/loads
Repro (not sure if the func is correct since I never got it to run)
Test.txt
:stdout:
Expected:
The text was updated successfully, but these errors were encountered: