Login

russian armor

Scar Code table and Events

25 May 2014, 17:08 PM
#1
avatar of Numennl

Posts: 19

Hey. Me and a friend are mapping multiplayer missions. To get things going, we need to get EVENTS working.

For instance

Event_TeamOwnsTerritory( Function callback, Table data, TeamID team, Int/Table/EGroup/Entity sectorID/group/entity[, ANY/ALL all, Float delay] )

Where can we find "Table data" from this section?. Can anybody give us documentation on this, examples or any lead in the right direction.

Much appreciated!
25 May 2014, 17:45 PM
#2
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

A good way to get examples is to extract Data.sga, SPScenariosEF.sga, TOWScenarios.sga, DLC#Scenarios.sga (# = 1, 3, 4, etc.)

and copy all .scar files from these folders to a new folder. You can use search *.scar in the windows explorer for this. Then get notepad++ and use search in files over the directory you copied all scar files.
25 May 2014, 17:54 PM
#3
avatar of Numennl

Posts: 19

already using notepad++ will give it a look after dinner. thank u for the quick response! We will probably run into more problems later, but this may get us started. Will update if it does.
31 May 2014, 21:38 PM
#4
avatar of Numennl

Posts: 19

I have a lot of things working. thank you for that (even though i already knew about the unpacker, didnt really give it a look yet).

i have most things going well, i have run into a few problems though, one of which i need some advice on:

when i try to call some events, the game tries to check wether the game is rtm or not (i think thats just a validation check if the game is modded or manufacturor default release). and then it says it tries to call global and comes back as nill. I seem to be unable to fix that. (even with adding -rtm in console before)

looking into the problem i don`t really understand why it does that either, because i use events like event_playerdoesntownterritory(callback, data, player, ter) and thats where it searches in event.scar line 168 Game_IsRTM, which is a part of events_add. (i can`t trace back why it goes to events_add in the first place).

any help by anybody?
31 May 2014, 21:55 PM
#5
avatar of Numennl

Posts: 19

just so u know what i`m building:

I am building scripts for the community to use, that transform multiplayer maps easily in more interesting multiplayer objectives / mission maps!

Convoy: both teams have supply trucks drive into the map from different sides and go over a route to the base. If the trucks make it, they deliver fuel, ammo and/or manpower. Destroying an enemy supply truck makes them lose victory points too.

Demolition: both teams have 2,3 or 4 static objectives to defend, being bridges, buildings, trucks, etc. As long as they are alive they provide a bonus to ammo, fuel, manpower, ability cooldowns, artillery calldowns, unit cost, etc. Destroying an enemy objective stops the bonus and the enemy loses victory points for it.

Officers: both teams have one officer per player to defend. The officer is unselectable. As long as an officer is alive, extra troops come to the battlefield every minute that attack move to the enemy base.

Stagewars: a mission that starts with convoy, upgrades to demolitions after 6 waves and upgrades to normal victory point control with 1 or victory points max after a set amount of objectives have exploded. Each stage increases interaction area (map size) in all directions, leaving bases in the middle of the map, trucks to defend, objectives to defend and attack and points to control.

I have completed the functionallity on Convoy and Demolitions and stagewars, working on officers right now. only the UI is still crap (have to figure out how to do pretty objective overlays with displaying pretty timers and all. have seen the functions, still have to give them a look).
1 Jun 2014, 01:15 AM
#6
avatar of Numennl

Posts: 19

another question, is there a list of ability BPO somewhere?
1 Jun 2014, 09:13 AM
#7
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Never used those events. I've often just manually scanned the target with intervals, like Player_OwnsEntity for territory sectors.

Lists of all kinds of blueprints can be found in AttribArchive/attrib/scar/luaconstsauto.scar
1 Jun 2014, 18:12 PM
#8
avatar of Numennl

Posts: 19

i tried to unpack the attrib for that reason, its the only one that the unpacker keeps failing at. i`ll ask a friend to do that then.
3 Jun 2014, 20:55 PM
#9
avatar of Numennl

Posts: 19

greatt. have most stuff working now. only UI for showing the progress of the convoy (feeding whats happening to the objective events) and the first game mode will be available!
3 Jun 2014, 20:59 PM
#10
avatar of Numennl

Posts: 19

