Basically, I'm trying to make the simplest map possible:
- A humvee ("jeep") assigned to team creeps spawns in, and follows a four waypoint patrol.
- Remove fog of war/shroud so I can easily see what's happening.
Code: Select all
Player:
Shroud:
FogEnabled: False
ExploredMapEnabled: True
Code: Select all
WorldLoaded = function()
SendPatrol()
end
Wow that was fast!Sleipnir wrote: ↑You define your SendPatrol function, but never call it from anywhere! The game interacts with your script through the WorldLoaded function, which is called once at game start, the Tick function, which is called once per game tick, and through any callbacks that you bind to triggers.
Adding something like the following to your lua file would be a good starting point (but note that I haven't tested anything, so you may still have other problems lurking)Code: Select all
WorldLoaded = function() SendPatrol() end
Code: Select all
Patrol = { "jeep" }
PatrolPath = { Patrol1.Location, Patrol2.Location, Patrol3.Location, Patrol4.Location }
SendPatrol = function()
Reinforcements.Reinforce(Creeps, Patrol, PatrolPath, 15, function(vehicle) vehicle.Patrol(PatrolPath, true, 5) end)
end
WorldLoaded = function()
SendPatrol
end
Code: Select all
Patrol1: waypoint
Owner: Neutral
Location: 30,23
Alright, I got the patrol working! Just two problems left:Materianer wrote: ↑Hi
the () is definitly needed for the function call in world loaded
You also need to define what creeps is with
Creeps = Player.GetPlayer("Creeps")
the waypoints are right in the yaml?
You are welcome here if you need help http://www.sleipnirstuff.com/forum/view ... 83&t=20361
I hope i will get some people in there for improving coding skills.
You need to define enemys in the map.yamllibbmaster wrote: ↑Alright, I got the patrol working! Just two problems left:Materianer wrote: ↑Hi
the () is definitly needed for the function call in world loaded
You also need to define what creeps is with
Creeps = Player.GetPlayer("Creeps")
the waypoints are right in the yaml?
You are welcome here if you need help http://www.sleipnirstuff.com/forum/view ... 83&t=20361
I hope i will get some people in there for improving coding skills.Updated files attached. Thank you for all the help, and I'll be sure to stop by that thread!
- The Jeep is my team color, and I cannot target it!
- Map is still shrouded.
Code: Select all
PlayerReference@Creeps:
Name: Creeps
NonCombatant: True
Faction: Random
Enemies: GDI
PlayerReference@GDI:
Name: GDI
AllowBots: False
Playable: True
Required: True
LockFaction: True
Faction: gdi
LockColor: True
Color: F5D378
LockSpawn: True
LockTeam: True
Allies: GDI
Enemies: Creeps
Code: Select all
Player:
Shroud:
FogEnabled: False
ExploredMapEnabled: True
D'oh! Of course I missed that. Heh...
Roger that! I'll go try this now.Materianer wrote: ↑ the color is because you load cnc|rules/campaign-palettes.yaml
Maybe its better if you test with a nod enemy, creeps are supposed to be noncombatants
and the shroud remove didnt work becausemust be in the rules.yamlCode: Select all
Player: Shroud: FogEnabled: False ExploredMapEnabled: True
A while ago dont know how long maybe 2 years it was there in the map.yaml but that changed.
Seems like the tutorial on the github page is outdated.
Maybe the best is if you look in the mission mapfiles how it is working now.