Scripting for stealing objectives?...

Post your scripting questions / solutions here

Moderator: Moderators

Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

ambient sound for V2:

Code: Select all

exec global/ambient.scr obj_team2
Admin .MAP Forums
Image
Head above heels.
User avatar
GrimReaper
Sergeant
Posts: 58
Joined: Tue Dec 30, 2003 5:40 am

Post by GrimReaper »

Wow,dude you are right on top of things.Lol.But once again another question I had no idea how to try to search for this one but...I was woundering why I have light shining through walls towards the bottom of the wall.Like say you have two rooms with a wall inbetween.and your in one room and you have no lights in the room you are in, but lights in the other and I can see the light towards the bottom of the wall that is?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

GrimReaper wrote:Wow,dude you are right on top of things.Lol.But once again another question I had no idea how to try to search for this one but...I was woundering why I have light shining through walls towards the bottom of the wall.Like say you have two rooms with a wall inbetween.and your in one room and you have no lights in the room you are in, but lights in the other and I can see the light towards the bottom of the wall that is?
Do a search for 'light leaking' :idea:
Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

make the floor of each room a separate brush and let the wall brush stick into the floor, i.e. the wall brush's bottom face is deeper than the floor brush's top face. this should stop the light

Code: Select all

bad:                 
    | |wall brush
    |_|     
______________
______________| floor brush

Code: Select all

good:                 
    | |wall brush
    | |     
____| |_______
____|_|_______| floor brush
User avatar
k47a
товарищ
Posts: 810
Joined: Fri Mar 25, 2005 1:19 pm

Post by k47a »

