Jump to content


Photo

REL - Space Colony Scripting


47 replies to this topic

#1 Tropical Bob

Tropical Bob

    title available

  • Members
  • 1,348 posts

Posted 23 December 2009 - 07:28 AM

File: Space Colony Scripting
-Extract to the main Phoenix Rising v1.1 directory.

I'm happy to announce that the scripting in question works, and is now available to you!
Posted Image
Basically, it utilizes two new script files inserted into the AI's plot files for the campaigns. Minimal collateral damage when inserted. If anyone has modified either of the plot files included, it only takes a one line reference to the script files included.

If you prefer to do everything manually, follow PR's instructions below. Take warning, however, as it is a long and arduous task.

Attached Files


Edited by Tropical Bob, 25 March 2010 - 07:32 AM.


#2 Phoenix Rising

Phoenix Rising

    Beyond the Impossible

  • Petrolution Staff
  • 6,509 posts
  • Projects:Phoenix Rising
  •  Mod Leader
  • Division:Petrolution
  • Job:Mod Specialist

Posted 24 December 2009 - 02:50 AM

Thanks for making the thread... I really want the news to stay on topic. I was just going to PM you, but this should be public knowledge.

Okay, so there's not much technicality to this; it's mainly brute force. You're going to be copy-pasting and renaming one block of data over and over. I'll start:

<Event Name="E_Conquer_Abregado-rae">
		<Event_Type>STORY_CONQUER</Event_Type>
		<Event_Param1>Abregado-rae</Event_Param1>
		<Event_Param3>FILTER_FRIENDLY_ONLY</Event_Param3>
		<Reward_Type>UNIQUE_UNIT</Reward_Type>
		<Reward_Param1>E_Space_Colony_1</Reward_Param1>
		<Reward_Param2>Abregado-rae</Reward_Param2>
		<Prereq>Universal_Story_Start</Prereq>
		<Perpetual>True</Perpetual>
	</Event>
Paste this twice in a new text/XML document. Open Planets.xml, find the string <Planet Name=, and hit F3 twice to go past Abregado-rae. That'll be the next planet. In the second data block of your new file, replace every instance of Abregado-rae with this planet name (should be Aeten_II). Copy-paste that block after and keep going until you run out of planets. Then, take your result and duplicate it to a new file. Find-replace every instance of E_ with R_ (you can usually just get away with that if you enforce capitalization). That's it for the data entry.

The easiest way to get it working in the mod is to append it to the tech tree files - Tech_Tree_Empire.xml and Tech_Tree_Rebel.xml. That's it. Stop reading now unless you're really XML-proficient.

Of course it's bad form to just throw it in the tech trees, so if you really want it to be properly modular you'll need to add each one to its own XML file. Make two new XMLs named Story_Colony_Fix_E.xml and Story_Colony_Fix_R.xml with the following contents:

<?xml version="1.0" ?>
<Story>


	<Event Name="Universal_Story_Start">
		<Event_Type>STORY_ELAPSED</Event_Type>
		<Event_Param1>0</Event_Param1>
	</Event>


</Story>
After the Universal_Story_Start block, paste the scripting data you just made. Throw the files in PR\Data\XML. Then, in Story_Plots_Empire_AI_Heroes_EXP.xml and Story_Plots_Rebel_AI_Heroes_EXP.xml, make a new active plot for Story_Colony_Fix_x.xml. Now you can turn it on and off at will and don't have to clutter up the tech trees.

Note, this will add a free colony for both player and AI. PR v1.2 will use different story plot files for player and AI, but, for now, it's an inevitable side effect without further revisions. Nevermind this. I've since specialized the AI story files, but that was not the case in v1.1. You can do it for only the AI quite easily (see above).

Edit: Fixed v1.2 oversight. Condensed script further (same result either way).

Edited by Phoenix Rising, 25 December 2009 - 03:22 AM.


#3 Tropical Bob

Tropical Bob

    title available

  • Members
  • 1,348 posts

Posted 24 December 2009 - 07:48 AM

Hooray! Thanks mucho PR.

I'll get right onto it. Hopefully I'll have it done soon-ish.

#4 Ghostrider

Ghostrider

    Sith Lord of Campaigns

  • Project Team
  • 2,035 posts
  •  Phoenix Rising QA Lead; Manual Editor

Posted 24 December 2009 - 10:32 AM

Methinks it's time to open the caffeine jar and play loud music in the background to stave off the mind numbing tedium of this task!

Nice job!

#5 Tropical Bob

