Predetermined Stats

Status
Not open for further replies.
Level 1
Joined
Aug 4, 2018
Messages
3
Hello,

I've been working on a map that I've had a bit of trouble with. One of those problems being; that I have no idea how to make only certain players, not have their starting unit, fx when you've chosen your race and you enter the game - you'll be given your main hall of X-race and the worker units following. I want this to apply to only certain players, let's say two computers that already has their premade structures.

The second problem I have, is the computers: I can't seem to predetermine their colors. Let's say, I've put down buildings for dark green and brown - and within Player Properties, set their Controller to Computer, fixed - it still won't make those colors be only computer.

I hope a kind soul can help me with this problem.
Thanks in advance!
 
Level 13
Joined
Oct 12, 2016
Messages
769
For starting units, you'll have to make triggers for this or place pre-existing units. If the races are set for the computer players and their locations, then this is fine.

If you want to change the computer players' race, then you'll need to create the starting units with triggers.
For that, first press "F4." This is the trigger editor.
Next, delete this:
  • Melee Game - Create starting units (for all players)
This is a predefined default trigger that creates default starting units.
(Personally, I like to edit the predetermined races and starting units in the object data to abuse this trigger since it makes things short, sweet and simple)
After, I suggest reading up on how to make your own triggers. Everything here in the tutorials section will be of value:
Trigger (GUI) Editor Tutorials

And finally, to improve your map's performance, make sure you remove the inevitable memory leaks in your coding:
Things That Leak

To keep the players with the same colour, you also need to go to the "Map Properties -> Forces" tab and tick off "Use Custom Forces" with "Fixed Player Settings," not just fixed start locations in the "Players" tab. Without that, the editor will treat your map like a "Melee" game.
 
Level 1
Joined
Aug 4, 2018
Messages
3
Thanks a ton for answering! I have a bit of knowledge about how to use triggers and events, but could definitely learn more about it. I will look into it.
The problem is, if you delete that trigger - it will delete everyones starter units, I only want that to happen to the computers and not the players.

Never heard of memory leak before - thanks for the heads up on that one.

The thing is, if I click off "Use Custom Forces" I can't create the two teams.
If it helps, I've uploaded some pictures of how I've set up my current forces:

Update: I managed to assign the two computers only. Still ned some help with the starting units!

Another problem I've met, is that the neutral hostile creeps that spawns and attack move to, after a short period of time in combat, will return to their spawn area? I can't seem to find the problem, I've clicked off fleeing.
 

Attachments

  • helpwithforces1.jpg
    helpwithforces1.jpg
    69.3 KB · Views: 55
  • helpwithforces2.jpg
    helpwithforces2.jpg
    50.4 KB · Views: 60
Last edited:
Level 5
Joined
Jul 27, 2017
Messages
73
If you want to create Starting Units only for certain players then this function could contain the necessary information:
upload_2018-8-9_13-53-4.png


This is the default function creating the starting units.
If you use the code withing the red rectangle only for these players then it should create the units only for them.

About the fleeing creeps:
Usually they spawn at the location you want them to spawn.
What do you mean with "attack move to"? Are the creeps ordered by a trigger to attack or is that just the common way they attack when a player comes too close them?

In the second case:
There is a gameplay constant that shows the time after creeps return to their spawning point/ the point where they have seen an enemy unit. (I think it's hard coded that units return to their spot when they have no order to attack a unit/ doodadd/ etc.)
 
Level 1
Joined
Aug 4, 2018
Messages
3
Thanks a bunch for answering and sorry for the late reply!

I see. I need to look into this then, not sure how to do it - but it's a start to be sure.

I indeed use a trigger to make them attack and move to a specified region. It's a command you can do within the trigger panel, when they enter their designated spawned region. The only problem I've had this with was the categorised "Neutral Hostile" creeps. The scenario which this has to happen, is that the players have build a base in their designated areas - they are then to defend this base and the king from invading hostile creeps - but after the neutral hostile creeps have been in combat for x-seconds, they go back to their spawning region.
 
Level 13
Joined
Oct 12, 2016
Messages
769
You could try this in map initialization:
  • AI - Ignore the guard positions of all Neutral Hostile units
If it still does not work for Neutral Hostile, then you may need to do the same thing but for a player slot set as computer.
 
Status
Not open for further replies.
Top