some questions

Post your scripting questions / solutions here

Moderator: Moderators

panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

Post by panTera »

Bartjerambo wrote:tanks, but it still doens't work...
oh? why not?...

You can use notepad or wordpad, doesn't matter.
But I don't get what you're not getting. You know how to place an entity in your map right? When you rightclick your mouse in mohRadiant you get a list of entities. In that list click on "sound", then on "speaker".

Then you press the "N" key and you get a window with the settings for that speaker. At the bottom you see two empty fields; Key and Value.
In the Key-field you type: targetname
In the Value-field you type: phone_speaker
Then press Enter. Now your speaker is ready. Compile the map.

And... in notepad when you save the script, make sure you save it as a .scr extension not .txt
AtOmiC wrote:Anyway, can we see your .scr file?
yes, post your script file. Just copy the text from notepad and paste it here so we can see what's wrong.
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

i'm asking what mohRadiant is....
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

here is my script file...:


// Modified by: Bartjerambo

main:

local.master = spawn ScriptMaster
local.master aliascache telephone sound/mechanics/Mec_PhoneRing_01.wav soundparms 1.0 0.0 1.0 0.0 200 1200 auto loaded maps "m dm moh obj " //this is for the phone sound
local.master aliascache alarm sound/mechanics/Mec_Alarm_10.wav soundparms 1.0 0.0 1.0 0.0 1024 6000 auto loaded maps "m dm moh obj " //this is for the alarm sound


// set scoreboard messages
setcvar "g_obj_alliedtext1" ""
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "none"



// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread

level waittill prespawn


//Crazy room

local.fire = spawn script_model
local.fire model "static/fire.tik"
local.fire.origin = ( -990 -3010 -57 )
local.fire.angles = ( 0 0 0 )
local.fire.scale = 1.0
local.fire notsolid

local.splight = spawn script_object
local.splight model "miscobj/searchlight.tik"
local.splight.origin = ( -2015 -3070 0 )
local.splight.angles = ( -45 -45 -80 )
local.splight light 9 9 9 100
local.splight notsolid

local.splight = spawn script_object
local.splight model "miscobj/searchlight.tik"
local.splight.origin = ( -2220 -3070 0 )
local.splight.angles = ( 225 45 10 )
local.splight light 9 9 9 100
local.splight notsolid

local.splight = spawn script_object
local.splight model "miscobj/searchlight.tik"
local.splight.origin = ( -2015 -3020 0 )
local.splight.angles = ( 225 45 10 )
local.splight light 9 9 9 100
local.splight notsolid

local.splight = spawn script_object
local.splight model "miscobj/searchlight.tik"
local.splight.origin = ( -2220 -3000 0 )
local.splight.angles = ( 225 45 10 )
local.splight light 9 9 9 100
local.splight notsolid

local.light = spawn script_object
local.light model "static/indycrate.tik"
local.light.origin = ( -2117 -2950 -57 )
local.light.angles = ( 0 0 0 )
local.light light 9 9 9 300
local.light hide
local.light notsolid

local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2200 -2890 -145 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid

local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2125 -2890 -145 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid

local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2050 -2890 -145 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid

local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2200 -2890 -100 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid

local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2125 -2890 -100 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid

local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2050 -2890 -100 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid

local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2200 -2890 -45 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid

local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2125 -2890 -45 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid

local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2050 -2890 -45 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid



//Normale Objects





//Allied call

local.switch = spawn script_model
local.switch model "static/worktable.tik"
local.switch.origin = ( -1605 -3065 -20 )
local.switch.angles = ( 0 0 0 )
local.switch solid

local.switch = spawn script_model
local.switch model "miscobj/radio_military.tik"
local.switch.origin = ( -1600 -3050 33 )
local.switch.angles = ( 0 235 0 )
local.switch solid

local.phone = spawn script_model
local.phone model "miscobj/phone_squarebase.tik"
local.phone.origin = ( -1600 -3065 33 )
local.phone.angles = ( 0 180 0 )
local.phone solid

local.switch = spawn script_model
local.switch model "static/bottle_small.tik"
local.switch.origin = ( -1620 -3055 33 )
local.switch.angles = ( 0 -60 0 )
local.switch solid



//Triggers

local.trig = spawn trigger_multiple
local.trig.origin = ( -990 -3010 -57 )
local.trig setsize ( -10 -10 -10 ) ( 10 10 10 )
local.trig setthread Peace_room
local.trig message "***!You are now in CRAZY PEACE ROOM for 30 seconds!***"
local.trig wait 0
local.trig delay 0

