Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-25-2002, 10:36 AM
Tin Man Tin Man is offline
GFX Ninja
Tin Man's Avatar
Join Date: Aug 2001
Location: Near a PC
Posts: 1,277
Tin Man is on a distinguished road
Send a message via ICQ to Tin Man Send a message via AIM to Tin Man Send a message via Yahoo to Tin Man
Scripting problems

Im trying to do some script for a NPC that reduces all damage done to in a pattern, first it does 0.5 then nothing then 0.5, so on and so forth my problem is that it only works for the first part of the script then stops. I was wondering if some one could help my and fix my script so that it would follow that pattern. Id really apreciate it.

i havent scipted in a while so that would explane why its so long.

also when the NPC's activated it automaticly sets the players hearts to 3.

if (test && playerhearts > 3 || playerhearts == 3 && this.l33t = 0) { playerhearts = 3; this.l33t = this.l33t + 1;
}
if (test && playerhearts > 3 && this.l33t = 1) { playerhearts = 2.5; this.l33t = this.l33t + 1;
}
if (test && playerhearts > 3 && this.l33t = 2) { playerhearts = 2.5; this.l33t = this.l33t + 1;
}
if (test && playerhearts > 3 && this.l33t = 3) { playerhearts = 2; this.l33t = this.l33t + 1;
}
if (test && playerhearts > 3 && this.l33t = 4) { playerhearts = 2; this.l33t = this.l33t + 1;
}
if (test && playerhearts > 3 && this.l33t = 5) { playerhearts = 1.5; this.l33t = this.l33t + 1;
}
if (test && playerhearts > 3 && this.l33t = 6) { playerhearts = 1.5; this.l33t = this.l33t + 1;
}
if (test && playerhearts > 3 && this.l33t = 7) { playerhearts = 1; this.l33t = this.l33t + 1;
}
if (test && playerhearts > 3 && this.l33t = 8) { playerhearts = 1; this.l33t = this.l33t + 1;
}
if (test && playerhearts > 3 && this.l33t = 9) { playerhearts = .5; this.l33t = this.l33t + 1;
}
if (test && playerhearts > 3 && this.l33t = 10) { playerhearts = .5; this.l33t = this.l33t + 1;
}
if (test && playerhearts > 3 && this.l33t = 11) { playerhearts = 0; this.l33t = this.l33t + 1;
}
if (test && this.l33t = 12) {unset test; this.l33t = 0;}
__________________


Check it out
Reply With Quote
  #2  
Old 03-25-2002, 10:45 AM
Tin Man Tin Man is offline
GFX Ninja
Tin Man's Avatar
Join Date: Aug 2001
Location: Near a PC
Posts: 1,277
Tin Man is on a distinguished road
Send a message via ICQ to Tin Man Send a message via AIM to Tin Man Send a message via Yahoo to Tin Man
lol i didnt know i could do that, lol. Hmm Visual Basic and G script are verry simmilar.
__________________


Check it out
Reply With Quote
  #3  
Old 03-25-2002, 10:51 AM
Bhala Bhala is offline
Disgruntled Monkey
Bhala's Avatar
Join Date: Mar 2001
Posts: 779
Bhala is on a distinguished road
if(test){
for(this.i=0;playerhearts in |0,3|;this.i+2){
playerhearts-=.5;
}
unset test;
}

omg look how simple it can be...
Reply With Quote
  #4  
Old 03-25-2002, 10:58 AM
Tin Man Tin Man is offline
GFX Ninja
Tin Man's Avatar
Join Date: Aug 2001
Location: Near a PC
Posts: 1,277
Tin Man is on a distinguished road
Send a message via ICQ to Tin Man Send a message via AIM to Tin Man Send a message via Yahoo to Tin Man
this doesnt work either:

