Guest User

Untitled

a guest
Apr 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. 1) To add a new player into our game we need to open the Datablock Editor, this can be found in the World Editor on the main toolbar. At the top of the editor there is the option
  2.  
  3. to create a new Datablock, which we then select. Because we want to create a new player character named fighter, the PlayerData datablock type must be selected then we can
  4.  
  5. click the "create new datablock" icon icon in the upper right hand corner of the list. From here we can then name our new datablock fighter and it will be added to the existing tab
  6.  
  7. of the datablock library under "PlayerData." To save time with the datablock creation we can then copy default information from the DefaultPlayerData file located in the
  8.  
  9. game/art/datablocks/ and place it in our new fighter.cs file giving us a premade datablock for our character that we can quickly modify. Now back inside the torque World Editor
  10.  
  11. we need to go to our fighter datablock and under the "Render" tab we click the [...] to the right of shape file to then select the fighter.dts skin located in the game/art/shapes/avatar
  12.  
  13. folder of the game. Next the camera "Max FreelookAngle" needs to be set to 4 and "CameraMaxDist" needs to be set to 4. Under the Damage/Energy tab we must set the
  14.  
  15. player's health to be displayed by changing the maxDamage value to 100 giving our fighter 100 health points. Then under the dymanic field tab we can create both a Rocket
  16.  
  17. Launcher and Grenage launcher by pressing hte plus 4 times and inserting into the dynamic text field "maxInvGrenadeLauncher, maxInvGrenadeLauncherAmmo,
  18.  
  19. maxInvRocketLauncher, maxInvRocketLauncherAmmo." Now we need to press ok and save the datablock, and the level.
  20.  
  21. 2)
  22. Have a stereo audio file open in Audacity, then select the drop down menu on the left side of the audio file and in this menu find the "Split Stereo Track" feature. Select
  23.  
  24. this option and the Stereo file will split into two separate tracks. We can then hit the "X" to the left of the drop down menu which deletes the particular channel we wish to remove,
  25.  
  26. allowing us to then go back to the drop down menu and select mono converting our single track into the Mono format which we can then save and export.
  27.  
  28. To load a sound into Torque 3D game and play as environmental audio we must first place a Sound Emitter which can be found under the Scene Tree panel . From here
  29. we can navigate to Library>Level> Environment where we will find a Sound Emitter. Double-click on the Sound Emitter to add one to our level and create Object: SFXEmitter
  30. dialog box will pop up, where we can then give it a unique name, such as "Rain Drops." From here we can load an audio file, then we can set the Loop Sound option, Volume and
  31. desired Pitch, Fade in/out, Reference Distance, and Max Distance the sound can be heard. Then we can take our new object and place it wherever we want the focus of the sound
  32. to be.
  33.  
  34. Using a SFXProfile sound can be played from the server side. This profile contains a SFXTrack class and encapsulates a single sound file for playback. SFXProfile also combines a sound SFXDescription with a sound file enabling it to be played by the sound system. Once our profile has been created we can play it on client side by going to game/core/scripts/server/audio.cs file and adding the line serverPlay3D("ProfileName", PlayingPosition); for 3D sounds or just serverPlay2D(SoundProfile); for 2D sounds.
Add Comment
Please, Sign In to add comment