![]() |
[0.1.3] [client/server] Utility Scripts - Printable Version +- Gothic Online Forums (https://archive.gothic-online.com) +-- Forum: Scripting (English) (https://archive.gothic-online.com/forum-11.html) +--- Forum: Resources (https://archive.gothic-online.com/forum-14.html) +---- Forum: Scripts (https://archive.gothic-online.com/forum-17.html) +---- Thread: [0.1.3] [client/server] Utility Scripts (/thread-2300.html) |
[0.1.3] [client/server] Utility Scripts - HammelGammel - 28.12.2017 Description: Library with various, hopefully useful utility functions written in Squirrel. Required for some of my other scripts. Please report any problems you find here: Issue Tracker Installation:
Code: <!-- Module Util --> Util.nut Static class with miscellaneous utility methods Code: getAngleDelta(angle1, angle2) CellSystem.nut Allows adding elements to a grid of cells by their position. This can be used to then get all elements in grids around a given position. When lots of elements exist that have to do distancechecks to all other elements, this can reduce the amount of elements to check and thus decrease overhead. Example: 1000 bots are scattered around the map. Normally, distancechecks would have to be done from all bots to all other bots to check if bot is within viewing distance. With a CellSystem, only bots in surrounding cells have to even be considered for a refined distancecheck. Code: getAdjacentCells(x, z, radius) Factions.nut Allows creating factions and relations between them Code: isEnemyNameFaction(name) RealTimeEvent.nut Static class that allows creating events that are executed at a given real world time. For example: replenish appletree after 10 hours, save serverstate every hour. Code: add(date, function, reschedule, repeat) Download Repository RE: [0.1.3] [client/server] Squirrel Utility Scripts - HammelGammel - 27.01.2018 Update with a bunch of fixes |