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.
How do map entry points work when scripting?
6 Mar 2018, 16:02 PM
#1
Posts: 12
6 Mar 2018, 21:24 PM
#2
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
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.
PAGES (1)
1 user is browsing this thread:
1 guest
Livestreams
8 | |||||
1 | |||||
32 | |||||
15 | |||||
7 | |||||
6 | |||||
2 | |||||
1 | |||||
1 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.655231.739+15
- 2.842223.791+5
- 3.35258.859+1
- 4.939410.696+5
- 5.599234.719+7
- 6.278108.720+29
- 7.307114.729+3
- 8.645.928+5
- 9.10629.785+7
- 10.527.881+18
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
11
Download
1265
Board Info
755 users are online:
755 guests
0 post in the last 24h
12 posts in the last week
26 posts in the last month
12 posts in the last week
26 posts in the last month
Registered members: 49989
Welcome our newest member, LegalMetrologyConsul
Most online: 2043 users on 29 Oct 2023, 01:04 AM
Welcome our newest member, LegalMetrologyConsul
Most online: 2043 users on 29 Oct 2023, 01:04 AM