Tuesday, February 10, 2009

The making of a sword

I am working on one of the three final areas that I need to complete. Below I have a blacksmith who will be an important NPC to the story. What started out as a simple walkpath turned into a something a bit more. I wanted to show the smith creating a weapon and have him actually moving the weapon through the process where the player could see the NPC moving from step to step with the appropriate animation with sounds happened at each step. The final part of the process was adding the sword. I had three placeable swords, one for the fire being heated, one for the anvil and the final being cooled in water. I also had two swords in the blacksmiths inventory, one with a heated blade and the other cooled. The blacksmith equips the appropriate blade as he walks between the waypoints then a the sword placeable appears and disappears at each waypoint. So between the five swords only one is visible at a time.

For the placeable swords I was hoping for a function similar SetScriptHidden() for placeables but that doesn't exist. So after several different tries I set local locations on the area and used those to create the swords on and then would destroy them. First I was using an on client enter to set the local location but then I was concerned that walk paths may run even when the area was not loaded like heartbeats so at the start of the walkpoint script I identified the three swords objects, if the object was valid I had the script assign the location to the area as alocal location.


Here is the start with the blade heating in the fire
While the blade is heating the smith shovels more coal to feed the fire

The heated blade is removed from the heat and carried to the anvil

Time for some hammering. The smith equips a light hammer for this.

The sword is removed from the anvil and the still hot blade is move to the water basin

The sword appears in the water basin in the upper corner with some nice hissing sounds

The cooled blade is carried back to start over again.

No comments: