Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Some basic issues
Some basic issues
May 10 2017, 11:36 am
By: Nettles  

May 10 2017, 11:36 am Nettles Post #1



First one is very basic but I haven't touched the editor for 15 years so I've forgotten a few things.

Elapsed time is 1 second
Create 1 civilian at level select for player 1

Player 1 is in Force 1 with allies players 2,3,4,5.

Players 6,7,8 are Force 2 CPU.Yet half the time i start the game the civilians produced are enemy.Is there a way to fix this?

Second i want to create 5 comsats for the players for the final stage.That work without CC.I have scmdraft how can i do this?

Finally this isnt really essential but is there a way for a player 9 DT to be visible by current player without friendly detector units or buildings? Alliance settings for player 9 possible?



None.

May 10 2017, 12:58 pm Pr0nogo Post #2



If the trigger that spawns the civilian is owned by more than player 1, that would be why multiple civilians are spawning.

You can probably move/change ownership of pre-placed com-sat stations, but I don't believe you can create your own functioning ones without an attached command center.

I don't know about player 9 off the top of my head, but there's no trigger for it in AI scripts so probably not. Someone more informed than I will answer it in more detail, I'm sure.




May 10 2017, 2:49 pm ihjel Post #3



Random start locations being is the only thing I can see making the unit spawn for the wrong player.

You can preplace addons for a player. However you cannot use the give trigger on addons. Moving the addon will disconnect and be given to player 12 if it's connected to a building, if it's stand alone it will retain ownership. What you can do is to preplace them for a rescuable player (or a computer player turned rescuable later). OR if you just want them to be unuable until a certain time, disable them or constantly set their energy to zero.

You cannot give vision of player 9-12 as there's no AI script for that and I believe they don't even have vision. So detectors is the only way.

Post has been edited 2 time(s), last time on May 10 2017, 3:18 pm by ihjel.



None.

May 10 2017, 6:38 pm NudeRaider Post #4

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Not sure if relevant, but just in case: If you create units for a specific player (e.g. Player 1 as opposed to Current Player or Force 1) the unit will be created for that player even if that slot is unoccupied, or the player is defeated.
The unit will always be shown as hostile, regardless of the ally status of the player slot. Also it will either retaliate or attack on sight. (not sure which one)

That can easily happen without you realizing when randomized start locations are active for a (any?) force.




May 12 2017, 9:03 am Nettles Post #5



Quote from NudeRaider
Not sure if relevant, but just in case: If you create units for a specific player (e.g. Player 1 as opposed to Current Player or Force 1) the unit will be created for that player even if that slot is unoccupied, or the player is defeated.
The unit will always be shown as hostile, regardless of the ally status of the player slot. Also it will either retaliate or attack on sight. (not sure which one)

That can easily happen without you realizing when randomized start locations are active for a (any?) force.
Yes this is an issue I'm having.
Example
Player 1 brings 1 civilian to beacon1
Create 1 zealot for player1
Create 1 zealot for player 2

In a situation where only player 1 is in the game the second unit will be hostile even if forces and alliances are set? What about creating a zealot for current player with the trigger applying to players 1&2 would that make any difference?

Thanks for previous replies i have been able to fix most of the bugs.Unticking random start locations fixed player1 civilian spawn.




May 12 2017, 4:18 pm NudeRaider Post #6

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Player setup and intended conditions and actions for the respective players are the defining factor for the resulting triggers. So I'm gonna explain increasingly difficult examples, each time introducing a new mechanic. At the end you should be able to figure out even complex relationships. So bear with me if this is gonna be a bit longer.

First you need to define which player(s) the conditions should be checked for.
If it's really just P1 then you can leave P1 in the conditition. Should any player (of Force 1) be able to trigger it, then tell sc just that by making the condition "All Players (or Force 1) brings ..."

