Loading Multible scripts into a land

Red Cell Ops

New member
Joined
Jul 16, 2007
Messages
7
Alright, i now just learned how to do one script with the basic stuff from the wiki:
run script WikiTutorialScript

begin script WikiTutorialScript
start
disable load screen
set fade in time 1
wait until 1 != 1
end script WikiTutorialScript

Now how do i place more stuff in it? Do i just add the script in after the start or do i have to make a completely new script and add it to the compiler? If the later, how do i do that?
As my compiler now looks like this:

"Script Compiler" -path . -enumfile .\Enums.txt -dbfile .\bw2text.lhts -scriptpath . -inputfile ./wikitutorial/WikiTutorialChallenges.txt .\wikitutorial\NewChallenge.chl
pause

where do i add for the .bat file to read another script?
Anything will help.

Red Cell Ops
 
nevermind, i was fooling around and found out how to do it. probably should have tried before i posted.
 
Red Cell Ops said:
nevermind, i was fooling around and found out how to do it. probably should have tried before i posted.

i hope you keep learning how to script and all that stuff, maybe you can help daxter with his mod :D
 
id like an answer to this question plz  :D  m having some trouble understanding what to do.
 
Take a look at the maps in our downloads section. Most do have the scripts included.

It's been a while and I hope I get it right. But basically there are two ways to do it.

The first is to place alll of the scripts on one page and then to define each at the begining of the script. My earlier maps were done like that and you end up with sommething like this at the top of the page follow by each of the scripts.
Code:
define script CreatureSelect
define script IncrementTribute
define script ToggleInfluence
define script UnlockBuildings
define script UnlockMiracles
define script UnlockCreatureRoles
define script UnlockGodPowers
define script UnlockEmbellishments

// Run main script.
run script MainScript
begin script MainScript
start
	// Execute your new script.
	disable heartbeat sound
	run script UnlockBuildings
	run script UnlockMiracles
	run script UnlockCreatureRoles
	run script UnlockGodPowers
	run script UnlockEmbellishments
	run script CreatureSelect
	run background script IncrementTribute
	run background script ToggleInfluence
	wait 1 seconds
	disable load screen
	set fade in time 0
	wait until 1 != 1
end script MainScript

// New scripts should be placed below the main script.


The second method involves having each of the scripts on a seperate page and listing those in the challenges.txt files. And then running each from the main script.

So the Challenges.txt file will look something like this:
Code:
Land2150/globals.txt
Land2150/CreatureSelect.txt
Land2150/KalevRunAround.txt
Land2150/EnemyAI.txt
Land2150/AITest.txt
Land2150/scripts1.txt
Land2150/epics.txt
Land2150/invincibleGuy.txt
Land2150/VikingAttack.txt
Land2150/FallingBlocks.txt

Land2150/MainScript.txt

The file in the first line defines all of the globals used. Globals are values which can be used in all scripts.
Code:
define NUMBER_OF_TOWNS = 6
define NUMBER_OF_GATEHOUSES = 6

global Town[NUMBER_OF_TOWNS]
global TownStatus[NUMBER_OF_TOWNS]
global Gatehouse[NUMBER_OF_GATEHOUSES]
global NumberOfGates = 0
global oTown = 0
gobal Avatar = 0

define NUMBER_OF_BARRELS = 10
global Barrel[NUMBER_OF_BARRELS]

The paths to the various scripts are next. Finishing up with the main script which looks like this:
Code:
run script MainScript
begin script MainScript
start
	start music "cut_scene_happy_02" loop forever

	run script ResearchStandardBuildings
	run background script TakeOverStatus
	run background script GateHouseControl
	run background script EarthquakeScript
	run background script VolcanoScript
	run background script HurricaneScript
	run background script SirenScript
	
	run background script KalevFPS
	run background script ImmortalManScript(marker at {1482.64,1831.37})
	
	run script CreatureSelect(marker at {1442,32,789})
	run background script CreaturePen
	stop music with fadetime 15
	
	run background script AIStuff	
	run script CreatureEvil
	run background script VisualEffects
	
	
	set toolbar state to MENU_TOOLBAR_STATE_CLOSED
	enable game can be lost
	disable global influence
	disable load screen
	set fade in time 0
	wait until 1 != 1
	
end script MainScript

Hope that helps. :)
 
Back
Top