new to scripting, needs help
Moderator: Moderators
-
newschool$killer
- Private
- Posts: 2
- Joined: Tue Feb 15, 2005 2:06 am
new to scripting, needs help
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}
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}
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
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.
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.
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
-
Master-Of-Fungus-Foo-D
- Muffin Man
- Posts: 1544
- Joined: Tue Jan 27, 2004 12:33 am
- Location: cali, United States
well, i think you could do this,
id add this right before the 'end'
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....-
Master-Of-Fungus-Foo-D
- Muffin Man
- Posts: 1544
- Joined: Tue Jan 27, 2004 12:33 am
- Location: cali, United States
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.
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
۞
Abyssus pro sapientia
Olympus pro Ignarus
۞
AND STUFF™ © 2006
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
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-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
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:
That'll also detect a team change.</EDIT>
<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 :)-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
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 .
local.player = parm.other
as soon as you can in your thread to read the parm.other value and save it before it changes .