Tropical Bob

    title available

  • Members
  • 1,348 posts

Posted 24 December 2009 - 11:45 AM

Methinks it's time to open the caffeine jar and play loud music in the background to stave off the mind numbing tedium of this task!

Nice job!

Especially when it comes to the testing part...and the fact that the first attempt didn't seem to work! D'oh...

EDIT: Damn! Work intrudes on testing time. Won't be able to do anything probably until either tonight or after Christmas...

PR: Would possibly a <Event_Param2>1</EventParam2> have to be added in for the "STORY_CONQUER" events, so the script knows that it only takes one conquer to trigger, or does that not matter (I don't know pretty much anything about the XML story scripts, and couldn't find any explanations online)? That's the only thing other than maybe what I PM'd you about that I can think of right now.

Edited by Tropical Bob, 24 December 2009 - 12:46 PM.


#6 anakinskysolo

anakinskysolo

    Phoenix Rising Fan

  • Members
  • 490 posts
  • Location:Chile

Posted 24 December 2009 - 07:17 PM

What will this do exactly? Automatically give the AI a Space Colony I once it conquers a planet? And will the AI be able to construct the other space colonies?

#7 Tropical Bob

Tropical Bob

    title available

  • Members
  • 1,348 posts

Posted 24 December 2009 - 09:50 PM

What will this do exactly? Automatically give the AI a Space Colony I once it conquers a planet? And will the AI be able to construct the other space colonies?

The consensus is that the AI can upgrade the Space Colonies. It just can't build the first level for whatever reason. So yes, this will gift the Space Colony Level One to the AI (And consequently the player) upon conquering a planet. Just a temporary workaround for v1.1 and maybe v1.2 until PR is able to PR-ize the AI.

#8 Phoenix Rising

Phoenix Rising

    Beyond the Impossible

  • Petrolution Staff
  • 6,509 posts
  • Projects:Phoenix Rising
  •  Mod Leader
  • Division:Petrolution
  • Job:Mod Specialist

Posted 25 December 2009 - 03:10 AM

PR: Would possibly a <Event_Param2>1</EventParam2> have to be added in for the "STORY_CONQUER" events, so the script knows that it only takes one conquer to trigger, or does that not matter (I don't know pretty much anything about the XML story scripts, and couldn't find any explanations online)?

No, there is no parameter 2 for that event. You were right in the PM... the last part is formulated for v1.2. My fault. Will fix now.

#9 Tropical Bob

Tropical Bob

    title available

  • Members
  • 1,348 posts

Posted 27 December 2009 - 09:46 AM

Sigh. Now after updating all that code, and making Draukyze a prime target for the Rebels stationed from Dolomar, the AI has decided that it doesn't want to do anything anymore. Time to try out the bunch of games I got for super cheap off of Steam.

#10 Bloodreaper21131

Bloodreaper21131
  • Members
  • 19 posts

Posted 27 December 2009 - 10:02 AM

Sigh. Now after updating all that code, and making Draukyze a prime target for the Rebels stationed from Dolomar, the AI has decided that it doesn't want to do anything anymore. Time to try out the bunch of games I got for super cheap off of Steam.


lol Ive been using the one users temp fix for adding the original stations back in and I do believe that was working, while I had a working campaign that is.

#11 Phoenix Rising

Phoenix Rising

    Beyond the Impossible

  • Petrolution Staff
  • 6,509 posts
  • Projects:Phoenix Rising
  •  Mod Leader
  • Division:Petrolution
  • Job:Mod Specialist

Posted 27 December 2009 - 09:59 PM

Sigh. Now after updating all that code, and making Draukyze a prime target for the Rebels stationed from Dolomar, the AI has decided that it doesn't want to do anything anymore.

That's modding for you, unfortunately. There's always a chance that even if you do everything right, it still won't work for whatever reason. Perhaps star bases aren't "unique units"... although I don't see any other reward that could possibly cover them. Send the files to me and I'll look at them.

Edit: Are you sure you don't have syntax errors? The easiest way to tell is to open the XML in IE. One bad event in an active plot would probably break the whole AI. I'm wondering if the R_ replacement accidently took out part of a tag or something.

Edited by Phoenix Rising, 27 December 2009 - 10:03 PM.


#12 Hirken

Hirken
  • New Members
  • 4 posts
  • Location:The Peach State

Posted 08 January 2010 - 02:08 AM

