new to scripting, needs help

Post your scripting questions / solutions here

Moderator: Moderators

newschool$killer
Private
Posts: 2
Joined: Tue Feb 15, 2005 2:06 am

new to scripting, needs help

Post by newschool$killer »

Hi Guys,
I am new here and i am new to scripting. I would really like somebody to teach me the basics of scripting so i can get started. One this i wan't to learn how to do is place barbed wire and sandbags. Also i was wondering if scripts for the game are supposed to go in a .cfg file. Well it would be great if somebody could help me!!!
Thanks,
506th_-|Stz.|-_{NK}
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

i can help you, do you have MSN or IRC? i dont have AIM.

also look at some of the basic tutorials and try the search button, others have wanted to know a lot of the same things ;)
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

k,sorry for stealing this thread.i didnt think it was worth starting a new thread.

k,i am a noob when it comes to the if(local.player== stuff so i wanna kind of explian what i want triggers to do to a player who triggers it.

i want it to take all weapons,then give a kar98.and then glue a trigger_multiple to the player.but the biggest problem im having is when the player dies and is alive again,he/she has the normal weapon ,how would i make it to were the player who triggered the trigger keeps the same weapon upon respawning?

plus keep the trigger_multiple glued to him/her.
Image
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

No one?
all these scripters in here and none has any idea?
Image
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 »

well, i think you could do this,
id add this right before the 'end'

Code: Select all

parm.other waittill death
parm.other takeall
parm.other item "kar98blah"
parm.other all that jazz....
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

waittill death doesnt work for players.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
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 »

why not?
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

going indepth here.

becaue waittill is a listener unction called and set with a certain argument, it basically stalls until an event, like death or prespawn or spawn, is passed to it.(this is in fact how most Windows programs run, DOS and cmd programs are user-based, Windows is event-based.) events must happen and send event messages to whatever function is waiting for them. players dying just happens to not send one.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

How about using Bjarne Gr?nnevik's routines for player scanning in his Liberation script, and modify it to take add weapons.
That would work, it spawns tm's on the players to track their status.
An ambiguous question will get a similar answer...
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 »

Player death tracking can easily be done by this:

Code: Select all

while (isAlive(local.player))
	waitframe
// put the code you want to execute after the player's death here
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

thanks not so rookie one,gettin to be a pro one...lol :wink:
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 »

Lol! :D You're the first person to tell me my nick does not match me, :P thanks. ;) Anyway, I used to be a SW Rebel Assault fan and my friends started calling me like that (it's the main character) as I was all the time talking about it. ;) I didn't mind that, in fact, I liked it. :D

<EDIT>One more thing, it's better to make it like this:

Code: Select all

local.team = local.player.dmteam
while (isAlive(local.player) && local.player.dmteam == local.team)
	waitframe
// post-mortem stuff goes here :)
That'll also detect a team change.</EDIT>
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Thank you Sir 8-)
much appreciated!
Image
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

thnx it works,i just had to change local.player to parm.other
and when i respawned boom had the weapon he was supposed to :P
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

The thing about parm.other is that it is the last person to trigger a trigger so parm.other may start out being one person but possibly by the end of the thread it maybe someone else . It is best to do

local.player = parm.other

as soon as you can in your thread to read the parm.other value and save it before it changes .
Image
Post Reply