PDA

View Full Version : SCAR in Console



camo1018
25th Sep 06, 8:19 PM
I've searched through the console and I noticed there was a command called, "Squad_CreateandSpawn." Are there any ways to make them work in Skirmish?

Thanks in Advance.

camo1018
26th Sep 06, 4:29 PM
I've also found some other commands like Util_CreateSquadatMarker.

Has anybody found anything about these commands?

naradaman
26th Sep 06, 7:09 PM
They're used in SP scenarios if I'm not mistaken. You should be able to find syntax information by browsing those SCAR files in Corsix's tool.

camo1018
26th Sep 06, 7:42 PM
Well, I did, but I'm not really sure if they are possible to be used in Skirmish mode.

naradaman
26th Sep 06, 7:53 PM
Well if you've figured out the syntax, do a test.

camo1018
27th Sep 06, 4:22 PM
I did, but the correct usage is like IMPOSSIBLE to figure out.

Honestly, I can't get the :censored: thing to define the players.

(What's the :censored: code for defining the ai player?)

Incarnate
29th Sep 06, 8:24 AM
I have not modded or even played this game, but im hoping to!

Scar is the code that makes the campaign work, and sets the win conditions in the skirmish. In Dow we code scar for skirmish to make the game bend to our will.

Check out the DOW tutorials to see how it works, then apply your new found knowledge to this game!

camo1018
29th Sep 06, 1:55 PM
Okay, I'll refer to it, but I have come up with another question.

Does DOW use the same squad system as in CoH?

I'm not sure if this really matters, but I thought it would be worth a try.

naradaman
29th Sep 06, 6:30 PM
Oh yeah, check SCARdoc on the RDN. There's a link to it in DoW modding.

camo1018
30th Sep 06, 1:31 PM
Okay, I found the DoW tutorials and I've seen the SCARDoc from the RDN.

However, I noticed that the usage of the functions are different slightly, such as the difference in function names and syntax (There is no Squad_Create in CoH, while it is present in DoW).

I'm going to look at the Campaign SCARs and see how they did it.

EDIT: I have a question about the skirmish maps that are loaded in the single player. Are the maps in the MP section of the scenario also loaded for the SP Skirmish?

camo1018
30th Sep 06, 2:59 PM
Phew! I got it!

I finally found a correct syntax to create a Volksgrenadier... well... in the middle of a map :).

There's some stuff you need to set up before you can actually create them, I might need to make a note of this for future use.

Okay, so here's the basic way (I am going to investigate further into this for extensive and intense scripts.... just for a preparation... *cough* Mission Editor *cough*.

Before you can create a Volksgrenadier into the map, you need to set three things in the console.
player2 = Setup_Player(2, 409006, "Axis Infantry Company", 2)
direct = World_Pos(0, 0, 1)
Okay... That's enough setting up.
Now you can spawn the Volksgrenadier by typing this...
Notes for you to take..
Before you can create a Volksgrenadier into the map, you need to set three things in the console.
player2 = Setup_Player(2, 409006, "Axis Infantry Company", 2)
direct = World_Pos(0, 0, 1)
Okay... That's enough setting up.
Now you can spawn the Volksgrenadier by typing this...
player2 = Setup_Player(2, 409006, "Axis Infantry Company", 2)

That should do the trick. As I mentioned above, this is probably the most basic way to do this.

Couple seconds ago, I thought SCAR was going to a bundles of hellhounds, but it turned out to be interesting and intriguing. I might look out for the marker-related stuff.

Soldier of Dest
30th Sep 06, 4:04 PM
Cool, good finding!

Wait a minute!

Your how-to list is weird ;)
You may want to correct something :D

camo1018
30th Sep 06, 4:29 PM
What? That isn't so! You are lying! Heh, actually, I knew there was going to be some error in there.

I just "scooped" that out my notes (I take notes on what I do on everything on daily basis).

Soldier of Dest
30th Sep 06, 5:29 PM
So what exactly do I have to write now?

player2 = Setup_Player(2, 409006, "Axis Infantry Company", 2)
direct = World_Pos(0, 0, 1)

?

camo1018
30th Sep 06, 6:47 PM
Well, I figured that defining the player in the console doesn't work. You have to manually do that through making SCARs for the Skirmish maps.

