2 Questions

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

2 Questions

Post by MPowell1944 »

How would I check to see when a player spawns?

Can you set runspeed on a player like you can with scale and gravity?

I need to wipe off the modding rust :oops:
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Glueing a trigger to a player and waiting for it to be triggered is an option... might be easiers ways but I'm not aware of a fully functioning one.

Runspeed can be set via weaponcommand (runspeed is a weapon property) :?
Image
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

jv_map wrote:Glueing a trigger to a player and waiting for it to be triggered is an option... might be easiers ways but I'm not aware of a fully functioning one.

Runspeed can be set via weaponcommand (runspeed is a weapon property) :?
Runspeed can be set via weaponcommand (runspeed is a weapon property) :?
what about unarmed?
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 »

jv_map wrote:Glueing a trigger to a player and waiting for it to be triggered is an option... might be easiers ways but I'm not aware of a fully functioning one.
Isn't this going to be triggered all the time? :?
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

Rookie One wrote:
jv_map wrote:Glueing a trigger to a player and waiting for it to be triggered is an option... might be easiers ways but I'm not aware of a fully functioning one.
Isn't this going to be triggered all the time? :?
it depends what trigger it is
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

can;t you do this?

Code: Select all

spawn_listener:

for($player[local.i] = 1; $player[local.i] < 32; $player[local.i]++)
{
local.curPlayer = $player[local.i]

local.curPlayer waittill spawn
// code
}
? or is the player array something totally different?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
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 waittill spawn works for players :(
Image
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 »

jv_map wrote:Glueing a trigger to a player and waiting for it to be triggered is an option... might be easiers ways but I'm not aware of a fully functioning one.
Jv, you are wrong. :( This doesn't work. You're using this in your bots and notice that the bots start spawning right after you choose the team, not after choosing the weapon and spawning physically. That's because the trigger is activated right after choosing the team and there's a direct jump from stage 2 to stage 3.

I badly need to know when a player spawns! :( Has anyone got an idea how to figure this out?
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

well triggers at spawn points is what i used but i thought maybe have a trigger like jv said then have spawnednearly = 1

then when state land is reached they have spawned right?
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 »

Elgan wrote:well triggers at spawn points is what i used but i thought maybe have a trigger like jv said then have spawnednearly = 1

then when state land is reached they have spawned right?
Could you expand this a bit? What's this spawnedearly? How to use it?
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Check the scanner scripting in The Canna LIB, especially player_scanner and the detect_player_status functions that jv_map helped me with.
Admin .MAP Forums
Image
Head above heels.
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 »

No, Bjarne, this is exactly the same issue as I described in my previous post - it will be triggered before you choose the weapon.

Elgan, expand it, please...
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Rookie One wrote:Jv, you are wrong. :( This doesn't work. You're using this in your bots and notice that the bots start spawning right after you choose the team, not after choosing the weapon and spawning physically. That's because the trigger is activated right after choosing the team and there's a direct jump from stage 2 to stage 3.
No I am not wrong :roll: :wink: the bots start spawning as soon as either team has any players, but that doesn't mean a trigger has been fired or a bug has been found :wink: ... the player triggers aren't used there...

However for the bots the trigger 'trick' is primarily responsible for making sure bots don't attack or folllow spectators.
Image
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 »

Whoops... I must have misread something... :oops: Well it appeared to me that the bots will spawn after somebody has physically spawned. Dangit, must look into it more carefully...
<EDIT>Nah, I tell you, this doesn't work! :evil: Here's my thread:

Code: Select all

waitTillJoinGame:
   while (self.dmteam == "spectator" || !isAlive(self))
      waitframe
   local.trigger = spawn trigger_multiple origin self.origin
   local.trigger setsize ( -16 -16 -16 ) ( 16 16 16 )
   local.trigger waittill trigger
   self thread global/enemyterritory/class_handler.scr::determineClass
   self thread waitTillDeath
end
The determineClass thread reads the weapon the player's carrying and gives him a new, class-specific loadout, but it's called right at the moment of choosing a team... Aaargh!!! :evil: :evil: :evil:</EDIT>
Last edited by Rookie One.pl on Sun Jan 30, 2005 6:11 pm, edited 2 times in total.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

thatll teach you o call jv_map wrong :lol:
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Post Reply