Monday, April 16, 2012

Looking for a little help scripting wise

I'm new to map modding, and having a blast messing around with the map editting tools. Now, the issue that I run into is when I have to play around with the script files. Basically, my friends and I enjoy playing a game-type where two players start the round with a paragon, have a certain amount of time to build defences, and then the other two man team must batter them down and destroy the Black Sun.
Previously, we'd just use the cheat console and spawn the paragons/black sun, but I thought I'd give it a crack to modify one of the official maps and add the units. That way we wouldn't have to enable cheating, and the temptation to spawn additional units would be gone, plus giving the game a more official feel.
I can spawn the units under a neutral civilian army, but the trouble I run into is trying to have two of the players start with the units. They have the units, but no ACU. Alternatively, if I just spawn the units under the civilian army and have the ACU capture them, it gets a bit tedious building up enough power to capture the paragons in a decent amount of time.
If someone would be able to teach me or show the technique to spawning units under the control of a certain player, my friends and I would greatly appreciate it. Thanks!|||Finished a map for my Siege game mode, and have uploaded it to the vault under Mountain Stronghold (The preview image got messed up somehow, hmmm).
Edit: Fixed the map preview in the vault.
Image
Anyways, the rules are that the attackers start in the lower left hand corner, and must work their way up to the defender's base, and destroy the black sun.
Attackers: Attackers have free roam to go anywhere on the map. They may build all experimentals, except no nukes/T4 artillery/T3 artillery (No T3 tac missile launchers either if you are playing with the Blackops mod). The attackers each have 600 mass to spend, so they need to ration their resources!
Defenders: May go anywhere on the map EXCEPT into the attackers base. The defenders each start with a paragon, and may only build T3 units. They cannot build nukes or T3 artillery.
If someone has free time, I'd be fully fine with them making it so the defenders each spawn with a paragon, and the unit restrictions are enforced. Right now we've been just spawning the paragons with the cheat console, but actually starting with them would be a nice touch. Also, if its possible to up the health on the black sun, that would be nice as well to prevent T3 bomber rushes on the main base.
Thanks, and tell me what you think about the map! (My first go at creating something that's my own :)).|||I have recently been messing with map scripting myself. I found a lot of useful info in the box o scripts sticky. I think it is manimal that posted a script on spawning an ACU. You may be able to adapt that to your needs. Also the campaign maps scripts are chock full of good examples of how to do all kinds of different stuff from the map scripts. Campaign maps are X1CA_001 through X1CA_006. I think the Tutorial map does some spawning also but I have not looked at that script yet
Good Luck!
Moe|||local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')
x,y,z = unpack(ScenarioUtils.MarkerToPosition('Markerofyourchoice'))
CreateUnitHPR( 'XAB1401', army, x, y, z,0,0,0)
'army' is the numerical representation of the army of choice.
you'll still need to fix a position for your new buildings, placing a marker on your map and amending the code above will do that.
There's actually quite a number of ways to do this, in the end it helps to get yourself the luadoc.

No comments:

Post a Comment