Page 1 of 2
new to scripting, needs help
Posted: Tue Feb 15, 2005 2:18 am
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}
Posted: Tue Feb 15, 2005 4:57 am
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

Posted: Tue Feb 22, 2005 5:48 pm
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.
Posted: Wed Feb 23, 2005 2:07 pm
by Green Beret
No one?
all these scripters in here and none has any idea?
Posted: Wed Feb 23, 2005 10:47 pm
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....
Posted: Wed Feb 23, 2005 11:12 pm
by lizardkid
waittill death doesnt work for players.
Posted: Wed Feb 23, 2005 11:34 pm
by Master-Of-Fungus-Foo-D
why not?
Posted: Thu Feb 24, 2005 4:15 am
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.
Posted: Thu Feb 24, 2005 5:50 am
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.
Posted: Thu Feb 24, 2005 12:05 pm
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
Posted: Thu Feb 24, 2005 4:48 pm
by Green Beret
thanks not so rookie one,gettin to be a pro one...lol

Posted: Thu Feb 24, 2005 7:20 pm
by Rookie One.pl
Lol!

You're the first person to tell me my nick does not match me,

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.
<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>
Posted: Fri Feb 25, 2005 1:14 am
by Green Beret
Thank you Sir
much appreciated!
Posted: Fri Feb 25, 2005 5:03 am
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

Posted: Fri Feb 25, 2005 8:37 am
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 .