H2C and H2G problem with script

Discuss Halo 2 modding, progress on figuring things out, mapfiles...you know the drill. Cheating discussion not allowed.
Post Reply
User avatar
grimdoomer




System Engineer

Posts: 1440
Joined: Mon Oct 09, 2006 4:36 pm

H2C and H2G problem with script

Post by grimdoomer »

ok i tryed it inject a script into my map with a clean midship.map. so i decompiled, opened it up in H2G added the script but when i compile it i get an error saying: no entry in database found for ai_living_count compile failed. below is my script. so i tryed adding the AI first. after that when i went to decompile i get an exception. must be a non negitive number or something. so i cant compile my script or decompile my map with AI in it. so what do i do?

my script

Code: Select all

(script continuous respawner
 (begin
  (sleep_until (<= (ai_living_count test_squad) 0))
  (ai_place test_squad)
 )
)
Image
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
L0d3x




Articulatist 250

Posts: 454
Joined: Sat Aug 18, 2007 3:32 am

Post by L0d3x »

Hey I'm having the same problem, same error and stuff.
Ok this is what I am trying for the time being: just decompile your map and ignore the error. Open Guerilla and add a valid script, it compiles succesfully for me.

I still have to try and rebuild the map now, I'll get back to you with my progress.

EDIT: I got it to rebuild succesfully! I still have to ftp it over to my xbox and test it but so far so good!

EDIT2: Darn it freezes!
When rebuilding the map it didn't do it completely, if someone else knows a way to work around this please tell us.
L0d3x




Articulatist 250

Posts: 454
Joined: Sat Aug 18, 2007 3:32 am

Post by L0d3x »

I'm bumping this on purpose to catch the author's attention.

I think I may have found the solution to our problem, that is to say, a work around. I have yet to test the map tomorrow morning but I definitely got the scripts into my map: here's how!

1) First simply ignore the error and get a decompiled version of the map you want to add scripts to. After this open the scenario in guerilla and add any scripts you like, assuming you enter valid AI Squad names everything should compile even though H2 Core did not decompile correctly (it did decompile the AI by me).

2) Next make a copy of your modded map. Now rebuild this copy using the scenario you just edited. The rebuilt map will be smaller in size but it should have all the scripts in it.

3) Now I had to mess around a bit but I'll tell you exactly what I did. Open up entity. Next open up your modded map, after this open up the map you just rebuilt (the one with the scripts). Now overwrite the Script data chunck from your modded map with the Script data from your rebuilt map.
After this add the Scripts chunck. Close Entity now.

4) Okay now open up Script Tools (you can find this by utilities) and open up your rebuilt map. You should see all your scripts now. Right click somewhere on the white space and select 'decompile all' and save this as a txt file somewhere. Now close this map and open up your modded map.
Right click somewhere and select 'Compile all' and you should now select the txt file you just saved. This should import your scripts correctly.

5) Now just resign your map somehow, FTP and play!

Note: Step 4 was necesarry for the following reason: when doing step 3 entity gave me some weird error and when I looked in script tools my scripts had not transferred correctly. Doing step 4 will get your scripts correctly.

Note2: I have not been able to test step 5 but I asume this should work.
I will update again tomorrow morning (morning in belgium time that is).

EDIT: YES it does work!!!
Post Reply