if (playerhearts > 3 || playerhearts == 3 && this.l33t = 0) { playerhearts = 3; this.l33t = this.l33t + 1;
}
elseif (playerhearts > 3 && this.l33t = 1) { playerhearts = 2.5; this.l33t = this.l33t + 1;
}
elseif (playerhearts > 3 && this.l33t = 2) { playerhearts = 2.5; this.l33t = this.l33t + 1;
}
elseif (playerhearts > 3 && this.l33t = 3) { playerhearts = 2; this.l33t = this.l33t + 1;
}
elseif (playerhearts > 3 && this.l33t = 4) { playerhearts = 2; this.l33t = this.l33t + 1;
}
elseif (playerhearts > 3 && this.l33t = 5) { playerhearts = 1.5; this.l33t = this.l33t + 1;
}
elseif (playerhearts > 3 && this.l33t = 6) { playerhearts = 1.5; this.l33t = this.l33t + 1;
}
elseif (playerhearts > 3 && this.l33t = 7) { playerhearts = 1; this.l33t = this.l33t + 1;
}
elseif (playerhearts > 3 && this.l33t = 8) { playerhearts = 1; this.l33t = this.l33t + 1;
}
elseif (playerhearts > 3 && this.l33t = 9) { playerhearts = .5; this.l33t = this.l33t + 1;
}
elseif (playerhearts > 3 && this.l33t = 10) { playerhearts = .5; this.l33t = this.l33t + 1;
}
elseif (playerhearts > 3 && this.l33t = 11) { playerhearts = 0; this.l33t = this.l33t + 1;
}
elseif (playerhearts > 3 && this.l33t = 12) {unset test; this.l33t = 0;}
}
__________________


Check it out
Reply With Quote
  #5  
Old 03-25-2002, 10:58 AM
Bhala Bhala is offline
Disgruntled Monkey
Bhala's Avatar
Join Date: Mar 2001
Posts: 779
Bhala is on a distinguished road
Quote:
Originally posted by Kaimetsu
Yeah, that's another thing. Don't use flags for clientside-only temporary variables!
huh? was that to me? lol
Reply With Quote
  #6  
Old 03-25-2002, 10:59 AM
Bhala Bhala is offline
Disgruntled Monkey
Bhala's Avatar
Join Date: Mar 2001
Posts: 779
Bhala is on a distinguished road
dude do you see my post or not?
Reply With Quote
  #7  
Old 03-25-2002, 11:02 AM
Tin Man Tin Man is offline
GFX Ninja
Tin Man's Avatar
Join Date: Aug 2001
Location: Near a PC
Posts: 1,277
Tin Man is on a distinguished road
Send a message via ICQ to Tin Man Send a message via AIM to Tin Man Send a message via Yahoo to Tin Man
Quote:
Originally posted by Bhala
dude do you see my post or not?
lol i just did thanks.
__________________


Check it out
Reply With Quote
  #8  
Old 03-25-2002, 11:02 AM
Bhala Bhala is offline
Disgruntled Monkey
Bhala's Avatar
Join Date: Mar 2001
Posts: 779
Bhala is on a distinguished road
lol np
Reply With Quote
  #9  
Old 03-25-2002, 11:12 AM
Tin Man Tin Man is offline
GFX Ninja
Tin Man's Avatar
Join Date: Aug 2001
Location: Near a PC
Posts: 1,277
Tin Man is on a distinguished road
Send a message via ICQ to Tin Man Send a message via AIM to Tin Man Send a message via Yahoo to Tin Man
gah i tried using your script and im stuck in a loop of death also by its self it didnt work.
__________________


Check it out
Reply With Quote
  #10  
Old 03-25-2002, 11:18 AM
Bhala Bhala is offline
Disgruntled Monkey
Bhala's Avatar
Join Date: Mar 2001
Posts: 779
Bhala is on a distinguished road
oops i see why... playerhearts in |.5,3| that should work
Reply With Quote
  #11  
Old 03-25-2002, 04:22 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
ok, this script does a lot of f***** up thing...

one thing:
NPC Code:

NPC Code:

if (playerhearts > 3 || playerhearts == 3 && this.l33t = 0){playerhearts = 3; this.l33t = this.l33t + 1;
}

should be:

if ((playerhearts>3||playerhearts==3)&&this.l33t=0) {
playerhearts=3;
this.l33t+=1;
}



Reply With Quote
  #12  