You can make the players to be defined with the OnSetup function.

Once you've done that, save it in the associated directory (I did mine as G:/WWII Games/Company of Heroes/Paul's Module/Data/Scenarios/mp/), making sure that it is in SCAR format. Corsix's tool will automatically pick it up. Load the map you just changed.

THEN open up the console and define where you want the soldiers to spawn (first int is the x-axis, second int is unknown, and third int is the y axis. This is based on the angle 45 degrees to the west from the normal view, which you would get by pressing the tab twice.)

I did mine as base = World_Pos(150, 0, 40). Which in Angoville, there will be U.S. troops spawning in the road adjacent to their base.

Everything is set for the creation. Try typing in this command:
Squad_CreateAndSpawn(SBP.AXIS_VOLKSGRENADIER, player1, 0, base)
This will create a Volksgrenadier in their base designated by the variable "base."
The first argument is the blueprint of the squad (This could also be vehicles.) The second argument is the ID of the player, the third argument is the number of the loadout (If this is set to 0, the minimum loadout will be selected), and lastly, the fourth argument is the position the squad will be created.

It is my hope that this is clear enough for you to understand. I'm not that much of a "tourist" :p.

EDIT : I'm having a massive fun with this new foundation!

I feel like I turned Angoville into a bloody campaign. I never though SCAR was this powerful... except for some reason I get a lag periodically.....

naradaman
30th Sep 06, 8:33 PM
Good work man, I had a quick look at one of the tutorial SCARs and gave up.

One thing I did wonder though, was where the label "SBP.AXIS_VOLKSGRENADIER" is assigned. 'cos that's not the name of the LUA is it?

Corsix
1st Oct 06, 2:40 AM
Good work man, I had a quick look at one of the tutorial SCARs and gave up.

One thing I did wonder though, was where the label "SBP.AXIS_VOLKSGRENADIER" is assigned. 'cos that's not the name of the LUA is it?
It is defined in "data\scar\luaconsts.scar" as:
AXIS_VOLKSGRENADIER = World_GetPropertyBagGroupID("sbps/races/axis/soldiers/volksgrenadier_squad.lua")

camo1018
1st Oct 06, 8:36 AM
Yes.

I've been using luaconsts.scar as my reference for all the units.

camo1018
1st Oct 06, 6:29 PM
Has anyone who tried this have problem with lags that happen about every four seconds?

I'm not sure if this has been happening before, because the computer would never build whole bunch of an army, but even if I wipe all of them out, my game is still lagging.

naradaman
2nd Oct 06, 1:26 AM
@corsix, ahh okay! thanks.

@camo: Maybe theres a 'while' loop going or something?

camo1018
2nd Oct 06, 5:36 PM
Whew... I have suspected that, but if that's so, that means the AI is not involved.... or maybe it is... I don't know, I'll check on that issue after I make Argoville Campaign.

camo1018
3rd Oct 06, 5:02 PM
Okay, I'm not sure about this laggage....

I'm suspecting that my SCAR could be the problem, but only thing it contains the OnGameSetup function...

Could this be looping and causing the lag?

Delphy
4th Oct 06, 4:13 AM
Can you post what you have so far? (You can attach files using the Go Advanced button)

naradaman
4th Oct 06, 5:30 AM
Since when can we attach stuff? Good move anyway delphy, atleast for the modding fora.

Delphy
4th Oct 06, 5:51 AM
Since a couple days ago when I enabled it :)

camo1018
4th Oct 06, 5:24 PM
function OnGameSetup()
player1 = Setup_Player(1, 409005, "Allied Rifle Company", 1)
player2 = Setup_Player(2, 409006, "Axis Infantry Company", 2)
end


That's it....

EDIT : Well actually, the problem was that I kind of messed up the scar files in the SCAR section, which caused a looping fire and forget action....

I've tested it now... seems like I get no lags.... I hope it stays that way now.

I'll come back with more info later.

camo1018
4th Oct 06, 6:57 PM
Yeah... It's working perfect now :)...
I might add some periodical rules to it, so that I don't have to do it manually.

Also, forget about that looping fire-and-forget action as that was some random statement from ui/reveal.

My scar was not the problem. It seems that while I was messing around with the AI and scar utils, I may have accidentally saved something that I wasn't intending on saving.