Welcome to kayssplace, wiv 2 ses, not one Sep 20, 2014, 11:00 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: I find it rather easy to portray a businessman. Being bland, rather cruel and incompetent comes naturally to me.
- John Cleese
 
   Home   GALLERY Help Calendar Login Register  
Pages: [1] 2 3 ... 5 »»   Go Down
  Print  
    Topic: Decompiling Challenge Scripts  (Read 18599 times)
0 Members and 1 Guest are viewing this topic.
This topic has not yet been rated!
You have not rated this topic. Select a rating:
Keshire  Offline
******

Group: Craftsman
Posts: 28
Decompiling Challenge Scripts
« Posted May 27, 2007, 01:16 PM »


Progressing nicely. ;)

http://allboards.lionhead.com/showpost.php?p=2766286&postcount=6

Logged
Hunter  Offline
*

Group: New Arrival
Posts: 6
Re: Decompiling Challenge Scripts
« Reply #1 Posted May 28, 2007, 01:12 PM »


Hey guys, I'm the partner Kesh was referring to.  I've been able to make quite a bit of progress on the disassembly side of the chl format.  However, right now I'm seeing a few instructions in LH's chl files that I cannot reproduce with the script commands I have tried.  So I have a favor to ask of you guys: I want scripts! The more the merrier.  This will also help in the future when we have to figure out all the hundreds (and, unfortunately, probably thousands) of game engine calls.

If you're working on a killer mod and are afraid of people to stealing your scripts don't worry.  I guaranty you I will not use the scripts for any purpose other than reverse engineering CHL files.

Feel free to PM me with anything you think might help.

Logged
Kays  Offline
******
Administrator

Group: Deities
Posts: 8,638

Re: Decompiling Challenge Scripts
« Reply #2 Posted May 29, 2007, 04:36 AM »


If you're just loking for the raw scripts there's plenty in our Script library

For scripts and .chl files to match. A lot of the player made maps do have the scripts included. On the view file page, here's a link the readme and all the files included are usually listed.

http://www.kayssplace.com/files/index.php?action=category&id=72

My Spore Page WWW Logged
Hunter  Offline
*

Group: New Arrival
Posts: 6
Re: Decompiling Challenge Scripts
« Reply #3 Posted May 29, 2007, 08:18 AM »


Yep, those worked well.  Found a good 5-6 insructions from them.  Unfortunately, I'm still missing about 3 that are in LH chl's and I've yet to find a way to reproduce.  Also I could not manage to get KalevFPS, Llama, and Invincible Man scripts to compile.  They actually crashed the compiler, no error message, just went straight to windows error report.

Logged
Kays  Offline
******
Administrator

Group: Deities
Posts: 8,638

Re: Decompiling Challenge Scripts
« Reply #4 Posted May 29, 2007, 11:09 AM »


The compiler doesn't like quotes.  When using it, we had to copy I think it was the bw2text.bin or the bw2text.lhts file from the text folder into the compiler folder. There will be an Windows error, but the compiler will complete compiling the scripts properly.

My Spore Page WWW Logged
Keshire  Offline
******

Group: Craftsman
Posts: 28
Re: Decompiling Challenge Scripts
« Reply #5 Posted May 29, 2007, 01:28 PM »


I just got done documenting all the 3.1.N Commands in Assembly. :|

file:///C:/Program%20Files/Lionhead%20Studios/Black%20%26%20White%202/Tools/Script%20Language%20Documentation/Statements.htm#3.1

Logged
Hunter  Offline
*

Group: New Arrival
Posts: 6
Re: Decompiling Challenge Scripts
« Reply #6 Posted May 29, 2007, 03:51 PM »


If anyone is interested in looking at assembly, here's some reference:
http://wiki.planetblackandwhite.gamespy.com/PBnWModdingWIKI/index.php/Scripting:CHL:Instructions .

I don't guaranty the quality on that since I hate writing big docs and I'm really tired.

Edit: Heh, just noticed that that doc is 2x the length of the disassembler itself... at least in lines.
« Last Edit: May 29, 2007, 03:53 PM by Hunter »

Logged
Keshire  Offline
******

Group: Craftsman
Posts: 28
Re: Decompiling Challenge Scripts
« Reply #7 Posted May 30, 2007, 01:35 PM »


For anyone following along. Here are the Statement commands broken down into assembly.

These are the commands I couldn't get to compile, if anyone wants to help me out it'd be appreciated. Faster this gets done the faster we can get a decompiler out. smile


 Code:
