bb
General
Blitzkrieg junkie (tried to quit several times).
Posts: 1,362
|
Post by bb on Nov 10, 2009 6:27:25 GMT 1
I'm making a map where a group of tanks should rescue some soldiers. The tanks shouldnt be under the player comand untill they get in the place of where the soldiers are, but they will face some enemy in the path and should fight their way through the soldiers...
I know there is a way to work with this in the editor, I think is by diplomacy: alex and Leon discussed this in the BKP forum some time ago, but I cant remember... Someone can help me in this subject? Thanks, bb
|
|
|
Post by LouisXIV on Nov 10, 2009 12:09:32 GMT 1
You can make the attacking units Player 0, but give them commands that repeat frequently until they arrive in the target zone. That way even if the player tries to get them to do something else, they will just go back to their original orders until they are finished.
(It's been a while since I scripted, so this is not necessarily correct:)
RunScript(AdvTks,3000);
function AdvTks() Cmd(3,1001,x,y); if GetNScriptUnitsInArea(1001,"Target") >= 1 then Suicide(); end; end; I once scripted a Player 1 attack which included tanks, infantry and anti-tank guns. They were scripted to advance 500 pixels every minute or so, then pause. In the test run, I killed them off, including shooting the crews off a couple of the guns. I crewed the guns, thinking I could use them. No, they began marching 500 pixels to my rear every minute no matter what I ordered them to do, and were useless to me until they reached their destination. Then I could use them.
I think the solution that was proposed previously was that you make a multi-player map with two players on one side, but one is controled by the player and the other by scripting. When the requirement is satisfied, change player to 0 on the scripted side.
|
|
bb
General
Blitzkrieg junkie (tried to quit several times).
Posts: 1,362
|
Post by bb on Nov 10, 2009 17:22:42 GMT 1
hm, this script is the ordinary "swarm" scrpit, meaby if I wont use Suicide() and give it KillScript after get in area target it can run. Still, I believe the player can interfere on the tanks trajectory.
I remember in Stalingrad, the "Elevator Grain" mission has something very close to this idea, but I cant figure how they made it.
|
|
kaoz
General
inter faesces et urinam nascimur
Posts: 1,112
|
Post by kaoz on Nov 15, 2009 4:07:29 GMT 1
bb - in MapEditor, make 3rd party and make it side 0 give these units ScriptID and perform a ChangePlayer at the moment you need it, thus from player 2 to player 0
|
|
bb
General
Blitzkrieg junkie (tried to quit several times).
Posts: 1,362
|
Post by bb on Nov 15, 2009 16:56:42 GMT 1
Kaoz. Thanks for your answer. I could find the solution by myself, but the greatest problem is the map editor do not allow reinforcement as 3rd party (I dont know why). I solved it making a reinforcement as player 0 and after changing it to player 2.
|
|
Ocelo
General
Map Artist/Eastern Front enthusiast
Posts: 1,400
|
Post by Ocelo on Nov 16, 2009 6:46:54 GMT 1
Hmm... I fiddled with Diplomacy when making my map making tutorial, but the units in party 2 just didn't appear on the map for some reason!
Did it work, BB?
|
|
bb
General
Blitzkrieg junkie (tried to quit several times).
Posts: 1,362
|
Post by bb on Nov 16, 2009 15:20:46 GMT 1
Yes, you must make the units as player 0 and than change it by script.
|
|
Ocelo
General
Map Artist/Eastern Front enthusiast
Posts: 1,400
|
Post by Ocelo on Nov 16, 2009 21:54:23 GMT 1
I mean when the units are on the map at mission startup? Or must they be changed by script in any case?
|
|
kaoz
General
inter faesces et urinam nascimur
Posts: 1,112
|
Post by kaoz on Nov 16, 2009 22:58:23 GMT 1
the map editor do not allow reinforcement as 3rd party (I dont know why). mhm, you could make reinf, give them ScriptID and set to player 2 (being side 0 while player 3 =neutral). next you can LandReinf their ScriptID being player 2...
|
|
bb
General
Blitzkrieg junkie (tried to quit several times).
Posts: 1,362
|
Post by bb on Nov 17, 2009 15:21:01 GMT 1
I mean when the units are on the map at mission startup? Or must they be changed by script in any case? Yes, they must be changed by script, even to just appear in the map when you start. Or try the method proposed by Kaoz and tell us if it run.
|
|