Obstacle Course Timer

Post your scripting questions / solutions here

Moderator: Moderators

Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Viper wrote:

Code: Select all

     self stufftext ("say I FINISHED " + local.name + " IN " + local.count + " SECONDS" ) 
On a side note, this is not the best way efficiency-wise. You're sending the string they're supposed to say to the client, the client resends it back to the server in the form of a client command, and then the server broadcasts it to all clients via a server command. You could do

Code: Select all

     self dmmessage -1 ("say I FINISHED " + local.name + " IN " + local.count + " SECONDS" ) 
This way only the last step is made. :)

If you want the grenade scoring stuff working properly, you really want to use the method I suggested.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
SniperWolf
Colour Sergeant
Posts: 89
Joined: Sat Dec 18, 2004 5:14 am
Location: New York, USA
Contact:

Post by SniperWolf »

Rookie,

your dmmessage -1 makes it say it to team members(allies in this case) not everyone.

I also tested your grenade script Rookie & it stops the spamming like you said it would but it still prints on the left under the compass in yellow. I like the fact that i could throw 6 nades in there back to back & not see the message 6 times. But I would still like it to print with stufftext. Is there a way I could map it in to get it to work with stufftext??

Viper, tested your script & it times multiple players in different courses at the same time.

Now on to the grenade range. Hope there is a way to remap it so it works with stufftext.
«{T§F}»Col.§niperWolf
Visit Clan «{T§F}» at:http://www.clantsf.org
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

Rookie One.pl wrote:
Viper wrote:

Code: Select all

     self stufftext ("say I FINISHED " + local.name + " IN " + local.count + " SECONDS" ) 
On a side note, this is not the best way efficiency-wise. You're sending the string they're supposed to say to the client, the client resends it back to the server in the form of a client command, and then the server broadcasts it to all clients via a server command. You could do

Code: Select all

     self dmmessage -1 ("say I FINISHED " + local.name + " IN " + local.count + " SECONDS" ) 
This way only the last step is made. :)

If you want the grenade scoring stuff working properly, you really want to use the method I suggested.
Rook,
Yes, thats the intent, He wants all players to see the progress.

Sniper,
regarding the nade thing i could look at it when you have it completed. At this point thats the best i can offer.
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

SniperWolf wrote:Rookie,

your dmmessage -1 makes it say it to team members(allies in this case) not everyone.
Then it's either -2 or 0, can't remember exactly. ;)
SniperWolf wrote:I also tested your grenade script Rookie & it stops the spamming like you said it would but it still prints on the left under the compass in yellow. I like the fact that i could throw 6 nades in there back to back & not see the message 6 times. But I would still like it to print with stufftext. Is there a way I could map it in to get it to work with stufftext??
OMG. The iprint was just an example there, all you have to do is to replace the iprint with your stufftext line (or, even better, dmmessage - you'll save net bandwidth).
SniperWolf wrote:Now on to the grenade range. Hope there is a way to remap it so it works with stufftext.
Viper wrote:Rook,
Yes, thats the intent, He wants all players to see the progress.
I'm just pointing out stufftext is not very efficient.
Rookie One.pl wrote:Stufftext sends the string they're supposed to say to the client, the client resends it back to the server in the form of a client command, and then the server broadcasts it to all clients via a server command.
Dmmessage does only the last step.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
SniperWolf
Colour Sergeant
Posts: 89
Joined: Sat Dec 18, 2004 5:14 am
Location: New York, USA
Contact:

Post by SniperWolf »

Hey Guys,

I made a script to hide & show the parts of my Rifle Range Targets. Again I would like it to write like stufftext.

I tried adding:

Code: Select all

self dmmessage -1 ("say The Trigger Works")
instead of iprintin. It seems to shut down my entire map script :?

But it works with iprintin.

Here is my Rifle Range Target script. Could you guys look at it ??

Tell me what I did wrong when adding dmmessage.

Code: Select all

// Target Test //

$rifletarget1b_trigger immune bash
$rfiletarget1b_trigger immune grenade

thread rifletarget1b_triggered

rifletarget1b_triggered:
  iprintln "The Trigger Works"
  $rifletarget1b hide

wait 15

  $rifletarget1b show

end
Thanks Guys :D
«{T§F}»Col.§niperWolf
Visit Clan «{T§F}» at:http://www.clantsf.org
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

try these

Code: Select all

rifletarget1b_triggered: 
  local.player = parm.owner
  local.player stufftext "say good shot!!"
  iprintln "The Trigger Works" 
  $rifletarget1b hide 

wait 15 

  $rifletarget1b show 

end

Code: Select all

rifletarget1b_triggered: 
  local.player = parm.other
  local.player stufftext "say good shot!!"
  iprintln "The Trigger Works" 
  $rifletarget1b hide 

wait 15 

  $rifletarget1b show 

end

Code: Select all

rifletarget1b_triggered: 
  parm.owner stufftext "say good shot!!"
  iprintln "The Trigger Works" 
  $rifletarget1b hide 

wait 15 

  $rifletarget1b show 

end
SniperWolf
Colour Sergeant
Posts: 89
Joined: Sat Dec 18, 2004 5:14 am
Location: New York, USA
Contact:

Post by SniperWolf »

Viper,

Thanks AGAIN!!! The 2nd code you posted works great. I did try to apply that same code to my grenade range script but it didn't work :cry:

Then I added this line to my grenade range script & it works :D

Code: Select all

parm.owner stufftext
Thanks Viper. Your help is GREATLY APPRECIATED!!
«{T§F}»Col.§niperWolf
Visit Clan «{T§F}» at:http://www.clantsf.org
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

owner or other? owner is new to me. but trial and error is the best method if your not sure.

I Look forward to this one when its done. Got an estimated time of completion :?: because im starting a new map pak.
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

I wrote about parm.owner a couple of times already in this thread. I've got the feeling I'm being ignored. :roll:
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

Rookie One.pl wrote:I wrote about parm.owner a couple of times already in this thread. I've got the feeling I'm being ignored. :roll:
Hi Rookster :)