As for the action you probably never wanna create units for a specific player (P1, P2, etc.) unless you are 100% certain that player is always there. Creating units for All Players or Force 1 is also only useful if you have only 1 trigger owner. Also trigger owner can radically change the outcome of triggers: That's because triggers owned by multiple players, will be copied for and run by each player so each player will spawn the specified amount of units. Example:
Trigger
Players

  • Player 1
  • Player 2
  • Conditions

  • Player 1 brings Civ to beacon
  • Actions

  • Create 1 Marine for All Players

  • This will create 2 Marines for each active player (occupied slot and not defeated). So you avoid hostile units for "ghost players" but are probably creating more marines than you wanted.

    So what you wanna go for is use Current Player. Current Player is whoever currently runs this trigger. Remember, each owner will run their own copy of the trigger. When P1 runs it, Current Player is replaced with P1, when P2 runs it Current Player = P2.
    Trigger
    Players

  • Player 1
  • Player 2
  • Conditions

  • Player 1 brings Civ to beacon
  • Actions

  • Create 1 Marine for Current Player

  • This will create 1 Marine for both P1 and P2 but will skip any players that aren't there because they won't run their copy of the trigger. Only active players execute triggers.

    Using Current Player is the cleanest way, but also requires some extra care if you have actions that should run only once (e.g. reward 100 Minerals to whoever brought the civ) AND actions that each player should run (e.g. create 1 Marine for them).
    You could do it like that:
    Trigger
    Players

  • Player 1
  • Player 2
  • Conditions

  • Current Player brings 1 civ to Beacon
  • Actions

  • Give 100 Minerals to Current Player
  • Create 1 Marine for Force 1 *

  • *) Only works as intended if P1 and P2 are the only ones in Force 1. Only one Player has their condition true about the civ being there, so only that player will run it. They will give themselves 100 Minerals and create the units for everyone.

    For really complex setups where the players aren't even in the same force, the cleanest way is to use a death counter variable to keep track of who runs what and split it up:
    Trigger
    Players

  • Player 1
  • Player 2
  • Conditions

  • Current Player brings 1 civ to Beacon
  • Actions

  • Set death counter 'Cantina' (rename to 'civ_beacon' or w/e) set to 1 for P1
  • Set death counter civ_beacon set to 1 for P2
  • Set death counter civ_beacon add 1 for Current Player

  • Whoever brings the civ to the beacon has 2 deaths of 'civ_beacon', the rest has 1.

    Trigger
    Players

  • Player 1
  • Player 2
  • Conditions

  • Current Player suffered exactly 1 death of civ_beacon
  • Actions

  • create 1 Marine for Current Player
  • Set deaths of civ_beacon to 0 for Current Player

  • If you have 1 death you weren't the player that brought the civ, so you just get a marine.

    Trigger
    Players

  • Player 1
  • Player 2
  • Conditions

  • Current Player suffered exactly 2 deaths of civ_beacon
  • Actions

  • Give 100 Minerals to Current Player
  • create 1 Marine for Current Player
  • Set deaths of civ_beacon to 0 for Current Player

  • If you have 2 deaths you brought the civ, so you just get a marine and extra minerals.

    I hope the color coding helps you keep track who is who and how the dc count keeps them separated among the various triggers.
    Keep in mind there's ways to write these things in fewer triggers, but for the sake of better understanding I kept it pretty extensive.




    May 28 2017, 3:37 am Dungeon-Master Post #7



    Oh my god. Current player. That's dumb, but I never realized you could do that to prevent spawning of hostile units.

    Shows i've always just dabbled in mapmaking.

    Amazing piece of tutorial, nude.



    None.

    May 28 2017, 9:14 am NudeRaider Post #8

    We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

    You're welcome.
    In hindsight I should've probably mentioned that creating units for 'All Players' or a force also avoids creating hostile units for "ghost players". Doing it this way, however, has the explained problem of trigger owner. But if you can give it to single player that will always be there, e.g. a computer player, you could also use 'All Players' or a force. Though I find the Current Player solution to be cleaner and easier in the long run, if used consistently.




    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [03:36 pm]
    Oh_Man -- a program called mapstats I think it's on here to DL
    [02:39 pm]
    GGmano -- so theres a limit on total triggers on around 80k?
    [02:38 pm]
    GGmano -- thanks for info anyway
    [02:38 pm]
    GGmano -- how did you found that out ohh man?
    [02:15 pm]
    Oh_Man -- mapstats says 80k triggers
    [2022-7-02. : 9:37 pm]
    GGmano -- maybe its not about the size i guess since its now above 6000 and was saved
    [2022-7-02. : 9:05 pm]
    GGmano -- just seems like 6000kb is an obstacle not sure
    [2022-7-02. : 9:05 pm]
    GGmano -- idk it could also be about the map size its like above 6k kb map wont be saved,, 6000kb of triggers no sounds im aware sounds can go beyond that size
    [2022-7-02. : 8:51 pm]
    GGmano -- heres link for the new release http://www.staredit.net/topic/18475/#1
    [2022-7-02. : 8:51 pm]
    GGmano -- i now released it after deleting triggers 3 times sadly
    Please log in to shout.


    Members Online: Moose, GGmano, Roy, jun3hong