Results 1 to 3 of 3

scar, transport, teleport

  1. #1

    scar, transport, teleport

    Hi guys.



    calling for help here. been trying to crate an automatic transport entity in the last map im creating.

    i´ve been reading all the scar tutorials, trying to create my own lines of code to make that possible, but im afraid im too noob for that, and learning by my own is slow. so i was hoping for some tips about how can i do it.

    this is the idea.

    the transport idea is based on a thunderhawk entity. main thing is that any troop that comes near it is ported to a certain location of the map. only the player owner of the transport can use it.

    so the scar lines im looking for are 2:

    1. if any player squad goes near the thunderhawk, that squad is ported to a certain coordinates of the map.

    2. trigger an animation of take off in the thunderhawk entity. (was wondering if i have to create that animation in ME or i can trigger an allready existing animation.


    for the moment, im fighting the lines "Player_AreSquadsNearMarker", but i dont know if im in the wrong way.

    and about the animation "Anim_PlayEntityAnim"

    but for the spawning squads im completly lost, was thinking about using the "Squad_Spawn" but then again, i dont have a clue about the logic of the spawn-despawn.

    thanks in advance for the help


    this is as far as i go:

    import("ScarUtil.scar")
    import("WXPScarUtil.scar")
    import("WCUtil.scar")


    function OnInit()
    g_Player1 = World_GetPlayerAt(0)
    Rule_Add(Rule_Teleport1)
    Rule_AddOneShot(Rule_Animation1, 2)
    end
    Scar_AddInit(OnInit)

    function Rule_Teleport1()
    Player_GetAllSquadsNearMarker(g_Player1,"TelSquad1"..World_GetGameTime() ,"Tel_Entrance1")
    SGroup_DeSpawn("TelSquad1"..World_GetGameTime() )
    SGroup_ReSpawnMarker("TelSquad1"..World_GetGameTime() ,"Tel_Exit1")
    end

    function Rule_Animation1()
    if Prox_AllSquadsNearMarker("TelSquad1"..World_GetGameTime() ,"Tel_Entrance1") == true then
    Anim_PlaySquadAnim(thunderhawk ,"ThunderHawk")
    end
    end


    notice this is for player 1. it teleports the units, but doesnt trigger any animation.

    i have to make another variable, that the rules are canceled if the thunderhawks are destroyed.
    Last edited by Taiyang; 12th Aug 08 at 11:12 AM.

  2. #2
    tyoungls
    Guest
    Learning SCAR always takes time.

    I realize a lot of time has passed since you posted. Any new progress?

    The reason your animation does not fire (on what you posted) is because you register that rule as a "OneShot". This means the rule will fire off one time, and then be removed from the list. So, two seconds into the game, it runs "Rule_Animation1" and checks to see if that squad is near the marker. Regardless of whether or not the squad is there, the "OneShot" will remove the rule so it never happens again...

  3. #3
    the map is completed, and with the thunderhawks working you can chech it here, in the maproom, is Tarsis Ultra Complete. Dimand and Dark40k solved the puzzle ^^

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •