bascenev1lib package¶
Library of stuff using the bascenev1 api: games, actors, etc.
Subpackages¶
Submodules¶
bascenev1lib.characterviewer module¶
A viewer showing a character standing around.
- bascenev1lib.characterviewer.STAND_HEIGHT = -0.58¶
Where to stand a spaz for it to start out at rest on our floor.
bascenev1lib.gameutils module¶
Various utilities useful for gameplay.
Bases:
objectVarious common components for use in games.
Objects contained here are created on-demand as accessed and shared by everything in the current activity. This includes things such as standard materials.
A bascenev1.Material applied to explosion shapes, punch shapes, etc. An object not wanting to receive impulse/etc messages can disable collisions against this material.
A bascenev1.Material that sends a ba.DieMessage() to anything that touches it; handy for terrain below a cliff, etc.
Anything that can be ‘walked on’ should have this bascenev1.Material applied; generally just terrain and whatnot. A character will snap upright whenever touching something with this material so it should not be applied to props, etc.
Fetch/create the instance of this class for the current activity.
A bascenev1.Material that should be applied to any small, normal, physical objects such as bombs, boxes, players, etc. Other materials often check for the presence of this material as a prerequisite for performing certain actions (such as disabling collisions between initially-overlapping objects)
A bascenev1.Material; collision shapes used for picking things up will have this material applied. To prevent an object from being picked up, you can add a material that disables collisions against things containing this material.
a bascenev1.Material to be applied to player parts. Generally, materials related to the process of scoring when reaching a goal, etc will look for the presence of this material on things that hit them.
A bascenev1.Material with a very low friction/stiffness/etc that can be applied to invisible ‘railings’ useful for gently keeping characters from falling off of cliffs.
A bascenev1.Material used for non-physical collision shapes (regions); collisions can generally be allowed with this material even when initially overlapping since it is not physical.
bascenev1lib.maps module¶
Standard maps.
- class bascenev1lib.maps.BigG[source]¶
Bases:
MapLarge G shaped map for racing
- defs = <module 'bascenev1lib.mapdata.big_g' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/big_g.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- name = 'Big G'¶
- class bascenev1lib.maps.Bridgit[source]¶
Bases:
MapMap with a narrow bridge in the middle.
- dataname = 'bridgit'¶
- defs = <module 'bascenev1lib.mapdata.bridgit' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/bridgit.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- name = 'Bridgit'¶
- class bascenev1lib.maps.Courtyard[source]¶
Bases:
MapA courtyard-ish looking map for co-op levels.
- defs = <module 'bascenev1lib.mapdata.courtyard' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/courtyard.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- is_point_near_edge(point: Vec3, running: bool = False) bool[source]¶
Return whether the provided point is near an edge of the map.
Simple bot logic uses this call to determine if they are approaching a cliff or wall. If this returns True they will generally not walk/run any farther away from the origin. If ‘running’ is True, the buffer should be a bit larger.
- name = 'Courtyard'¶
- class bascenev1lib.maps.CragCastle[source]¶
Bases:
MapA lovely castle map.
- defs = <module 'bascenev1lib.mapdata.crag_castle' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/crag_castle.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- name = 'Crag Castle'¶
- class bascenev1lib.maps.DoomShroom[source]¶
Bases:
MapA giant mushroom. Of doom!
- defs = <module 'bascenev1lib.mapdata.doom_shroom' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/doom_shroom.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- is_point_near_edge(point: Vec3, running: bool = False) bool[source]¶
Return whether the provided point is near an edge of the map.
Simple bot logic uses this call to determine if they are approaching a cliff or wall. If this returns True they will generally not walk/run any farther away from the origin. If ‘running’ is True, the buffer should be a bit larger.
- name = 'Doom Shroom'¶
- class bascenev1lib.maps.FootballStadium[source]¶
Bases:
MapStadium map for football games.
- defs = <module 'bascenev1lib.mapdata.football_stadium' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/football_stadium.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- is_point_near_edge(point: Vec3, running: bool = False) bool[source]¶
Return whether the provided point is near an edge of the map.
Simple bot logic uses this call to determine if they are approaching a cliff or wall. If this returns True they will generally not walk/run any farther away from the origin. If ‘running’ is True, the buffer should be a bit larger.
- name = 'Football Stadium'¶
- class bascenev1lib.maps.HappyThoughts[source]¶
Bases:
MapFlying map.
- defs = <module 'bascenev1lib.mapdata.happy_thoughts' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/happy_thoughts.py'>¶
- classmethod get_music_type() MusicType[source]¶
Return a music-type string that should be played on this map.
If None is returned, default music will be used.
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- name = 'Happy Thoughts'¶
- class bascenev1lib.maps.HockeyStadium[source]¶
Bases:
MapStadium map used for ice hockey games.
- defs = <module 'bascenev1lib.mapdata.hockey_stadium' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/hockey_stadium.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- name = 'Hockey Stadium'¶
- class bascenev1lib.maps.LakeFrigid[source]¶
Bases:
MapAn icy lake fit for racing.
- defs = <module 'bascenev1lib.mapdata.lake_frigid' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/lake_frigid.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- name = 'Lake Frigid'¶
- class bascenev1lib.maps.MonkeyFace[source]¶
Bases:
MapMap sorta shaped like a monkey face; teehee!
- defs = <module 'bascenev1lib.mapdata.monkey_face' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/monkey_face.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- name = 'Monkey Face'¶
- class bascenev1lib.maps.Rampage[source]¶
Bases:
MapWee little map with ramps on the sides.
- defs = <module 'bascenev1lib.mapdata.rampage' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/rampage.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- is_point_near_edge(point: Vec3, running: bool = False) bool[source]¶
Return whether the provided point is near an edge of the map.
Simple bot logic uses this call to determine if they are approaching a cliff or wall. If this returns True they will generally not walk/run any farther away from the origin. If ‘running’ is True, the buffer should be a bit larger.
- name = 'Rampage'¶
- class bascenev1lib.maps.Roundabout[source]¶
Bases:
MapCTF map featuring two platforms and a long way around between them
- defs = <module 'bascenev1lib.mapdata.roundabout' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/roundabout.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- name = 'Roundabout'¶
- class bascenev1lib.maps.StepRightUp[source]¶
Bases:
MapWide stepped map good for CTF or Assault.
- defs = <module 'bascenev1lib.mapdata.step_right_up' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/step_right_up.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- name = 'Step Right Up'¶
- class bascenev1lib.maps.ThePad(main_menu_style: bool = False)[source]¶
Bases:
MapA simple square shaped map with a raised edge.
- defs = <module 'bascenev1lib.mapdata.the_pad' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/the_pad.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- name = 'The Pad'¶
- class bascenev1lib.maps.TipTop[source]¶
Bases:
MapA pointy map good for king-of-the-hill-ish games.
- defs = <module 'bascenev1lib.mapdata.tip_top' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/tip_top.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- name = 'Tip Top'¶
- class bascenev1lib.maps.TowerD[source]¶
Bases:
MapMap used for runaround mini-game.
- defs = <module 'bascenev1lib.mapdata.tower_d' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/tower_d.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- is_point_near_edge(point: Vec3, running: bool = False) bool[source]¶
Return whether the provided point is near an edge of the map.
Simple bot logic uses this call to determine if they are approaching a cliff or wall. If this returns True they will generally not walk/run any farther away from the origin. If ‘running’ is True, the buffer should be a bit larger.
- name = 'Tower D'¶
- class bascenev1lib.maps.ZigZag[source]¶
Bases:
MapA very long zig-zaggy map
- defs = <module 'bascenev1lib.mapdata.zig_zag' from '/home/runner/work/ballistica/ballistica/.cache/sphinxfiltered/ba_data/bascenev1lib/mapdata/zig_zag.py'>¶
- classmethod get_preview_texture_spec() TextureSpec[source]¶
Return this map’s preview texture as an asset-package spec.
This is the hook maps should override – typically returning a texture straight off an asset-package wrapper (
someassets.textures.my_map_preview). Unlike a loaded texture, a spec can go anywhere a texture is described rather than drawn directly, such as doc-ui pages (the playlist browser shows previews this way).get_preview_texture()loads it.
- name = 'Zigzag'¶
bascenev1lib.tutorial module¶
Wrangles the game tutorial sequence.
- class bascenev1lib.tutorial.AnalyticsScreen(screen: str)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.Bomb(delay: int = 0, release: bool = True, release_delay: int = 500)[source]¶
Bases:
ButtonPress
- class bascenev1lib.tutorial.BombRelease(delay: int = 0)[source]¶
Bases:
ButtonRelease
- class bascenev1lib.tutorial.ButtonPress(button: str, delay: int = 0, release: bool = True, release_delay: int = 0)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.ButtonRelease(button: str, delay: int = 0)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.Celebrate(celebrate_type: str = 'both', spaz_num: int | None = None, duration: int = 1000)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.Delay(time: int)[source]¶
Bases:
object- run(a: TutorialActivity) int[source]¶
- class bascenev1lib.tutorial.DelayOld(time: int)[source]¶
Bases:
object- run(a: TutorialActivity) int[source]¶
- class bascenev1lib.tutorial.DelayOld2(time: int)[source]¶
Bases:
object- run(a: TutorialActivity) int[source]¶
- class bascenev1lib.tutorial.Jump(delay: int = 0, release: bool = True, release_delay: int = 500)[source]¶
Bases:
ButtonPress
- class bascenev1lib.tutorial.JumpRelease(delay: int = 0)[source]¶
Bases:
ButtonRelease
- class bascenev1lib.tutorial.KillSpaz(num: int, explode: bool = False)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.Move(x: float, y: float)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.MoveLR(x: float)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.MoveUD(y: float)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.PickUp(delay: int = 0, release: bool = True, release_delay: int = 500)[source]¶
Bases:
ButtonPress
- class bascenev1lib.tutorial.PickUpRelease(delay: int = 0)[source]¶
Bases:
ButtonRelease
- class bascenev1lib.tutorial.Powerup(num: int, position: Sequence[float], *, color: Sequence[float] = (1.0, 1.0, 1.0), make_current: bool = False, relative_to: int | None = None)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.PrintPos(spaz_num: int | None = None)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.Punch(delay: int = 0, release: bool = True, release_delay: int = 500)[source]¶
Bases:
ButtonPress
- class bascenev1lib.tutorial.PunchRelease(delay: int = 0)[source]¶
Bases:
ButtonRelease
- class bascenev1lib.tutorial.RemoveGloves[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.RestorePos(pos: Sequence[float])[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.Run(delay: int = 0, release: bool = True, release_delay: int = 500)[source]¶
Bases:
ButtonPress
- class bascenev1lib.tutorial.RunRelease(delay: int = 0)[source]¶
Bases:
ButtonRelease
- class bascenev1lib.tutorial.SetSpeed(speed: int)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.ShowControls[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.SpawnSpaz(num: int, position: Sequence[float], *, color: Sequence[float] = (1.0, 1.0, 1.0), make_current: bool = False, relative_to: int | None = None, name: str | Lstr | LangStr = '', flash: bool = True, angle: float = 0.0)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.Text(text: str | Lstr | LangStr)[source]¶
Bases:
object- run(a: TutorialActivity) None[source]¶
- class bascenev1lib.tutorial.TutorialActivity(settings: dict | None = None)[source]¶
-
- legacy_spaz_limbs = True¶
If True, spazzes in this activity get the older (pre-1.8) spaz physics: limbs simulated in the main sim instead of on the background-dynamics rig, and punches placed at the end of the punching arm. For content calibrated against the old physics, such as the tutorial’s recorded input script.
- on_begin() None[source]¶
Called once the previous activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_player_join(player: Player) None[source]¶
Called when a player joins the activity.
(including the initial set of players)
- on_transition_in() None[source]¶
Called when the activity is first becoming visible.
Upon this call, the activity should fade in backgrounds, start playing music, etc. It does not yet have access to players or teams, however. They remain owned by the previous activity up until
on_begin()is called.