[Solved]Document theft in multiplayer
Moderator: Moderators
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
[Solved]Document theft in multiplayer
Can I use a "steal documents" objective in a multiplayer?
I guess this will turn into a scripting topic if it can be done...
Or maby I should ask more generally: Can you use other objective types than "blowing stuff sky high". I would like a steal documents objective ( maby with an added bring the documents back to area X? )... can it be done?
I guess this will turn into a scripting topic if it can be done...
Or maby I should ask more generally: Can you use other objective types than "blowing stuff sky high". I would like a steal documents objective ( maby with an added bring the documents back to area X? )... can it be done?
Last edited by Bjarne BZR on Fri Feb 21, 2003 11:45 pm, edited 1 time in total.
-
TheShiznaeSpe
- Major
- Posts: 304
- Joined: Wed Feb 05, 2003 11:45 pm
- Location: US
- Contact:
kill the hostages would be fun too
one team kills, other protects
script would be sorta like this
one team kills, other protects
script would be sorta like this
Code: Select all
allies_win:
$hostage waittill death
teamwin allies
end
axis_win:
level waittill axiswin
endOk here's how to do it. Is more related to scripting though. I assume the allied team has to steal the docs.
- Create a script_model with the documents. Targetname it 'documents'.
- Create a trigger_use over the documents with targetname 'documents_trigger'.
- Use this (basic) script:
Code: Select all
main: level waittill spawn level.clockside = axis // axis win when timelimit is hit level waittill roundstart while(1) { $documents_trigger waittill trigger if(parm.other.dmteam == allies) // parm.other is the triggerer break // out of while loop waitframe // protection } $documents hide teamwin allies end - Uh you're done already 8).
I got the Stealing Documents Objective in my "War in a Hall" Map which is soon to be released
Next I will have a go at hostage rescue - I hope to make a Mental Asylum Run by the axis and theyve got some1 locked in there - the allies need to rescue this person - Im thinking of making a Trigger so when u get in the cell the hostage follows u around the map if you get killed he should try and find cover - Scripting is gonna be hard though as its not my strong point
Next I will have a go at hostage rescue - I hope to make a Mental Asylum Run by the axis and theyve got some1 locked in there - the allies need to rescue this person - Im thinking of making a Trigger so when u get in the cell the hostage follows u around the map if you get killed he should try and find cover - Scripting is gonna be hard though as its not my strong point
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Hey jv, that looks really simple!
The thing is: I'm going to combine it with a bomb objective, scripted like this ( working fine ) :
How will I incorporate you'r scripting in this code? Will it not require the starting of a new thread to avoid blocking of other objective threads?
Would this work:
...and changing level.targets_to_destroy from 1 to 2 and adding something like thread document_objective_check to main?
The thing is: I'm going to combine it with a bomb objective, scripted like this ( working fine ) :
Code: Select all
// Custom objective test map
// ARCHITECTURE: Bjarne Gr?nnevik
// SCRIPTING: Bjarne Gr?nnevik
main:
setcvar "g_obj_alliedtext1" "Destroy the Control"
setcvar "g_obj_alliedtext2" "panel"
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "Defend the Control"
setcvar "g_obj_axistext2" "panel"
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "none"
level waittill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
//***Ambient sounds
level.script = maps/obj/cust_obj_test.scr
exec global/ambient.scr cust_obj_test
//***Initializes the exploder subsystem
thread global/exploder.scr::main
level waittill spawn
level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 1
level.bomb_damage = 200
level.bomb_explosion_radius = 2048
// set the parameters for round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw
// level waittill roundstart // Comment out this line using '//' before it to be able to set the bomb when alone on the map ( just for testing )
$panel_bomb thread global/obj_dm.scr::bomb_thinker // "panel_bomb" is the targetname set on the bomb in MOHRadiant
thread allies_win_bomb
$panel_bomb thread axis_win_timer
end
allies_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy)
waitframe
teamwin allies
end
//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------
axis_win_timer:
level waittill axiswin
endWould this work:
Code: Select all
document_objective_check:
while(1)
{
$documents_trigger waittill trigger
if(parm.other.dmteam == allies) // parm.other is the triggerer
level.targets_to_destroy += 1
break // out of while loop
waitframe // protection
}
endYes that looks ok.
Only you need a { and a } after the if.
Only you need a { and a } after the if.
Code: Select all
document_objective_check:
while(1)
{
$documents_trigger waittill trigger
if(parm.other.dmteam == allies) // parm.other is the triggerer
{
level.targets_to_destroy += 1
break // out of while loop
}
waitframe // protection
}
end
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Whoopie!
Thanx jv_map and the rest of you! It works like a charm! I made a tutorial on the subject here.
Wicked!
/Bjarne
PS: Maby I should do a tutorial on combining multiple objective types next?
Thanx jv_map and the rest of you! It works like a charm! I made a tutorial on the subject here.
Wicked!
/Bjarne
PS: Maby I should do a tutorial on combining multiple objective types next?
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
-
TheShiznaeSpe
- Major
- Posts: 304
- Joined: Wed Feb 05, 2003 11:45 pm
- Location: US
- Contact:
well i'm not sure if this would work, but you could make the vip be the first person to enter trigger, sorta like this
would that work? should i change local.player to local.player2? or would that not work?[/code]
Code: Select all
makeallievip:
$viptrigger waittill trigger
while(1)
{
self waittill trigger
local.triggerer = parm.other
if(local.triggerer.dmteam == "allies")
break
wait 0.1
}
local.player = parm.other
local.player waittill death
teamwin axis
end