local.trigger = spawn trigger_use
local.trigger.origin = ( -1630 -3050 33 )
local.trigger setsize ( -5 -5 -5 ) ( 0 0 0 )
local.trigger setthread Allied_call
local.trigger wait 0
local.trigger delay 0




//Trigger places

Peace_room:
self waittill trigger
local.player=parm.other
if (local.player.isTrigger1==1)
end

local.player = parm.other
local.player tele ( -2120 -3005 -120 )
local.player angle -90
local.player takeall
wait 30
local.player respawn
end


Allied_call:

$trigger waittill trigger // when u hit 'use'at the trigger, the script will start
$trigger playsound Allied_call // the speaker will play the sound, "alarm" is the link to local.master aliascache (see above)
Iprintlnbold "The Allies have called an airstrike!!!"
wait 120
thread alarmtrigger
end









end

//*** Precache Dm Stuff
exec global/DMprecache.scr

exec global/door_locked.scr::lock

level waittill spawn

wait 1
$phone_speaker loopsound telephone

end

//-----------------------------------------------------------------------------

roundbasedthread:

// Can specify different scoreboard messages for round based games here.

level waitTill prespawn

level waittill spawn



// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw

level waittill roundstart

end
Last edited by Barttje on Fri Sep 02, 2005 2:48 pm, edited 1 time in total.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Post by tltrude »

panTera -- He is not using the editor, he is spawning stuff using the script.

Bartjerambo -- your script is messed up because you have three "end" lines before it gets to "level waittill spawn". The script stops reading lines when it gets to an end line, so all those lines at the bottom are not being read.
Tom Trude,

Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

???
everything is working, only the sounds are not working.....
so tell me what to do....
panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

waste of time

Post by panTera »

tltrude wrote:panTera -- He is not using the editor, he is spawning stuff using the script.
Yeah, I just noticed, he should have made that clear in his first damn post :evil:
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

sounds

Post by tltrude »

The sounds are not working because this part of your script is not being executed.

Code: Select all

end //<-- this line stops the script from reading what is below it.

//*** Precache Dm Stuff 
exec global/DMprecache.scr 

exec global/door_locked.scr::lock 
level.script = maps/dm/mohdm2.scr 
exec global/ambient.scr mohdm2 //<--this line makes the background sound work.

level waittill spawn 

wait 1 
$phone_speaker loopsound telephone 

end 

All of that stuff should be in the "main:" thread at the top.
Tom Trude,

Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

I don't get it anymore :( ,
can show me whole the script...
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

???
User avatar
Cobra
Colour Sergeant
Posts: 93
Joined: Sun Jul 17, 2005 9:22 am
Location: The Netherlands
Contact:

Post by Cobra »

Sorry but.. have you follow any tutorial barterrambo?

Be patient, and dont post "???". I think thats unnessesery. There are a lot of people that help you.

Click
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

i'm from holland so are there someware toturials in dutch???
but i want the whole script maybe i can lurn from that.... :)
User avatar
hogleg
General
Posts: 1577
Joined: Tue Sep 09, 2003 5:23 pm
Location: Down South Hillbilly Country

Post by hogleg »

"all the governments in the world are corrupt and in the hands of the Illuminati"
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

tanks hogleg :wink: , but what i want is my whole script...
i don't get what tltrude mean:
The sounds are not working because this part of your script is not being executed.

Code: Select all

end //<-- this line stops the script from reading what is below it. 

//*** Precache Dm Stuff 
exec global/DMprecache.scr 

exec global/door_locked.scr::lock 
level.script = maps/dm/mohdm2.scr 
exec global/ambient.scr mohdm2 //<--this line makes the background sound work. 

level waittill spawn 

wait 1 
$phone_speaker loopsound telephone 

end 

 



All of that stuff should be in the "main:" thread at the top.

can you explain what he means (so can you write the whole script, maybe i could lurn from that.... :? )
User avatar
Cobra
Colour Sergeant
Posts: 93
Joined: Sun Jul 17, 2005 9:22 am
Location: The Netherlands
Contact:

Post by Cobra »

There is an Handbook in dutch. I dont know where it is, when i found it, will put the link here.
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

part of learning is doing things for yourself, learn by doing reinforces stuff so if we just gave you a script, even if you looked at it you'd never really learn it ;)

tltrude means that that "end" in your script tells the thread to stop. the sounds do not work because of that, take it out and your sounds will work fine ;)
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Post Reply