Results 1 to 11 of 11

[HOW-TO] Markers and SCAR basics

  1. Modding Senior Member  #1

    [HOW-TO] Markers and SCAR basics

    Hi there,

    I just felt that some of you might need some help with SCAR. Well, here we go... First I thought that I'd write a guide here on the forums, but then I changed my mind and wrote it in the fantastic ModsRUs-wiki. It's just way more comfortable for me to do it overthere (and people can improve it!). Hm, but I thought that all of you might be interested in this guide, just follow the Link:

    http://www.modsrus.com/wiki/doku.php?id=dow2:scar_tut_1

    Feel free to correct any mistakes I've made.

    Cheers!

    -cope.
    Last edited by Copernicus; 18th Jul 09 at 12:53 PM.
    "When life gives you lemons, make lemonade. Then use the profits to buy an assault rifle. See if life makes the same mistake twice."
    When to report?

  2. #2

  3. Modding Senior Member Dawn of War Senior Member  #3
    Father of Death Croaxleigh's Avatar
    Join Date
    Jun 2006
    Location
    A forgettable little corner of southwestern Kentucky
    Moving to "How To's and Tutorials."
    I has a Blurb. And one of those Tweeter things.
    Quote Originally Posted by roflmao
    I'd run with a shotgun to go hijack a private airplane and fly to Belgium. Nothing interesting ever happens in Belgium, so there's definitely no zombie apocalypse there.

  4. #4
    Confusingly, this tutorial is not working. I even cut and past the entire script you show out, and it does not work... same marker names and types.

    Just to note, I am running it in a skirmish in -dev mode on a very simple map with 2 hqs, no req points, no VPs, nothing of that sort. Just two players who apparently can't spawn units.

    To note it does not work even after fifteen seconds...

    Please, I'm a complete noob to all scripting and I wanna learn :/

    (if you would please recognize.. I am the author of Ultra Mortga)
    Last edited by UnnamedNewbie; 1st Aug 09 at 7:12 AM.

  5. Modding Senior Member  #5
    So it does just nothing? If the script had any mistakes in it, then there would be errors displayed - but if simply nothing happens it seems like you haven't set it up the right way. I might upload the script and the map as soon as I've got some time.
    And no, I don't recognize you. I don't even read the official forums reguarly 'cause 2 forums on one topic are too much and RelicNews has been the first one to cover mods.

  6. #6
    Hey, just updating this thread (yay internet necromancy!) - It's in the How-To section and I figured that since it seems to be one of the only places to get information and Cope's tutorial is quite useful, I'll throw a bone to budding modders (I just discovered this myself, I wanted to make a mod and I had the same problem like UnnamedNewbie):

    When you 'Save & Bake' your map it will create a baked version in:
    C:\Program Files\Steam\steamapps\common\dawn of war 2\GameAssets\data\maps\PVP
    NOT
    "C:\Program Files\Steam\steamapps\common\dawn of war 2\Assets\maps\PVP"

    So the scar file needs to be put in C:\Program Files\Steam\steamapps\common\dawn of war 2\GameAssets\data\maps\PVP , or it's root equivalent.

    The tutorial has a number of errors in it - these will throw scar errors at people, which may be intentional to teach them to watch for these types of mistakes - player1 is defined twice, the hormagaunt directory path is spelt incorrectly and oneshot needs a timer variable.

    Hope this helps!

  7. Forum Subscriber  #7
    have been having a go at basic scar for maps using cope's guide but am having no success, i changed bits here and there but i keep having fatal scar error POSITION MARKER ID IS INVALID
    UTILCREATESQUADSATMARKER LN456
    CHECK SCRYPT SYNTAX
    the scar code is basically the same as the tutorial and the marker ids match the maps (checked umpteen times)
    anybody shed some lite on this or point me in the right direction
    the scar script is below





    -- import RELIC's file to get access to their functions
    import("scarutil.scar")

    function OnInit()
    -- our spawnsquads function shall be executed every 15 seconds
    Rule_AddInterval(SpawnSquads, 15)

    end

    -- on initialization OnInit should be called
    Scar_AddInit(OnInit)

    function SpawnSquads()
    -- sgroups for the spawned squads
    sg_player1_units = SGroup_CreateIfNotFound("player1_units")
    sg_player2_units = SGroup_CreateIfNotFound("player2_units")

    player1 = World_GetPlayerAt(1)
    player2 = World_GetPlayerAt(2)

    -- our blueprints
    bp_sm_scout_marine = "sbps\\pvp\\race_marine\\troops\\sm_scout_marine"
    bp_tyr_hormagaunt = "sbps\\pvp\\race_tyranid\\troops\\tyr_hormagaunt"

    -- now we'll spawn the stuff

    Util_CreateSquadsAtMarker(player1, sg_player1_units, bp_sm_scout_marine, spawn_ally_mk_1, 1)

    Util_CreateSquadsAtMarker(player1, sg_player1_units, bp_sm_scout_marine, spawn_ally_mk_2, 1)

    Util_CreateSquadsAtMarker(player2, sg_player2_units, bp_tyr_hormagaunt, spawn_enemy_mk_1, 1)

    Util_CreateSquadsAtMarker(player2, sg_player2_units, bp_tyr_hormagaunt, spawn_enemy_mk_2, 1)

    Rule_AddOneShot(AttackEachOther, 1)

    end

    function AttackEachOther()

    Cmd_AttackMoveSGroup(sg_player1_units, sg_player2_units)

    Cmd_AttackMoveSGroup(sg_player2_units, sg_player1_units)

    end

  8. Forum Subscriber  #8
    hah got it figured eventually, dumb ass trying to modify scar ID file,
    the one shot variable still eludes me any pointers to what it actually does?

  9. #9
    Member Jaguar-Lord's Avatar
    Join Date
    Feb 2007
    Location
    france
    Rule_AddOneShot(AttackEachOther, 1) == "execute the "AttackEachOther" function only once the next sec. and do not repeat this rule execution. this is necessary when a duplicate of the rule is not necessary or worse may cause game to crash.

    function AttackEachOther == > all units belonging to the "sg_player1_units" squad group are issued the order to move and attack all units belonging to the "sg_player2_units" suqad group; these two squad groups were defined above
    in the spawn squad function.

  10. Forum Subscriber  #10
    thanks JL, yep without the add one shot function its multi spam of units infinum..still i will endevour if i can get some basic scar function maps then hopefully releaase a map or two with some extra goodies added to them

  11. #11
    Hi, here is the corrected and working SCAR coding;



    import("scarutil.scar")

    function OnInit()
    -- our SpawnSquads function shall be executed every 15 seconds
    Rule_AddInterval(SpawnSquads, 15)
    end

    -- on initialization OnInit should be called
    Scar_AddInit(OnInit)

    function SpawnSquads()
    -- SGroups for the spawned squads
    sg_player1_units = SGroup_CreateIfNotFound("player1_units")
    sg_player2_units = SGroup_CreateIfNotFound("player2_units")

    player1 = World_GetPlayerAt(1)
    player2 = World_GetPlayerAt(2)

    -- our blueprints
    bp_scouts = "sbps\\pvp\\race_marine\\troops\\sm_scout_marine"
    bp_hormagaunts = "sbps\\pvp\\race_tyranid\\troops\\tyr_hormagaunt"

    -- now we'll spawn the stuff
    Util_CreateSquadsAtMarker(player1, sg_player1_units, bp_scouts, spawn_marker_ally_1, 1)
    Util_CreateSquadsAtMarker(player1, sg_player1_units, bp_scouts, spawn_marker_ally_2, 1)
    Util_CreateSquadsAtMarker(player2, sg_player2_units, bp_hormagaunts, spawn_marker_enemy_1, 1)
    Util_CreateSquadsAtMarker(player2, sg_player2_units, bp_hormagaunts, spawn_marker_enemy_2, 1)

    Rule_AddOneShot(AttackEachOther, 1)
    end
    function AttackEachOther()
    Cmd_AttackMoveSGroup(sg_player1_units, sg_player2_units)
    Cmd_AttackMoveSGroup(sg_player2_units, sg_player1_units)
    end






    Im posting this so that people can learn the way it should be written.This is an excellant guide and i hope others find it useful.

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
  •