//needs to be state driven// enable anim events on NewObject //3.2.1
------------------------------------------------------------------------------------------------
//needs to be state driven// set NewObject anim event probability //3.2.2
------------------------------------------------------------------------------------------------
//Won't compile// enable VAR visible //3.3.1
------------------------------------------------------------------------------------------------
//Won't compile// disable player town migration //3.4.6
------------------------------------------------------------------------------------------------
//Won't compile// set physics from hand with strength position radius 10 //3.9.1
------------------------------------------------------------------------------------------------
//disable gate can open for platoons
------------------------------------------------------------------------------------------------
//set player 0 objective TRIBUTE_OBJECTIVE_COLLECT_WOOD with amount 5000 text "BW2T_SCRIPT_01FINAL_OBJECTIVE_ELOI_10" amount 5000 description "BW2T_SCRIPT_01FINAL_OBJECTIVE_ELOI_10" parent TRIBUTE_OBJECTIVE_COLLECT_FOOD icon TRIBUTE_OBJECTIVE_ICON_OBJECTIVE_L1_FOLLOWCREATURE class TRIBUTE_OBJECTIVE_CLASS_SKILL start value 200 reward 250 force open dont show player
------------------------------------------------------------------------------------------------
//set player 0 objective TRIBUTE_OBJECTIVE_COLLECT_WOOD icon TRIBUTE_OBJECTIVE_ICON_OBJECTIVE_L3_WOODSTORAGEPIT
------------------------------------------------------------------------------------------------
//add performance stat called "STRING"
------------------------------------------------------------------------------------------------
//set interaction SCRIPT_INTERACTION_LEVEL_1
------------------------------------------------------------------------------------------------
//Speed statement only valid in game speed blocks// set game speed to 0.5
------------------------------------------------------------------------------------------------
//Camera statement only valid in cinema blocks// enable leash draw
------------------------------------------------------------------------------------------------
//Camera statement only valid in cinema blocks// enable highlight draw
------------------------------------------------------------------------------------------------
//Camera statement only valid in cinema blocks// enable spell icon draw
------------------------------------------------------------------------------------------------
//String not in database// set hand icon text "BW2T_SCRIPT_01FINAL_OBJECTIVE_ELOI_50"
------------------------------------------------------------------------------------------------
//trigger floaty number FLOATY_SKULL at POS importance 2 icon VAR value 17
------------------------------------------------------------------------------------------------
//set VAR desire CREATURE_DESIRE_HUNGER 0
------------------------------------------------------------------------------------------------
//set creature DEVELOPMENT_PHASE_PUNISHMENT development
------------------------------------------------------------------------------------------------
//enable VAR object auto scale
------------------------------------------------------------------------------------------------
//set VAR all desire TRUE
------------------------------------------------------------------------------------------------
//teach VAR MAGICAL MAGIC_TYPE_VECTOR_FLAME SCRIPT_TRUE percentage 50
------------------------------------------------------------------------------------------------
//teach VAR all
------------------------------------------------------------------------------------------------
//teach VAR all excluding CREATURE_ACTION_LEARNING_TYPE_MAGIC
------------------------------------------------------------------------------------------------
//set VAR name HELP_TEXT_CREATURE_NAME_01
------------------------------------------------------------------------------------------------
//disable VAR Navigation
------------------------------------------------------------------------------------------------
//request creature VAR play individual anim "MyAnim"
------------------------------------------------------------------------------------------------
//request creature VAR action CREATURE_ACTION ObjectToActOn ObjectToUse
------------------------------------------------------------------------------------------------
//set creature object happiness to maximum
------------------------------------------------------------------------------------------------
//set creature object script thought text "BW2T_SCRIPT_LAND15_CREATUREDREAMS_TOOLTIP_IAMONION"
------------------------------------------------------------------------------------------------
//disable tooltips on creature VAR
------------------------------------------------------------------------------------------------
//play anim ANM_CRY on VAR loop 5
------------------------------------------------------------------------------------------------
//remove VAR to platoon VAR attack list
------------------------------------------------------------------------------------------------
//set platoon VAR formation to 4 wide by 3 deep
------------------------------------------------------------------------------------------------
//set platoon stat PLATOON_STAT_MOVE_TO_ATTACK_DIST of VAR to 1.0
------------------------------------------------------------------------------------------------
//add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using {POS} next in platoon VAR action queue
------------------------------------------------------------------------------------------------
//set town VAR siege weapon type SIEGE_BALANCE_TYPE_CATAPULT to 2
------------------------------------------------------------------------------------------------
//add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using {POS} next in platoon siege weapon VAR action queue
------------------------------------------------------------------------------------------------
//enable platoon VAR response to VAR attack
------------------------------------------------------------------------------------------------
//enable platoon VAR response to local platoon attack
------------------------------------------------------------------------------------------------
//town VAR capture all enemy towns
------------------------------------------------------------------------------------------------
//attach reaction VAR REACTION_FLEE_FROM_OBJECT
------------------------------------------------------------------------------------------------
//detach REACTION_FLEE_FROM_OBJECT reaction VAR
------------------------------------------------------------------------------------------------
//stop all scripts "Dummy"
------------------------------------------------------------------------------------------------ //stop script files "DummyScript.txt"
------------------------------------------------------------------------------------------------
//run map script line "CREATE_MOBILE_STATIC("2030,2354.30", 25, 10.324, 0.232123, 0.566464, 0,0006, 1,198000)"
------------------------------------------------------------------------------------------------ //wait until VAR clicked ------------------------------------------------------------------------------------------------
//attach atmos "SpookySounds" to camera volume 1
------------------------------------------------------------------------------------------------
//destroy mixer 1 with fadetime 3
------------------------------------------------------------------------------------------------
//say random sound from group "HELP_TEXT_LOST" at {POS} with volume 0.8
------------------------------------------------------------------------------------------------
//set precipitaion at {POS} radius 10 disable rainfall enable snowfall disable overcast
------------------------------------------------------------------------------------------------
//set lightning strike at {POS} from VAR
------------------------------------------------------------------------------------------------
//set sandstorm VAR {POS} moving to {POS} strength 0.8 radius 20.8
------------------------------------------------------------------------------------------------

