7 ast Torque - PowerPoint PPT Presentation

About This Presentation
Title:

7 ast Torque

Description:

... ??a t? rocket launcher ?a? t? rocket projectile, st? f??e?? 'tutorial.base/data/shapes' ... St? ' tutorial.base/server/game.cs' st?? s????t?s? ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 16
Provided by: lorimal
Category:
Tags: ast | launcher | torque

less

Transcript and Presenter's Notes

Title: 7 ast Torque


1
7? ???ast???? Torque
  • ?????ep?d?as? µe ??t??e?µe?a
  • (..s????e?a)

2
???????µe?? µ???µa
  • tutorial.base
  • ??t???af? fa????? "rocket_launcher" p??
    pe????e? .dts a??e?a ?a? t?? e????e? ?f??
    (textures) ??a t? rocket launcher ?a? t? rocket
    projectile, st? f??e?? "tutorial.base/data/shapes"
    .
  • ??t???af? t?? "rocket_launcher.cs" st? f??e??
    "tutorial.base/server".
  • St? " tutorial.base/server/game.cs" st??
    s????t?s? onServerCreated() p??s???? t?? ??aµµ??
    (p??? ap? t?? a?t?st???? e?t??? ??a t?
    player.cs)exec("./rocket_launcher.cs")
  • St? " tutorial.base/server/player.cs" st??
    s????t?s? PlayerShapeonAdd p??s??ste
  • parentonAdd( this, obj )
  • obj.mountImage( RocketLauncherImage, 0 )
  • obj.setImageAmmo( 0, 1 )

3
??µ??????a Bot I
  • Copy the "bot.cs" script to your
    "tutorial.base/server" directory.
  • ?????te t? " tutorial.base/server/game.cs" ?a?
    st?? s????t?s? onServerCreated() p??s??ste t??
    e?t??? (st? t???? t?? ??sta? µe ta
    exec())exec("./bot.cs")St? bot.cs ????eta? ?
    AIManager p?? d?a?e????eta? ??a ta bots. ??
    e?d??? a?t? a?t??e?µe?? p??pe? ?a a?????p????e?
    p??s??t??ta? t?? e??? e?t????
  • St?? s????t?s? onMissionLoaded() new
    ScriptObject(AIManager)    
    MissionCleanup.add(AIManager)   
    AIManager.think()
  • St?? s????t?s? onMissionEnded()
    AIManager.delete()
  • ?? a??e?? bot.cs pe????e? s????a p?? pe?????f???
    p?? ?a a??????e? t? bot t? µ???p?t? p?? ?a
    ???s??µe.

4
??µ??????a Bot II
  • ???? t? pa??? de? ????µe ???se? ??p??? µ???p?t?
    ??a ta bots (a?t? ???eta? ap? t?? Mission
    Editor), µe ap?t??esµa ?ta? d?µ????????ta? µe t??
    ???s? t?? s????t?s?? AIManagerspawn(),?a
    eµfa???eta? ??a ap?? bot p?? de? ?a a??????e?
    ??p??? µ???p?t?.

5
???sµ?? µ???pat??? I
  • ??????µe t? torqueDemo.exe
  • ?e F11 a??????µe t?? Mission editor
  • St? s????e?a e?e???p????µe t?? World Editor
    Creator
  • ???????µe t? d??t?? ??t? ap? t? "Mission Objects"
    st? ??t? de??? pa?????? t?? ?????? "Mission
    Objects-gtMission"St?? f??e?? "Mission",
    ep??????µe t? "Path" ??a ?a d?µ??????s??µe ??a
    ??? a?t??e?µe?? new Path. ??? d????µe ???µa, p.?.
    "myPath".
  • ???????µe t? d??t?? "MissionGroup" p??? de???,
    ß??s???µe ?a? ep??????µe t? "myPath". ??at?µe
    pat?µ??? t? "Alt" key ?a??? t? ep??????µe µe t?
    p??t???. ???a t? ???µa t?? "myPath" p??pe? ?a
    a????e? ap? ?sp?? se ????. St?? s????e?a ?a
    d?µ??????s??µe t?e?? PathMarkers ?a? p??pe? ?a
    e?µaste s??????? ?t? ?a a?????? st? a?t??e?µe??
    "myPath". 

6
???sµ?? µ???pat??? II
  • G?a ?a ???ste? ??a µ???p?t? a??e? ?a ???s??µe
    µe???? s?µe?a/s?µ?d?a ap? ta ?p??a ?a
    ap?te?e?ta?. ?p?st??f??µe st? ??t? de??? d??t??,
    a??????µe t? f??e?? "Mission" ?a? ep??????µe t?
    "PathMarker". ??? d????µe ???µa, p.?. "myMarker0"
    ?a? e??????µe ?t? a???e? st? "myPath" st? d??t??
    "MissionGroup" (p??? de???).
  • ?pa?a?aµß????µe t?? d?ad??as?a ?a? d?µ???????µe
    ???a d?? PathMarkers µe ???µata "myMarker1 ?a?
    "myMarker2". ?a s?µ?d?a p?? t?p??et?saµe p??pe?
    ?a ????? ??a??p???t??? ap?stas? µeta?? t??? ?????
    ?µ?? ?a ?p???e? ???d???? ?a ste????? t? bot e?t??
    s?????. (?e Altc ???e?ta? ? ??µe?a ????? t??
    pa??t?)
  • "File-gtSave Mission"
  • ?xit game

