Skip to main content

Blog Archive

Tech Note: Scripted tools and weapons

February 7, 2012

by Becky "reesemcblox" Herndon


Archive Bits and Bytes Tech

Dagger of Shattered DimensionsOur head gear programmer Deepak Chandrasekaran explains the steps that went into creating The Dagger of Shattered Dimensions.

The ROBLOX creative team meets regularly to plan new items for publication in the Catalog. Recently they were inspired to create an Arabian Nights collection which included a Flying Magic Carpet, Arabian Knight Scimitar, Magic LampDesert King hat, and the technically advanced Dagger of Shattered Dimensions. Once ideas have been selected, our team of 3D artists creates the item and hat models using Maya, Blender and 3DS Max.  The models are then delivered to the gear programmers.

Required specs for the Dagger include:

  • Red flames along the blade
  • Maintain an advantage in melee versus larger weapons
  • Freeze all the players and NPCs around the wielder for 2-3 seconds

Dagger Freeze EffectGear items are programmed using ROBLOX Studio, the same 3D place building and model scripting tool that our players use to develop their games. Gear is coded in the Lua scripting language. The first step in scripting the sword was to add red particle fire along the blade by inserting a Fire object to the model. It’s a bit trickier than it sounds due to the model’s directional facing, but Deepak developed a custom solution.

A dagger is a fast and light weapon, but the range is very short. Unlike longer weapons, such as swords and pole-arms, a dagger wielder will be struck before they can close in on their opponent. To give the Dagger of Shattered Dimensions combat advantage, Deepak programmed in a special ability. By double-clicking, the wielder is able to rapidly lunge at their opponent and get in a hit. Wielding the dagger also grants a run speed boost.

Dagger Of Shattered Dimensions Code Sample

The key requirement of the Dagger of Shattered Dimensions is that it must freeze the players and NPCs around the wielder. By pressing “Q” the wielder is able to generate a ring of effect that stops all others in their tracks. This gear item required intense client-server communication, because the affected players must experience the exact same thing at the same time. A frozen player should not be able to move, strike with a weapon or bring out a new weapon. Freezing the players and NPCs was the most technically demanding part of coding the Dagger.

Testing gear items is an integral part of development. Deepak tests during the whole creation process. First items are tested in Studio using Test > Play Solo. If the item seems to be working there he tries it out using Test > Start Player and Start Server. The ultimate test of a gear item is to take it onto one of the test servers and see how it performs in its final destination. The finishing touches were sound and visual effects. Once those were complete, the Dagger was ready to be added to the Catalog.

Here is a recap of last week’s gear items:

  • Steelshank ArmamentSteelshanks Armament

    Melee Weapon, Ranged Weapon. This a rare duo weapon ensemble is good for close and long range battles. Pressing “Q” fires the Flinkock while while clicking will swing the poisoned sword. The Limited Unique run of only 500 is definitely one to watch given its versatility.
  • The Sea's RevengeThe Sea’s Revenge

    Ranged Weapon. This potion creates a large ghostly pirate ship that rushes towards the enemy and hits them for a lot of damage. The ghost-ship animation is impressive in how the ship breaks apart when it hits.
  • Creepy Zombie MonkeyCreepy Zombie Monkey

    Ranged Weapon, Power Up. Target an enemy and the monkey will leap to attack them, then it leaps back. It does damage and also heals its owner. 1250 of this Limited Unique item were sold, and it’s currently re-selling for about 140R$ over original price.
  • Captain Steelshanks Recruiting StaffCaptain Steelshanks Recruiting Staff

    Social Item, Power Up. The bearer of this staff is able to force other players to look like pirates, one body part at a time. Movement speed is also increased after each hit on an opponent.
  • Hammer of Eternal FrostHammer of Eternal Frost

    The Hammer has a giant swing arc in the front, hitting several enemies at once, stunning them and slowing their movement. You can also throw it to hit enemies at range. It comes back to your pack after a brief wait. This item is only available by redeeming a ROBLOX Gamecard from Walmart in the month of February.