* Statement_Notes.txt (106.86 KB - downloaded 166 times.)

Logged
Kays  Offline
******
Administrator

Group: Deities
Posts: 8,638

Re: Decompiling Challenge Scripts
« Reply #8 Posted May 31, 2007, 04:35 AM »


Some of what's in the documentation is incorrect due to typos, omissions and such.

Quote//set VAR desire CREATURE_DESIRE_HUNGER 0
//set creature object happiness to maximum
//teach VAR all
//set creature DEVELOPMENT_PHASE_PUNISHMENT development

That's creature stuff, some of which can be found in this script.

http://www.kayssplace.com/scripts/index.php?action=file&id=27

The rest of I'm not familiar with, but I could take a look into some of them tomorrow.



My Spore Page WWW Logged
Keshire  Offline
******

Group: Craftsman
Posts: 28
Re: Decompiling Challenge Scripts
« Reply #9 Posted May 31, 2007, 04:56 AM »


Quote from: Kays Posted May 31, 2007, 04:35 AMSome of what's in the documentation is incorrect due to typos, omissions and such.

Ya...

I'll be rewriting some of that.
There's also the option of changing the scripting syntax with a new compiler if there's enough interest.

Logged
Keshire  Offline
******

Group: Craftsman
Posts: 28
Re: Decompiling Challenge Scripts
« Reply #10 Posted Jun 01, 2007, 12:03 AM »


Quote from: Keshire Posted May 31, 2007, 04:56 AMThere's also the option of changing the scripting syntax with a new compiler if there's enough interest.

To clarify this we'd probably have to make a new compiler in order to use some of the unlisted optional parameters. And we've found quite  a few.
« Last Edit: Apr 04, 2009, 12:46 PM by Keshire »

Logged
Kays  Offline
******
Administrator

Group: Deities
Posts: 8,638

Re: Decompiling Challenge Scripts
« Reply #11 Posted Jun 01, 2007, 01:18 AM »


You mean like a compliler which works properly. That would be sweet. smile

I'm absolutly amased at what you have been able to do so far and appreciate the effort.

My Spore Page WWW Logged
Kays  Offline
******
Administrator

Group: Deities
Posts: 8,638

Re: Decompiling Challenge Scripts
« Reply #12 Posted Jun 01, 2007, 04:03 AM »


I got a few of them to compile. Haven't looked at the platoon ones yet. Which ones still need to be done?


//set physics from hand with strength position radius 10
set physics from hand with strength {34,65,95} radius 10


//disable gate can open for platoons
disable gate GateHouse can open for platoons


//Camera statement only valid in cinema blocks// enable leash draw
------------------------------------------------------------------------------------------------
//Camera statement only valid in cinema blocks// enable highlight draw
------------------------------------------------------------------------------------------------
//Camera statement only valid in cinema blocks// enable spell icon draw
'

Do compile in a cinima block

begin cinema
   enable leash draw
   enable highlight draw
   enable spell icon draw
end cinema




My Spore Page WWW Logged
Keshire  Offline
******

Group: Craftsman
Posts: 28
Re: Decompiling Challenge Scripts
« Reply #13 Posted Jun 01, 2007, 05:27 AM »


Thank you kindly, and still have these to go:


 Code:
