Post news RSS Gorescript Level Editor - Elevators, Switches and Scripting

In this video we go over the final touches. Add to the level scripted events in order to inject more adrenaline, elevators and switches to bring some of that platformer flavour into the game.

Posted by on

In this video we go over the final touches. First off, the red "end level" ball is an entity called "letter" (don't ask), similar to weapons and powerups.

Secondly, we illustrate two advanced topics:

  • Elevators are sectors, similar to doors, that allow you to move up and down on top of them. Elevators are usually scripted.
  • Switches are special segments that are drawn on top of existing wall segments and render an on/off switch. Switches are always scripted since they don't do anything by themselves.

Thirdly, we go over scripting.

A Lua scriptfile can be added to a map by creating a "script.lua" file in the map folder and checking the "Has script" checkbox in the Map menu.

The following functions will be called if the script provides an implementation:

  • init(). Called every time you respawn.
  • onZoneEnter(zone: Zone). Called every time you enter a zone (as defined in the Zone layer).
  • onZoneLeave(zone: Zone). Called every time you leave a zone.
  • onPowerupPickup(powerup: Powerup). Called every time you pick up a powerup.
  • onPlayerOpenDoor(door: Door). Called every time you open a door.
  • onSwitchStateChange(switch: Switch). Called every time you use a switch.

Exposed classes:

  • Door
    • getId() : number
    • setAutomatic(value: boolean) : void
    • setSpeed(value: number) : void
    • open() : void
    • close() : void
    • setCrusher(value: boolean) : void
  • Elevator
    • getId() : number
    • getDownY() : number
    • setDownY() : number
    • getUpY() : number
    • setUpY() : number
    • setAutomatic(value: boolean) : void
    • setSpeed(value: number) : void
    • setPositionUp() : void
    • setPositionDown() : void
    • goUp() : void
    • goDown() : void
  • Powerup
    • getId() : number
  • Switch
    • getId() : number
    • isOn() : boolean
    • block() : void
  • Monster
    • getId() : number
    • awaken() : void
    • makeScripted() : void
  • Zone
    • name : string

Exposed globals:

  • doors: table of Door, key is door ID
  • elevators: table of Elevator, key is elevator ID
  • powerups: table of Powerup, key is powerup ID
  • switches: table of Switch, key is switch ID
  • monsters: table of Monster, key is monster ID

Find the full tutorial right here: Gorescript.com

Also you can get Gorescript on WinGamesStore right here: Wingamestore.com

Comments
Guest
Guest

This comment is currently awaiting admin approval, join now to view.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.