If you want to use events, they are quite nice to use tbh. Intervals give you more control, but you have duplicate rules easily and events seem less intense on cpu (even though i cannot imagine anyway having performance issues with scripts). reduces the length of your script, for setting up an if else construction takes way more lines then using the single line for event. You can also stop events and re-enable them a bit easier. BUT using interval rules is easy to understand and they seem to be handled easier and more logical by the game. I used a mixture of the two eventually. Anyway, long story short. thnx for the bit of support, i will release the scripts down below when they are finished, one by one.
4 Jun 2014, 09:35 AM
#11
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Often my scripts contain data handling and storing it in various tables. Then looping comes in handy, for example looping trough a set of territory points. I've kinda taught myself into looping and checking, while using GameEvents as much as possible.

So far the most complex system I've coded for COH2 is Capture th Flag game mode, http://steamcommunity.com/sharedfiles/filedetails/?id=262090680

It has a few rules which are executed each frame.
6 Jun 2014, 22:28 PM
#12
avatar of Numennl

Posts: 19

I am just polishing the UI and objective display right now, adding some kicker messages etc.

I have run into another problem:

local mes_MissionConvoy = LOC("Mission: Convoy")
UI_SystemMessageShow(mes_MissionConvoy)

or just
UI_SystemMessageShow(LOC("Mission: Convoy"))

This works, BUT it displays
LOC: Mission: Convoy

and not just
Mission: Convoy

Can`t get it fixed, tried everything. what am i missing here?
7 Jun 2014, 00:31 AM
#13
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Code

function Util_CreateLocString(text)
local tmpstr = LOC(text)
tmpstr[1] = text
return tmpstr
end
7 Jun 2014, 15:51 PM
#14
avatar of Numennl

Posts: 19

9 Jun 2014, 23:05 PM
#15
avatar of Numennl

Posts: 19

UPDATE :

I have the 'mission: CONVOY' gamemode now basically finished for pvp!

I have run into a problem though. when i have squads enter the map using the createsquad function, but the player owner is an AI, the squads don`t listen to any of the prescripted commands (cmd_move()) etc. How do i fix this problem? is there an easy solution, or do i have to start messing with AI now?
9 Jun 2014, 23:16 PM
#16
avatar of Numennl

Posts: 19

AI_LockSquads() that wasn`t too hard. nvm thnx. Next post will be the script release!!!!

I need: A mapper that wants to help me get this script promoted! If anybody has an unreleased map that would go with dynamic combat and is suitable for convoys, let me know! (or i have to map one myself, which will take forever right now for me)
10 Jun 2014, 00:06 AM
#17
avatar of PureBunk

Posts: 70

Feel free to use one of my maps from the workshop if you wish. I don't have any unreleased - I have one WIP but it has WFA content so it's not playable right now unless you have the alpha. I'm not sure what you mean by suitable for convoys though since I'm not entirely sure what your script does... I can only imagine there is some kind of AI convoy roaming the map which makes me think you need a map where such a counvoy can continuously go in a circle? Or would they be able to spawn in, go in a straight line across the map, then spawn out if they make it safely? Anyway, if you want you're free to use any one of these - http://steamcommunity.com/id/PureBunk/myworkshopfiles/
10 Jun 2014, 00:18 AM
#18
avatar of Numennl

Posts: 19

Thnx for the offer PureBunk. Let me have a look there. Yes they spawn in, drive over a path of chosing and have to make it safely out again. They would optimally drive for both sides somewhere through the middle of the map, but stay slightly on the defends side. The path also has to cross the base and the convoy drives out through it again. For optimal gameplay that would be, if not possible they would spawn close to the base. like if you would tilt the map to be a diamond, they would enter the map slightly above and below the right corner, drive to the teams base and back to the other left corner.
10 Jun 2014, 00:21 AM
#19
avatar of Numennl

Posts: 19

your map Over and Under seems perfect for this gamemode! Do you want to add the script or should I? It is really easy. all you have to do is add SCAR markers with the proper names and proximity circle for the script to work (which are all easily explained in the read-me that comes with it)!!!
10 Jun 2014, 00:23 AM
#20
avatar of Numennl

Posts: 19

OH, that maps layout could not be MORE perfect for this gamemode. downloaded it now, playing it, the trucks could easily spawn on those roads, drive from one side, to each base, back out the other end. oustanding sir.!
1 user is browsing this thread: 1 guest

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

810 users are online: 810 guests
0 post in the last 24h
8 posts in the last week
37 posts in the last month
Registered members: 49101
Welcome our newest member, Dorca477
Most online: 2043 users on 29 Oct 2023, 01:04 AM