7
???sµ?? µ???pat??? ???
  • ???????µe t? " tutorial.base/server/bot.cs" µe
    s??p? ?a ???s?µ?p???s??µe t? µ???p?t? p?? µ????
    ???saµe sa? µ???p?t? t?? bot. St?? s????t?s?
    AIManagerspawn() ß????µe se s????a t?? e?t???
    p?? d?µ?????e? t? "Bot_1" ?a? afa????µe ta s????a
    p?? d?µ???????? t? "Bot_2".
  • When done, save the "bot.cs" script file.
  • ?? string "MissionGroup/myPath", p?? pe????ta?
    sa? ???sµa st?? s??a?t?se?? AIPlayerspawnOnPath(
    ), ?a? followPath() pe????e? t?? p????f???a p??
    ??e???eta? t? "Bot_2" ??a ?a a???????se? t?
    µ???p?t? p?? d?µ??????saµe.

8
  • ??t????f??µe ta "radiusDamage.cs" ?a?
    "shapeBase.cs" st?? f??e?? "tutorial.base/server"
  • ???????µe t? " tutorial.base/server/game.cs" ?a?
    st?? s????t?s? onServerCreated() p??s??t??µe st?
    t???? t?? ??sta? µe ta exec())exec("./radiusDam
    age.cs")exec("./shapeBase.cs")
  • ??t????f??µe t? "player_dieknees.dsq" (a??e??
    animation) st?? f??e?? "\tutorial.base\data\shapes
    \player" directory.
  •  

9
  • ???????µe t? "\tutorial.base\data\shapes\player\pl
    ayer.cs" ?a? p??s??t??µe t?? e??? e?t??? st?
    t???? t?? TSShapeConstructor datablock
  • sequence12 "./player_dieknees.dsq die"
  • ?e a?t? t?? e?t??? ??????µe st?? pa??t? ??a
    ?a??????? death animation p?? ?a e?te?e?ta? ?ta?
    t?? pet??a????µe µe t? ?p??.

10
  • ???????µe t? " tutorial.base/server/player.cs"
    ?a? st? PlayerShape datablock p??s??t??µe t??
    ??aµµ? PlayerData(PlayerShape)    className
    Armor  ...
  • ??????ta? t?? µetaß??t? className ?? Armor ????
    ?? pa??te? ?a? ta bots ?a ???????µ??? ??e? t??
    s??a?t?se?? p?? ??????ta? st? Armor name space.
  • S??e?????µe µe a??a??? st? ?d?? a??e??.
  • ???s??t??µe t?? pa?a??t? s????t?s? st? t???? t??
    "player.csfunction PlayerplayDeathAnimation(
    this )    this.setActionThread( "die" )

11
  • ????ß?? ap? ??t? p??s??t??µe t?? s????t?s?
    function Armordamage( this, obj,
    sourceObject, position,                        
           damage, damageType )    // If we're
    already dead, don't bother with it...    if(
    obj.getState() "Dead" )        return   
    obj.applyDamage( damage )    echo( "Damage
    Type " _at_ damageType )    // Deal with
    client callbacks here because we don't have this
    information     // in the onDamage or onDisabled
    methods    client obj.client   
    sourceClient sourceObject ?
    sourceObject.client 0    if(
    obj.getState() "Dead" )       
    client.onDeath( sourceObject, sourceClient,
    damageType, location )

12
  • ????ß?? ap? ??t? p??s??t??µe t??
    s????t?s?function ArmoronDisabled( this,
    obj, state )     // "damage" method.   
    obj.playDeathAnimation()    // Release the
    main weapon trigger.    obj.setImageTrigger( 0,
    false )    // Schedule time and duration of
    fade-out for dead players.     obj.schedule(
    6000, "startFade", 1000, 0, true )   //
    Schedule deletion for dead players.    
    obj.schedule( 8000, "delete" )
  • ?e t?? ?????a object disable a?af??eta? st??
    ???at? e??? pa??t? ? bot

13
  • St? a??e?? " tutorial.base/server/rocket_launcher.
    cs" a??????µe t?? t?µ?? ?? e???
  • datablock ProjectileData( RocketProjectile
    )    ...    directDamage 50   
    radiusDamage 25    damageRadius 1.5    ...

14
  • St?? s????t?s? RocketProjectileonCollisionfun
    ction RocketProjectileonCollision( this, obj,
    col, fade, pos, normal )   
    echo("RocketProjectileonCollision
    called!------------")  // For direct hits...
    apply damage to all shape base objects    if(
    col.getType() TypeMasksShapeBaseObjectType
    )        col.damage( obj, pos,
    this.directDamage, "Rocket" )
  • // For radius damage hits... use the radiusDamage
    utility function defined // by the
    radiusDamage.cs script to see if we our player or
    bot will take// any damage.  radiusDamage(
    obj, VectorAdd(pos, VectorScale(normal,
    0.01)),                  this.damageRadius,
    this.radiusDamage, "Radius", 40 )

15
????S
  • ??????µe t? pa????d?
  • ?? ??a ????? p?e? ?a?? ?a p??pe? ?a µp????µe ?a
    a?at??????µe t? bot ?a??? ?a? t?? pa??t? µa?
    (p???ß????ta? sta p?d?a t??)
Write a Comment
User Comments (0)
About PowerShow.com