Actually, the script does work. I followed the directions and tested it out on Operation Shadow Hand. When the Rebels captured Corellia, they were gifted a Space Colony 1, upgraded it, and built a Star Base 2. Perhaps the reason it did not work in the first test was that the replace command also replaces the "E_" in <Reward_Type>UNIQU[E_]UNIT</Reward_Type> with "R_" as it did that to me. So when tested with the Empire, the Rebels were "confused."

#13 Tropical Bob

Tropical Bob

    title available

  • Members
  • 1,348 posts

Posted 08 January 2010 - 07:07 AM

I used replace for >E_ and "E_ to the respective Rebel one. My current problem is that I messed up the AI momentarily somehow. And Steam's sale enticed me to buy 35 games, and now I'm distracted. My bad!

But I should get back to work in the next day or so, and after I test what I've done, I'll release it.

#14 Phoenix Rising

Phoenix Rising

    Beyond the Impossible

  • Petrolution Staff
  • 6,509 posts
  • Projects:Phoenix Rising
  •  Mod Leader
  • Division:Petrolution
  • Job:Mod Specialist

Posted 08 January 2010 - 07:14 AM

Sorry for the delay on this; it's been a "productive" week behind the scenes. I should have time this weekend.

#15 Tropical Bob

Tropical Bob

    title available

  • Members
  • 1,348 posts

Posted 08 January 2010 - 01:31 PM

I can't decide if that's dripping with sarcasm or not...

I know I would certainly get more done if everything I did didn't crash the game and prompt another 5 minute mod load session. And I didn't have 35 new Steam games that I have to get a jackhammer to scratch the surface of if I ever want to finish anything. Sigh. Damn you Steam!

#16 Phoenix Rising

Phoenix Rising

    Beyond the Impossible

  • Petrolution Staff
  • 6,509 posts
  • Projects:Phoenix Rising
  •  Mod Leader
  • Division:Petrolution
  • Job:Mod Specialist

Posted 08 January 2010 - 10:24 PM

No, my attempt at being diplomatic: it was a busy week. Lots of coding had to be done that Ghost and the testers were waiting for. We're trying to put the finishing touches on Skyhook.

#17 Phoenix Rising

Phoenix Rising

    Beyond the Impossible

  • Petrolution Staff
  • 6,509 posts
  • Projects:Phoenix Rising
  •  Mod Leader
  • Division:Petrolution
  • Job:Mod Specialist

Posted 11 January 2010 - 07:34 AM

Congratulations! I plugged your script into Skyhook and it worked for both player and AI. That said, I have no idea what you did wrong on your end; I guess I'd try it with a non-custom campaign. The only other thing I noticed was that you deleted the empty LUA script tag in the plots file, but I hope EaW wouldn't be that finicky...

#18 Tropical Bob

Tropical Bob

    title available

  • Members
  • 1,348 posts

Posted 11 January 2010 - 10:41 PM

Hoom, harumph, ho-hum. I guess I can release it then.

Which empty LUA script would you be referring to?

#19 Phoenix Rising

Phoenix Rising

    Beyond the Impossible

  • Petrolution Staff
  • 6,509 posts
  • Projects:Phoenix Rising
  •  Mod Leader
  • Division:Petrolution
  • Job:Mod Specialist

Posted 12 January 2010 - 06:28 AM

Ah, this: <Lua_Script>. I'm sure it doesn't matter though. Has it worked for you yet?

#20 Tropical Bob

Tropical Bob

    title available

  • Members
  • 1,348 posts

Posted 12 January 2010 - 11:01 AM

Ah, this: <Lua_Script>. I'm sure it doesn't matter though. Has it worked for you yet?

Odd. I don't remember deleting it...But who knows. I set up that Experiments campaign a long time ago. I don't remember half the stuff that's in it anymore. And it seems broken anyway. Maybe the myriad of commented out sections have broken it or something. Like the 'Uberspy' you may have seen mentioned: I put one at Carida, but when I tried to move it off-planet, I got an exception and the game crashed on me.

I started a Core Worlds campaign (My favorite :p ), but was interrupted early on by someone who wanted to play Borderlands. The Rebellion has yet to conquer a planet as of yet. But I assume, since two people have reported that the method used is successful, that it works, and was probably just the campaign giving me trouble.

EDIT 1: Turns out I somehow completely broke the AI in my modified copy of PR. I guess I'll have to start the modified copy from scratch...
EDIT 2: Discovered a small error in file referencing. The Rebel hero plot file had the Imperial scripting referenced. Fixed, but for the one person who did download it, you can either re-download, or just change the '_E' ending to '_R'.

Edited by Tropical Bob, 12 January 2010 - 12:38 PM.




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users