Parm.owner didnt work for me as you sugested it previously. But I still love you man. :P
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Lol. :P

Weird you guys have problems both with this and dmmessage. Parm.owner is the line that made air support via smoke nades in FFE possible:

Code: Select all

smokegrenade_trigger_fire:
	local.projectile = parm.other
	if (local.projectile.done == 1)
		end
	local.projectile.done = 1
	local.player = parm.owner
	if (local.projectile.model == models/projectiles/steilhandgranate.tik || local.projectile.model == models/projectiles/steilhandgranate_primary.tik)
	{
		local.player.haspower = 0
		local.player.power_timer = 0
		local.projectile thread smokegrenade_fire local.player
		local.projectile thread make_smoke
		local.projectile nodamage
	}
end
And I've been using dmmessage ever since I learned from jv's scripts that it exists. :P

Code: Select all

busted:
	local.sucker = parm.other
	if !(local.sucker waitthread inbounds ( -1315 -3240 0 ) ( -3536 -1464 0 ))
	{
		local.sucker kill
		local.sucker dmmessage -1 "Whoops, seems like I've been buried alive..."
	}
So yeah, they do work. Must've been other errors that you had. :?
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
SniperWolf
Colour Sergeant
Posts: 89
Joined: Sat Dec 18, 2004 5:14 am
Location: New York, USA
Contact:

Post by SniperWolf »

OK Guys here's another question. Is there a way to disable all the triggers for one target at once??

My targets are made up of 11 parts so I have 11 triggers. What I wanna do is disable all triggers after the target has been shot. The triggers are named as follows:

rifletarget1_triggera
rifletarget1_triggerb
rifletarget1_triggerc
rifletarget1_triggerd
rifletarget1_triggere
rifletarget1_triggerf
rifletarget1_triggerg
rifletarget1_triggerh
rifletarget1_triggeri
rifletarget1_triggerj
rifletarget1_triggerk

Can I add a line like this to the script:

Code: Select all

$rifletarget1_trigger nottriggerable
then add this line to activate them again:

Code: Select all

$rifletarget_trigger triggerable
«{T§F}»Col.§niperWolf
Visit Clan «{T§F}» at:http://www.clantsf.org
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Put a setthread in the last trigger, And do a

$trigger remove ect.....

Or

$trigger nottriggerable
Image
SniperWolf
Colour Sergeant
Posts: 89
Joined: Sat Dec 18, 2004 5:14 am
Location: New York, USA
Contact:

Post by SniperWolf »

Something like this:

Code: Select all

rifletarget1b_triggered:
  local.player = parm.other
  local.player stufftext "say Head Shot! I Scored 10 Points"
  iprintln "The Trigger Works"
  $trigger nottriggerable <--- Add this line
  $rifletarget1b hide

wait 15

  $trigger triggerable <--- Add This Line??
  $rifletarget1b show

end
Will this stop all triggers for that target from working?
«{T§F}»Col.§niperWolf
Visit Clan «{T§F}» at:http://www.clantsf.org
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Nope, because you called them rifletarget1_triggera, rifletarget1_triggerb, etc. Do you need them to be called differently? Because you could just name them all rifletarget1_trigger and then do a single

Code: Select all

$rifletarget1_trigger nottriggerable
And that's it. :)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply