Page 1 of 1
need multiplayer scripting help
Posted: Mon Mar 31, 2003 4:40 am
by coolmintyice
im creating a multiplayer map in which a designated area is only accessible to snipers. Inorder to do so, i want to include a door that only opens to players with snipers. can this be done? if so please clarify the details as to the scripting and the proper method of creating the door for such a purpose.
thanks in advance.
Posted: Mon Mar 31, 2003 5:57 am
by coolmintyice
I forgot to include this in my post above. here's what im thinking. please let me know if im right on this. I would place a trigger in front of a locked door which actives a thread in the script. the code within this thread would then detect the weapon carried by the player with the "self" object. It would then unlock the door. but as soon as the player with the sniper enters, he would run through another trigger

which activates yet another thread that locks the door so immediately (i could probably just change the of the door being open in the mohradiant, right?). when he wants to come out he would have to take a different route with a door that has triggers simillar to the first door but just reversed.
please let me know if this would work. if so please clarify the scripting details
thanks
Posted: Mon Mar 31, 2003 10:46 am
by mohaa_rox
Posted: Tue Apr 01, 2003 12:17 am
by nuggets
way too much work there,
create 1 trigger...
key: setthread
value: sniper_door_trigger
then the script... not sure on the entirity of it but...
if (*$player.weapon*) == *sniper* //** will have to be found out
{
$sniperdoor rotateXup 90 //angle and axis will have to be defined
$sniperdoor move
}
else
{
exec global.door_locked.scr
}
THIS SCRIPT WILL NOT WORK!!!
but that's the basics of it

Posted: Tue Apr 01, 2003 6:26 am
by jv_map
I don't think you can get the weapon of the player

Posted: Wed Apr 02, 2003 12:55 am
by nuggets
u must be able to, ingame it uses the a count of how many times each weapon has been fired to give you the outcome of preferred weapon in the end stats, there's no other way this would b known
i'll look in2 it further 2moro, i'm a little tired right now
the things i do 4 u guys
btw wacko if ya read this i haven't 4gotten about the escalators, there still WIP (work in progress)
Posted: Wed Apr 02, 2003 9:46 am
by jv_map
game code =/= scripting language

Posted: Wed Apr 02, 2003 11:39 am
by Angex
You could probably do it for people with rifle using this code below, but they must be holding a rifle when activating the trigger:
Code: Select all
if($player.weapongroup == rifle) {
// allow the door to open
}
Other valid entries are:
mp44
bar
thompson
mp40
rifle
pistol
bazooka
grenade
unarmed
Posted: Wed Apr 02, 2003 11:44 am
by mohaa_rox
Ummm, you can't use $player. It will affect the script. Try making a trigger and:
local.player = parm.other
if(local.player.weapongroup == "rifle")
}
//
{
Posted: Wed Apr 02, 2003 3:01 pm
by jv_map
I think .weapongroup is only available for AIs
Rox better switch the } and {

Posted: Thu Apr 03, 2003 2:57 am
by mohaa_rox
Man, didn't notice that.
playerstat
Posted: Thu Apr 03, 2003 7:10 pm
by tltrude
The item below displays the players kills during the game if it is in a .urc file. you just need to find which "playerstat" number is for weapon.
resource
Label
{
name "Default"
rect 180 96 60 24
fgcolor 0.69 0.69 0.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
playerstat "21"
font facfont-20
textalign right
}
Posted: Thu Apr 03, 2003 7:30 pm
by jv_map
I think these stats are client side and not to be read by your script