I got a problem with stealing documents: I followed Manstein's tutorial on how to add a stealing papers obj to a SP map.
I did all the mapping part and now I'm trying out the scripting stuff. I got the compass working (and also have the order to steal the documents (tab)) but when I reach them, I just can't take them...
I have problems with scriptin anyway, as I never know when and where to put an 'end'.
I don't know whether something's wrong with the trigger in the map (I used trigger_multiple, as said in the tut - btw, the trigger's bigger than the docs). Or there might be a bug in the script... :?
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Easier to say what is wrong if you post the script. And also a trace of the consol messages whern you run the map.
Admin .MAP Forums
Image
Head above heels.
User avatar
k47a
товарищ
Posts: 810
Joined: Fri Mar 25, 2005 1:19 pm

Post by k47a »

Bjarne BZR wrote:a trace of the consol messages whern you run the map.
:? What's that? Is that the window that opens when compiling or the one you see when you play a game?

Anyway, I'm gonna post the script as soon as I'm home...
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Its the text you get in the consol ( Activated with the button under the ESC button if you have the console activated in your settings ). Write logfile 2 in the consol before loading the map and you should get all consol messaged written to the file qconsol.log in <MOHAA>/main directory.
Admin .MAP Forums
Image
Head above heels.
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

That logfile doesnt work for me fer some reason.
And the notepad command(editscript) or somthing like that.

I type that stuff in console, I get no log in main nor does the notepad kick up.
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Try setting set developer 1 and/or running the map in developer mode: http://gronnevik.se/rjukan/index.php?n= ... Developing
Admin .MAP Forums
Image
Head above heels.
User avatar
k47a
&#1090;&#1086;&#1074;&#1072;&#1088;&#1080;&#1097;
Posts: 810
Joined: Fri Mar 25, 2005 1:19 pm

Post by k47a »

Bjarne BZR wrote:Its the text you get in the consol ( Activated with the button under the ESC button if you have the console activated in your settings ). Write logfile 2 in the consol before loading the map and you should get all consol messaged written to the file qconsol.log in <MOHAA>/main directory.
Hmm... When I compile the map it get's directly into the game, so how can I write anything in the console? Should I open the game normally (where you get that main room or whatever it is) and then type logfile 2 in and start my custom map?
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

IvaN (master of disaster) wrote:Hmm... When I compile the map it get's directly into the game, so how can I write anything in the console? Should I open the game normally (where you get that main room or whatever it is) and then type logfile 2 in and start my custom map?
Yes, open it normally.
Admin .MAP Forums
Image
Head above heels.
User avatar
k47a
&#1090;&#1086;&#1074;&#1072;&#1088;&#1080;&#1097;
Posts: 810
Joined: Fri Mar 25, 2005 1:19 pm

Post by k47a »

Alright, here's my script:
// ARCHITECTURE: IvaN (master of disaster)
// SCRITPING: IvaN (master of disaster)


exec global/ai.scr

///////////////////
level waittill prespawn
///////////////////


$enemyspawn ai_on

//////////////////
level waittill spawn
//////////////////


//**stealing documents**
waitthread global/objectives.scr::add_objectives 1 2 "Steal the documents." $documents.origin //compass!

waitthread global/objectives.scr::current_objectives 1


//**disable truck**
$cut_wire hide


thread global/ai.scr::spawngroup #1 #1


//**player weapons**
$player item weapons/colt45.tik
$player item weapons/m1_garand.tik
$player item weapons/mp40.tik



//**give him some ammo!**
$player ammo pistol 32
$player ammo smg 100
$player ammo rifle 60

end


main:


//disable truck
lorry_disable:
$normal_wire remove
$lorry_engine playsound m1l2b_disabletruck
$cut_wire show
iprintlnbold_noloc "The lorry has been disabled!"
end

//**steal documents**
objective1:
$documents remove //documents disappear after player's reached them
end
Besides, I never know when I have to put an 'end' and when I shouldn't...
:?

PS: Yep, I know, it's quite a mess... :D
Image
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

IvaN (master of disaster) wrote:Alright, here's my script:
// ARCHITECTURE: IvaN (master of disaster)
// SCRITPING: IvaN (master of disaster)

main:
exec global/ai.scr

///////////////////
level waittill prespawn
///////////////////


$enemyspawn ai_on

//////////////////
level waittill spawn
//////////////////


//**stealing documents**
waitthread global/objectives.scr::add_objectives 1 2 "Steal the documents." $documents.origin //compass!

waitthread global/objectives.scr::current_objectives 1


//**disable truck**
$cut_wire hide


thread global/ai.scr::spawngroup #1 #1


//**player weapons**
$player item weapons/colt45.tik
$player item weapons/m1_garand.tik
$player item weapons/mp40.tik



//**give him some ammo!**
$player ammo pistol 32
$player ammo smg 100
$player ammo rifle 60

end

//main://dont need this here, goes up top


//disable truck
lorry_disable:
$normal_wire remove
$lorry_engine playsound m1l2b_disabletruck
$cut_wire show
iprintlnbold_noloc "The lorry has been disabled!"
end

//**steal documents**
objective1:
$documents waittill trigger//maybe add this
$documents remove//documents disappear after player's reached them
end//do you have a trigger with a setthread of objective1?
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

*sigh* ok ok, this needs some work.. but not too much.

Code: Select all

thread global/ai.scr::spawngroup #1 #1
unless this was just a test of spawners, you might as well just leave them in your map and skip this line.

Code: Select all

$enemyspawn ai_on 
this line too, unless you're just testing, you shouldnt need this. AI is always on at spawn.

Code: Select all

// ARCHITECTURE: IvaN (master of disaster) 
// SCRITPING: IvaN (master of disaster) 

main:

exec global/ai.scr 

/////////////////// 
level waittill prespawn 
/////////////////// 


$enemyspawn ai_on 

////////////////// 
level waittill spawn 
////////////////// 
 
thread prep
thread objs

end 

prep:
// hides stuff, gives stuff, anything that should happen first happens here..


$cut_wire hide 

$player item weapons/colt45.tik 
$player item weapons/m1_garand.tik 
$player item weapons/mp40.tik 

$player ammo pistol 32 
$player ammo smg 100 
$player ammo rifle 60 

print "Given ammo"

end

objs:
// handles the objectives for the mission.

waitthread global/objectives.scr::add_objectives 1 2 "Steal the documents." $documents.origin //compass! 
waitthread global/objectives.scr::current_objectives 1

end

lorry_disable: 

$normal_wire remove 
$lorry_engine playsound m1l2b_disabletruck 
$cut_wire show 
iprintlnbold_noloc "The lorry has been disabled!" 

end 


objective1:
// remove the docs
// should have a  trigger_use with a setthread to this thread.
// i dont remember the command, but you also need to clear that object and set a new one after this 
 
$documents remove //documents disappear after player's reached them 

end 
Last edited by lizardkid on Tue May 03, 2005 2:39 pm, edited 1 time in total.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Post Reply