script error
Moderator: Moderators
-
dietje_schietje
- Corporal
- Posts: 29
- Joined: Wed Nov 19, 2008 8:20 pm
script error
i get my litle SP map but my script file don't works somebody want to corrigate my script file please?
thanks
this is my script file:
main:
exec global/loadout.scr maps/test_assassination.scr
level waittill prespawn
exec global/alarmer.scr
exec global/ambient.scr
level waittill spawn
$player item weapons/colt45.tik
$player item weapons/thompsonsmg.tik
$player ammo pistol 1000
$player ammo smg 1000
$player useweaponclass smg
end
thread objectives
thread hints
thread disquise
thread music1
end
objectives:
waitthread global/objectives.scr::add_objectives 1 1 "Find a disguise." $suit.origin
waitthread global/objectives.scr::add_objectives 2 1 "Kill the officer." $obj2.origin
set_objective_pos $officer // this makes the officer to be killed an objective
waitthread global/objectives.scr::add_objectives 1 2 "find a disquise." $suit.origin
waitthread global/objectives.scr::current_objectives 1
end
music1:
$player stufftext "tmstart sound/music/mus_14a_action"
disguise:
$trigger waittill trigger //the trigger used in above
$suit remove //removes the suit
$papers remove //removes the papers
$player playsound pickup_papers //sound
$player playsound pickup_uniform //sound
waitthread global/items.scr::add_item "papers_level1" //gives you
//level 1 papers
waitthread global/items.scr::add_item "uniform" //gives you
//uniform
end
objective1:
waitthread global/objectives.scr::add_objectives 1 3 "Find a disguise." $suit.origin
//////////
hints:
local.key = getboundkey1 "Holster"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to holster your weapon.")
wait 1
iprintlnbold "If your weapon is not holstered"
iprintlnbold "your cover will be blown."
wait 2
iprintlnbold "Show your papers when asked."
local.key = getboundkey1 "toggleitem"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to show your papers.")
end
objective2:
waitthread global/objectives.scr::add_objectives 2 2"Kill the officer."
waitthread global/objectives.scr::current_objectives 1
blowcover:
$blowcover waittill trigger
waitthread global/items.scr::remove_item "uniform" //removes
//uniform
iprintlnbold "Somebody has found the dead bodie! You cover has been blown!"
end
levelend:
if (IsAlive $officer) // the "if" must be a lower case, MOHAA is case sensitive
$officer waittill death // if the officer is killed, then the mission will complete
global/objectives.scr::add _objectives 2 3 "Kill the officer." $obj2.origin
global/objectives.scr::current_objectives 0
wait 2
exec global/missioncomplete.scr test_assassination
end
alarm_player_reset: //our setthread value
thread global/alarmer.scr::alarm_player_reset
end
thanks
this is my script file:
main:
exec global/loadout.scr maps/test_assassination.scr
level waittill prespawn
exec global/alarmer.scr
exec global/ambient.scr
level waittill spawn
$player item weapons/colt45.tik
$player item weapons/thompsonsmg.tik
$player ammo pistol 1000
$player ammo smg 1000
$player useweaponclass smg
end
thread objectives
thread hints
thread disquise
thread music1
end
objectives:
waitthread global/objectives.scr::add_objectives 1 1 "Find a disguise." $suit.origin
waitthread global/objectives.scr::add_objectives 2 1 "Kill the officer." $obj2.origin
set_objective_pos $officer // this makes the officer to be killed an objective
waitthread global/objectives.scr::add_objectives 1 2 "find a disquise." $suit.origin
waitthread global/objectives.scr::current_objectives 1
end
music1:
$player stufftext "tmstart sound/music/mus_14a_action"
disguise:
$trigger waittill trigger //the trigger used in above
$suit remove //removes the suit
$papers remove //removes the papers
$player playsound pickup_papers //sound
$player playsound pickup_uniform //sound
waitthread global/items.scr::add_item "papers_level1" //gives you
//level 1 papers
waitthread global/items.scr::add_item "uniform" //gives you
//uniform
end
objective1:
waitthread global/objectives.scr::add_objectives 1 3 "Find a disguise." $suit.origin
//////////
hints:
local.key = getboundkey1 "Holster"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to holster your weapon.")
wait 1
iprintlnbold "If your weapon is not holstered"
iprintlnbold "your cover will be blown."
wait 2
iprintlnbold "Show your papers when asked."
local.key = getboundkey1 "toggleitem"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to show your papers.")
end
objective2:
waitthread global/objectives.scr::add_objectives 2 2"Kill the officer."
waitthread global/objectives.scr::current_objectives 1
blowcover:
$blowcover waittill trigger
waitthread global/items.scr::remove_item "uniform" //removes
//uniform
iprintlnbold "Somebody has found the dead bodie! You cover has been blown!"
end
levelend:
if (IsAlive $officer) // the "if" must be a lower case, MOHAA is case sensitive
$officer waittill death // if the officer is killed, then the mission will complete
global/objectives.scr::add _objectives 2 3 "Kill the officer." $obj2.origin
global/objectives.scr::current_objectives 0
wait 2
exec global/missioncomplete.scr test_assassination
end
alarm_player_reset: //our setthread value
thread global/alarmer.scr::alarm_player_reset
end
Code: Select all
$player item weapons/colt45.tik
$player item weapons/thompsonsmg.tik
$player ammo pistol 1000
$player ammo smg 1000
$player useweaponclass smg
end
thread objectives
thread hints
thread disquise
thread music1 should be
Code: Select all
$player item weapons/colt45.tik
$player item weapons/thompsonsmg.tik
$player ammo pistol 1000
$player ammo smg 1000
$player useweaponclass smg
thread objectives
thread hints
thread disquise
thread music1 END is not welcomed here!
-
dietje_schietje
- Corporal
- Posts: 29
- Joined: Wed Nov 19, 2008 8:20 pm
Code: Select all
objective2:
waitthread global/objectives.scr::add_objectives 2 2"Kill the officer."
waitthread global/objectives.scr::current_objectives 1 ITS ENDS TIME!
Code: Select all
objective2:
waitthread global/objectives.scr::add_objectives 2 2"Kill the officer."
waitthread global/objectives.scr::current_objectives 1
endCode: Select all
objective1:
waitthread global/objectives.scr::add_objectives 1 3 "Find a disguise." $suit.origin
Example:
Code: Select all
adsdasdas:
thread aaaa2
end
aaaa2:
$target waittill death
println $target.targetname "is dead with hp " $target.health
thread bbb23
end
bbb23:
$player.origin = &nowhere.origin
end
-
dietje_schietje
- Corporal
- Posts: 29
- Joined: Wed Nov 19, 2008 8:20 pm
main:
////////////////////////////// YOU MAP NAME .SCR
exec global/loadout.scr maps/test_assassination.scr
level waittill prespawn
exec global/alarmer.scr
exec global/ambient.scr
level waittill spawn
$player item weapons/colt45.tik
$player item weapons/thompsonsmg.tik
$player ammo pistol 1000
$player ammo smg 1000
$player useweaponclass smg
//END IS NOT WELCOMED HERE!!
/////end
///message for player
dprintln "SCRIPT LOADED SUCCESFULLY"
thread objectives
thread hints
thread disquise
thread music1
end
objectives:
waitthread global/objectives.scr::add_objectives 1 1 "Find a disguise." $suit.origin
waitthread global/objectives.scr::add_objectives 2 1 "Kill the officer." $obj2.origin
set_objective_pos $officer // this makes the officer to be killed an objective
waitthread global/objectives.scr::add_objectives 1 2 "find a disquise." $suit.origin
waitthread global/objectives.scr::current_objectives 1
end
music1:
$player stufftext "tmstart sound/music/mus_14a_action"
///NEED END HERE
end
disguise:
$trigger waittill trigger //the trigger used in above <- TRIGGER USE
$suit remove //removes the suit
$papers remove //removes the papers
$player playsound pickup_papers //sound
$player playsound pickup_uniform //sound
waitthread global/items.scr::add_item "papers_level1" //gives you
//level 1 papers
waitthread global/items.scr::add_item "uniform" //gives you
//uniform
end
objective1:
waitthread global/objectives.scr::add_objectives 1 3 "Find a disguise." $suit.origin
/////////ENDHERE?
end
//////////
hints:
local.key = getboundkey1 "Holster"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to holster your weapon.")
wait 1
iprintlnbold "If your weapon is not holstered"
iprintlnbold "your cover will be blown."
wait 2
iprintlnbold "Show your papers when asked."
local.key = getboundkey1 "toggleitem"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to show your papers.")
end
objective2:
waitthread global/objectives.scr::add_objectives 2 2"Kill the officer."
waitthread global/objectives.scr::current_objectives 1
//ENDENDE ND
end
blowcover:
$blowcover waittill trigger
waitthread global/items.scr::remove_item "uniform" //removes
//uniform
iprintlnbold "Somebody has found the dead bodie! You cover has been blown!"
end
levelend:
if (IsAlive $officer) // the "if" must be a lower case, MOHAA is case sensitive
$officer waittill death // if the officer is killed, then the mission will complete
global/objectives.scr::add _objectives 2 3 "Kill the officer." $obj2.origin
global/objectives.scr::current_objectives 0
wait 2
exec global/missioncomplete.scr test_assassination
end
alarm_player_reset: //our setthread value
thread global/alarmer.scr::alarm_player_reset
end
////////////////////////////// YOU MAP NAME .SCR
exec global/loadout.scr maps/test_assassination.scr
level waittill prespawn
exec global/alarmer.scr
exec global/ambient.scr
level waittill spawn
$player item weapons/colt45.tik
$player item weapons/thompsonsmg.tik
$player ammo pistol 1000
$player ammo smg 1000
$player useweaponclass smg
//END IS NOT WELCOMED HERE!!
/////end
///message for player
dprintln "SCRIPT LOADED SUCCESFULLY"
thread objectives
thread hints
thread disquise
thread music1
end
objectives:
waitthread global/objectives.scr::add_objectives 1 1 "Find a disguise." $suit.origin
waitthread global/objectives.scr::add_objectives 2 1 "Kill the officer." $obj2.origin
set_objective_pos $officer // this makes the officer to be killed an objective
waitthread global/objectives.scr::add_objectives 1 2 "find a disquise." $suit.origin
waitthread global/objectives.scr::current_objectives 1
end
music1:
$player stufftext "tmstart sound/music/mus_14a_action"
///NEED END HERE
end
disguise:
$trigger waittill trigger //the trigger used in above <- TRIGGER USE
$suit remove //removes the suit
$papers remove //removes the papers
$player playsound pickup_papers //sound
$player playsound pickup_uniform //sound
waitthread global/items.scr::add_item "papers_level1" //gives you
//level 1 papers
waitthread global/items.scr::add_item "uniform" //gives you
//uniform
end
objective1:
waitthread global/objectives.scr::add_objectives 1 3 "Find a disguise." $suit.origin
/////////ENDHERE?
end
//////////
hints:
local.key = getboundkey1 "Holster"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to holster your weapon.")
wait 1
iprintlnbold "If your weapon is not holstered"
iprintlnbold "your cover will be blown."
wait 2
iprintlnbold "Show your papers when asked."
local.key = getboundkey1 "toggleitem"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to show your papers.")
end
objective2:
waitthread global/objectives.scr::add_objectives 2 2"Kill the officer."
waitthread global/objectives.scr::current_objectives 1
//ENDENDE ND
end
blowcover:
$blowcover waittill trigger
waitthread global/items.scr::remove_item "uniform" //removes
//uniform
iprintlnbold "Somebody has found the dead bodie! You cover has been blown!"
end
levelend:
if (IsAlive $officer) // the "if" must be a lower case, MOHAA is case sensitive
$officer waittill death // if the officer is killed, then the mission will complete
global/objectives.scr::add _objectives 2 3 "Kill the officer." $obj2.origin
global/objectives.scr::current_objectives 0
wait 2
exec global/missioncomplete.scr test_assassination
end
alarm_player_reset: //our setthread value
thread global/alarmer.scr::alarm_player_reset
end
-
dietje_schietje
- Corporal
- Posts: 29
- Joined: Wed Nov 19, 2008 8:20 pm
-
dietje_schietje
- Corporal
- Posts: 29
- Joined: Wed Nov 19, 2008 8:20 pm
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
Aprop, your CAPS lock and your exclamation marks makes it seem you are annoyed or angry. He's just asking help, so please stop. Before thinking he doesn't know how to make a script, notice this HUGE error in his script:
The game doesn't know what to do with this and unloads the script.
Dietje check the console when the script isn't working, it'll show you what's wrong.
And this script works, cheers
Code: Select all
global/objectives.scr::add _objectives 2 3 "Kill the officer." $obj2.origin
global/objectives.scr::current_objectives 0 Dietje check the console when the script isn't working, it'll show you what's wrong.
And this script works, cheers
Code: Select all
main:
exec global/loadout.scr maps/test_assassination.scr
level waittill prespawn
exec global/alarmer.scr
exec global/ambient.scr
level waittill spawn
$player item weapons/colt45.tik
$player item weapons/thompsonsmg.tik
$player ammo pistol 1000
$player ammo smg 1000
$player useweaponclass smg
thread objectives
thread hints
thread disquise
thread music1
end
objectives:
waitthread global/objectives.scr::add_objectives 1 1 "Find a disguise." $suit.origin
waitthread global/objectives.scr::add_objectives 2 1 "Kill the officer." $obj2.origin
set_objective_pos $officer // this makes the officer to be killed an objective
waitthread global/objectives.scr::add_objectives 1 2 "find a disquise." $suit.origin
waitthread global/objectives.scr::current_objectives 1
end
music1:
$player stufftext "tmstart sound/music/mus_14a_action"
end
disguise:
$trigger waittill trigger //the trigger used in above <- TRIGGER USE
$suit remove //removes the suit
$papers remove //removes the papers
$player playsound pickup_papers //sound
$player playsound pickup_uniform //sound
waitthread global/items.scr::add_item "papers_level1" //gives you
//level 1 papers
waitthread global/items.scr::add_item "uniform" //gives you
//uniform
end
objective1:
waitthread global/objectives.scr::add_objectives 1 3 "Find a disguise." $suit.origin
end
hints:
local.key = getboundkey1 "Holster"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to holster your weapon.")
wait 1
iprintlnbold "If your weapon is not holstered"
iprintlnbold "your cover will be blown."
wait 2
iprintlnbold "Show your papers when asked."
local.key = getboundkey1 "toggleitem"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to show your papers.")
end
objective2:
waitthread global/objectives.scr::add_objectives 2 2"Kill the officer."
waitthread global/objectives.scr::current_objectives 1
end
blowcover:
$blowcover waittill trigger
waitthread global/items.scr::remove_item "uniform" //removes
//uniform
iprintlnbold "Somebody has found the dead bodie! You cover has been blown!"
end
levelend:
if (IsAlive $officer)
{
$officer waittill death // if the officer is killed, then the mission will complete
}
waitthread global/objectives.scr::add _objectives 2 3 "Kill the officer." $obj2.origin
waitthread global/objectives.scr::current_objectives 0
wait 2
exec global/missioncomplete.scr test_assassination
end
alarm_player_reset: //our setthread value
thread global/alarmer.scr::alarm_player_reset
endOur official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
-
dietje_schietje
- Corporal
- Posts: 29
- Joined: Wed Nov 19, 2008 8:20 pm
-
dietje_schietje
- Corporal
- Posts: 29
- Joined: Wed Nov 19, 2008 8:20 pm
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
Your music should be this:
But if you don't want the music to stop, you should use music in another way. Make a new file called: test_assassination.mus
Open with wordpad and add this:
Save and put this in the /music directory. Now in your map script replace:
with
And you're done!
For the next objective, put this command very last in the trigger's setthread:
Code: Select all
$player stufftext "tmstart sound/music/mus_14a_action.mp3" Open with wordpad and add this:
Code: Select all
path sound/music
normal mus_14a_action.mp3 // Plays over entire level
!normal volume 0.8
!normal loop
Code: Select all
exec global/ambient.scrCode: Select all
exec global/ambient.scr test_assassinationFor the next objective, put this command very last in the trigger's setthread:
Code: Select all
thread objective2Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
-
dietje_schietje
- Corporal
- Posts: 29
- Joined: Wed Nov 19, 2008 8:20 pm
ok now it works thanks
but on the end of my map if i killed the officer the objective is not completed but the mission complete screen comes
i chanched a little bit and this is my script file:
but on the end of my map if i killed the officer the objective is not completed but the mission complete screen comes
i chanched a little bit and this is my script file:
Code: Select all
main:
exec global/loadout.scr maps/test_assassination.scr
level waittill prespawn
exec global/alarmer.scr
exec global/ambient.scr test_assassination
level waittill spawn
$player item weapons/silencedpistol.tik
$player ammo pistol 1000
$player useweaponclass smg
thread objectives
thread hints
thread disguise
thread enemymove
thread blowcover
thread objective2
end
objectives:
waitthread global/objectives.scr::add_objectives 1 1 "Find a disguise." $suit.origin
waitthread global/objectives.scr::add_objectives 2 1 "Kill the officer." $obj2.origin
set_objective_pos $officer // this makes the officer to be killed an objective
waitthread global/objectives.scr::add_objectives 1 2 "find a disquise." $suit.origin
waitthread global/objectives.scr::current_objectives 1
thread objective1
end
objective1:
$trigger waittill trigger
waitthread global/objectives.scr::add_objectives 1 3 "Find a disguise." $suit.origin
thread objective2
end
disguise:
$trigger waittill trigger //the trigger used in above <- TRIGGER USE
$suit remove //removes the suit
$papers remove //removes the papers
$player playsound pickup_papers //sound
$player playsound pickup_uniform //sound
waitthread global/items.scr::add_item "papers_level1" //gives you
//level 1 papers
waitthread global/items.scr::add_item "uniform" //gives you
//uniform
local.key = getboundkey1 "Holster"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to holster your weapon.")
wait 1
iprintlnbold "If your weapon is not holstered"
iprintlnbold "your cover will be blown."
wait 3
iprintlnbold_noloc "Show your papers when asked."
local.key = getboundkey1 "toggleitem"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to show your papers.")
end
objective2:
waitthread global/objectives.scr::add_objectives 2 2 "Kill the officer." $obj2.origin
set_objective_pos $officer // this makes the officer to be killed an objective
waitthread global/objectives.scr::current_objectives 2
thread levelend
end
blowcover:
$blowcover waittill trigger
waitthread global/items.scr::remove_item "uniform" //removes
//uniform
iprintlnbold_noloc "Somebody has found the dead bodie! You cover has been blown!"
iprintlnbold_noloc "Somebody has found the dead bodie! You cover has been blown!"
iprintlnbold_noloc "Somebody has found the dead bodie! You cover has been blown!"
end
levelend:
if (IsAlive $officer)
{
$officer waittill death // if the officer is killed, then the mission will complete
}
wait 2
exec global/missioncomplete.scr test_assassination
end
alarm_player_reset: //our setthread value
thread global/alarmer.scr::alarm_player_reset
end