Login

russian armor

How do map entry points work when scripting?

6 Mar 2018, 16:02 PM
#1
avatar of EagleOne

Posts: 12

Hi modding community,

You were a great help last time I posted asking questions, and since then I have made great progress in my endeavors. I've been experimenting with more and more things, and one of those things is spawning units. I've created a custom UTC (Universal Troop Carrier) from the original M5 Half-Track for my infantry only game mode, and it's working great.

There is however something I'm not quite understanding, and that is the default behavior when a player doesn't have a "map_entry_point" entity.

I couldn't find a function in the ScarDoc for returning the ScarPos of a player's map entry point, so I did some regex searching through the Data archive and managed to find something in deploymentpoints.scar. The function they were using would look through a player's entities trying to find a blueprint matching "map_entry_point", returning its ScarPos if found, or false if not found.

My custom Half-Track should spawn at the map entry point of each player, and begin driving toward the owning player's start position. This works perfectly fine, but only for those players that have a map_entry_point. I was under the assumption that every player would have a map entry point, as every player can successfully call in off-map unit support.

So how does the game normally handle this situation regarding map entry points? What happens in the event a player doesn't have a map entry point entity, but calls in off-map units? I mean there is even a Player_HasMapEntryPosition function to test if a player has an entry position, but what does the game do if this returns false? It's not like player's units just don't show up.

My work-around was to find a map_entry_point for one player on each team, and then use that as the respective entry point for every player on that team. This works fine, but I'm just wondering if there is a "better" way to do this. Perhaps something similar to Player_GetStartingPosition?

Thanks for your time.

6 Mar 2018, 21:24 PM
#2
avatar of eliw00d
Honorary Member Badge

Posts: 756 | Subs: 8

The problem is that if a player does not have any starting territory from something like an HQ, then they do not actually "own" any map entry points. There are no SCAR functions for getting neutral map entry points. However, you might be able to get them using a combination of World_GetNumEntities and World_GetEntity and then comparing distance to their starting position (which a player always "owns").
8 Mar 2018, 01:42 AM
#3
avatar of EagleOne

Posts: 12

The problem is that if a player does not have any starting territory from something like an HQ, then they do not actually "own" any map entry points. There are no SCAR functions for getting neutral map entry points. However, you might be able to get them using a combination of World_GetNumEntities and World_GetEntity and then comparing distance to their starting position (which a player always "owns").


Excellent idea. Didn't know their were neutral entry points.. but it makes sense. I'll give that a shot.
1 user is browsing this thread: 1 guest

SHOUT IT OUT!

No ProfanityNumber of ShoutsRefresh Shout Box
Lady Xenarra: @Willy Pete The lack of April Fools this year is odd lol
Last Wednesday, 01:34 AM
Willy Pete: @Rosbone not dead yet. when that happens the font will switch to Papyrus :*(
Last Wednesday, 00:16 AM
dasheepeh: it was an honor guys :guyokay:
01 Apr 2025, 20:34 PM
aerafield: yeah I already prepared my "Can't believe there's comic mode for the 10 daily visitors even on this April 1st" :guyokay:
01 Apr 2025, 20:29 PM
Rosbone: @dasheepeh I guess that means this site is officially dead :guyokay:
01 Apr 2025, 20:19 PM
dasheepeh: no comic sans font for april 1st this year?
01 Apr 2025, 19:56 PM
Willy Pete: @Lady Xenarra this you? https://i.imgflip.com/3e4thi.jpg
01 Apr 2025, 02:53 AM
Lady Xenarra: Does anyone else think that USF needs buffs? It feels like they’re on life support sometimes
01 Apr 2025, 02:36 AM
Willy Pete: @Rosbone Ahh I missed that memo. I still think its a bad decision though. Adds frustration for players and isnt gonna make them that much money
27 Mar 2025, 15:46 PM
Rosbone: It is also good they left it free until after the free to play weekend. Points for that.
27 Mar 2025, 09:34 AM
Rosbone: But I agree, the cost to get a full decent Coh game pushing $115 US is not the best idea. Especially when it needs so much more work for casuals.
27 Mar 2025, 09:32 AM
Rosbone: To be fair, it was a thank you to early fans right? They said it was not free for long and it would become a pay DLC at some point.
27 Mar 2025, 09:30 AM
Willy Pete: Re-releasing free DLC so they can charge new players money for it. Brilliant marketing strategy :clap:
27 Mar 2025, 04:31 AM
Soheil: Coh2 still broken server ?
25 Mar 2025, 18:27 PM
Rosbone: Congrats to Relic. Looks like Coh3 has finally usurped Coh2 s the popular Coh. You smell terrific. :snfQuinn:.
24 Mar 2025, 02:46 AM
Nickbn: and again someone else replies. I mean come on guys. Give @adamírcz a chance
22 Mar 2025, 14:00 PM
Willy Pete: @Nickbn you didn't ask a question, and this is a chat box...
20 Mar 2025, 13:11 PM
Nickbn: @Rosbone it's incredibly rude to speak on someone elses behalf, especially when a question is directly adressed to them. I understand your passion for the subject at hand but I want to hear from him.
20 Mar 2025, 10:16 AM
Rosbone: @Nickbn No, I am just saying people should not be using any Relic owned forum since they have proven they ban anyone who says true things about Coh3.
18 Mar 2025, 19:01 PM

Livestreams

unknown 15

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

413 users are online: 413 guests
1 post in the last 24h
9 posts in the last week
72 posts in the last month
Registered members: 53375
Welcome our newest member, Butddeux23
Most online: 2043 users on 29 Oct 2023, 01:04 AM