need multiplayer scripting help

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
coolmintyice
Lance Corporal
Posts: 11
Joined: Sun Mar 30, 2003 2:53 pm

need multiplayer scripting help

Post 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.
coolmintyice
Lance Corporal
Posts: 11
Joined: Sun Mar 30, 2003 2:53 pm

Post 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 :roll: 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 :lol: :roll:

thanks
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

It may or may not be possible. I have a feeling that it may not work, cause of the doors. :roll: :roll: :roll:
Live to map, not map to live.
-mohaa_rox, .map
moderator
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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 :D
hope this helps, prob not cos it's all foreign 2 me :-/
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I don't think you can get the weapon of the player :(
Image
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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 :D

btw wacko if ya read this i haven't 4gotten about the escalators, there still WIP (work in progress)
hope this helps, prob not cos it's all foreign 2 me :-/
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

game code =/= scripting language :wink:
Image
Angex
Major
Posts: 293
Joined: Mon Dec 30, 2002 1:23 pm
Contact:

Post 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
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post 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")
}
//
{
Live to map, not map to live.
-mohaa_rox, .map
moderator
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I think .weapongroup is only available for AIs :?

Rox better switch the } and { ;)
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Man, didn't notice that.
Live to map, not map to live.
-mohaa_rox, .map
moderator
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

playerstat

Post 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
}
Tom Trude,

Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I think these stats are client side and not to be read by your script :?
Image
Post Reply