Old 03-25-2002, 06:07 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Also just a suggestion, I would restrain from using numerical values in your variable names, just not a good idea.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #13  
Old 03-25-2002, 09:16 PM
Tin Man Tin Man is offline
GFX Ninja
Tin Man's Avatar
Join Date: Aug 2001
Location: Near a PC
Posts: 1,277
Tin Man is on a distinguished road
Send a message via ICQ to Tin Man Send a message via AIM to Tin Man Send a message via Yahoo to Tin Man
Quote:
Originally posted by Bhala
oops i see why... playerhearts in |.5,3| that should work
ok well that didnt work, thanks any way and nyghtGT im trying your suggestion right now.
__________________


Check it out
Reply With Quote
  #14  
Old 03-25-2002, 09:38 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
NPC Code:

// NPC made by screen_name

if (created) {
this.counter=0;
this.on=1;
timeout=.1;
}

if (timeout&&this.on==1) {
if (this.counter%2==0 && playerhearts>.5) {
playerhearts-=.5;
}
this.counter++;
timeout=.1;
}

__________________
[signature]insert here[/signature]
Reply With Quote
  #15  
Old 03-25-2002, 10:53 PM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
Quote:
Originally posted by nyghtGT
ok, this script does a lot of f***** up thing...

one thing:
NPC Code:

NPC Code:

if (playerhearts > 3 || playerhearts == 3 && this.l33t = 0){playerhearts = 3; this.l33t = this.l33t + 1;
}

should be:

if ((playerhearts>3||playerhearts==3)&&this.l33t=0) {
playerhearts=3;
this.l33t+=1;
}



a more effective way:


NPC Code:


if (playerhearts=>3&& this.l33t = 0) {
playerhearts = 3;
this.l33t+=1;
}


__________________
Donate money for my trip to Germany

Adiarde Manager
Reply With Quote
  #16  
Old 03-25-2002, 11:18 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
this.l33t++;
__________________
[signature]insert here[/signature]
Reply With Quote
  #17  
Old 03-26-2002, 01:46 AM
Tin Man Tin Man is offline
GFX Ninja
Tin Man's Avatar
Join Date: Aug 2001
Location: Near a PC
Posts: 1,277
Tin Man is on a distinguished road
Send a message via ICQ to Tin Man Send a message via AIM to Tin Man Send a message via Yahoo to Tin Man
umm here let me explane what i wanted better.

for everytime the player gets hurt the player will be delt nothing the first time then 0.5 the next time and it will continue in that patern till the player is dead.

i hope i havent been too anoying in my request and i am very greatfull for evey posting some script here.
__________________


Check it out
Reply With Quote
  #18  
Old 03-26-2002, 01:47 AM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
Quote:
Originally posted by Tin Man
umm here let me explane what i wanted better.

for everytime the player gets hurt the player will be delt nothing the first time then 0.5 the next time and it will continue in that patern till the player is dead.

i hope i havent been too anoying in my request and i am very greatfull for evey posting some script here.
lol i remember helping Chrisz with this script.
__________________
Donate money for my trip to Germany

Adiarde Manager
Reply With Quote
  #19  
Old 03-26-2002, 02:54 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
NPC Code:

// NPC made by screen_name

if (playerenters && !hasweapon(-HurtSystem)) {
toweapons -HurtSystem;
this.l33t=0;
}

if (playerhurt) {
this.l33t++;
if (this.l33t%2!=0) {
playerhearts-=.5;
}
}



hows that??
__________________
[signature]insert here[/signature]
Reply With Quote
  #20  
Old 03-26-2002, 03:19 AM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
Quote:
Originally posted by Tin Man
umm here let me explane what i wanted better.

for everytime the player gets hurt the player will be delt nothing the first time then 0.5 the next time and it will continue in that patern till the player is dead.

i hope i havent been too anoying in my request and i am very greatfull for evey posting some script here.
Can't you just double the player's heart count?
Reply With Quote
  #21  
Old 03-26-2002, 06:02 AM
Tin Man Tin Man is offline
GFX Ninja
Tin Man's Avatar
Join Date: Aug 2001
Location: Near a PC
Posts: 1,277
Tin Man is on a distinguished road
Send a message via ICQ to Tin Man Send a message via AIM to Tin Man Send a message via Yahoo to Tin Man
Thank you all so very much each one of you contributed to the end script and im very great full.
__________________


Check it out
Reply With Quote
  #22  
Old 03-26-2002, 08:05 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
no problem bro

__________________
[signature]insert here[/signature]
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:43 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.