//clear VARIABLE hit VARIABLE //3.1.45
//disable anim events on NewObject //3.2.1 //needs to be state driven
//set NewObject anim event probability //3.2.2 //needs to be state driven
//disable VARIABLE visible //3.3.1 //Spits out a wants T_DISABLE or T_ENABLE error. :|
//disable player town migration //3.4.6
//add performance stat called "STRING" //3.13.24
//set interaction SCRIPT_INTERACTION_LEVEL_1 //3.13.31
//set game speed to NUMBER //3.13.32 //Wants a game speed block, tried both "game speed" and "speed"
//trigger floaty number FLOATY_SKULL at POSITION importance NUMBER icon VARIABLE value NUMBER //3.16.22
//remove VARIABLE to platoon VARIABLE attack list //3.18.2 //near token "to": parse error, expecting `T_FROM' or `T_HIT' or `T_PILGRIMAGE'
//set platoon VARIABLE formation to NUMBER wide by NUMBER deep //3.18.25
//set platoon stat ENUMERATION of VARIABLE to NUMBER //3.18.26
//add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using {POSITION} next in platoon VARIABLE action queue //3.18.33
//add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using {POSITION} next in platoon siege weapon VARIABLE action queue //3.18.45
//disable platoon VARIABLE response to VARIABLE attack //3.18.49
//disable platoon VARIABLE response to local platoon attack //3.18.50
//town VARIABLE capture all enemy towns //3.18.54
//attach reaction VARIABLE REACTION_FLEE_FROM_OBJECT //3.23.1
//detach REACTION_FLEE_FROM_OBJECT reaction VARIABLE //3.23.3
//stop all scripts "Dummy" //3.24.4
//stop script files "DummyScript.txt" //3.24.5
//run map script line "CREATE_MOBILE_STATIC("2030,2354.30", 25, 10.324, 0.232123, 0.566464, 0,0006, 1,198000)" //3.24.8
//attach atmos "SpookySounds" to camera volume NUMBER //3.26.12
//destroy mixer NUMBER with fadetime NUMBER //3.26.20
//say random sound from group "HELP_TEXT_LOST" at {POSITION} with volume NUMBER //3.26.28
//set precipitaion at {POSITION} radius NUMBER disable rainfall disable snowfall disable overcast //3.27.1
//set lightning strike at {POSITION} from VARIABLE //3.27.7
//set sandstorm VARIABLE {POSITION} moving to {POSITION} strength NUMBER radius NUMBER //3.27.9

Logged
Kays  Offline
******
Administrator

Group: Deities
Posts: 8,638

Re: Decompiling Challenge Scripts
« Reply #14 Posted Jun 01, 2007, 07:23 PM »


I've had no luck on these so far.

//disable player town migration //3.4.6
-> Tried a variety of combinations for player and town

//set interaction SCRIPT_INTERACTION_LEVEL_1 //3.13.31
->  "SCRIPT_INTERACTION_LEVEL_1" appears to be a contant that's not defined

//disable tooltips on creature VAR
-> "tooltips" needs to be declared. I think this is one of the items which doesn't work with this compiler.

//clear VARIABLE hit VARIABLE //3.1.45
-> getting a parser error on the second variable. "expecting 'T_OBJECT'or 'T_LAND'. Creating an object for the second varible doesn't work

//trigger floaty number FLOATY_SKULL at POSITION importance NUMBER icon VARIABLE value NUMBER //3.16.22
-> The icon variable needs to be declared



Successes smile

//attach atmos "SpookySounds" to camera volume NUMBER //3.26.12
attach atmos "SpookySounds" to camera with volume 1
-> added "with"

//say random sound from group "HELP_TEXT_LOST" at {POSITION} with volume NUMBER
play random sound from group "HELP_TEXT_LOST" at {POSITION} with volume NUMBER
-> change say to play

//set precipitaion at {POSITION} radius NUMBER disable rainfall disable snowfall disable overcast //3.27.1
set precipitation at {126,100,258} radius 10 disable rainfall enable snowfall disable overcast
->  precipitation  mis-spelt

//attach reaction VARIABLE REACTION_FLEE_FROM_OBJECT //3.23.1
//detach REACTION_FLEE_FROM_OBJECT reaction VARIABLE //3.23.3
attach reaction wCreature REACTION_FLEE_FROM_OBJECT
detach reaction wCreature
-> These do compile with a creature variable.

//set game speed to NUMBER //3.13.32 //Wants a game speed block, tried both "game speed" and "speed"
  -> It does compile in a cinema block. Strange. whaaat?



My Spore Page WWW Logged
Pages: [1] 2 3 ... 5 »»   Go Up
  Print  
 
Jump to:  


Kayssplace © 2003-2014
Powered by SMF 1.1.19 | SMF © 2013, Simple Machines
Page created in 0.119 seconds with 39 queries.