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 07-17-2001, 02:08 PM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
200 MP

I am trying to create an NPCw to make it seem as though the player has 200 MP. It will be an item the player may purchase. Anyways, I was wondering if anyone could figure out why this doesn't work...
NPC Code:
if (created) {
this.playermagic=playermp;
}
if (playerenters) {
toweapons -200MP;
}
if (this.playermagic>playermp) {
playermp+=int(this.playermagic-playermp/2);
this.playermagic=playermp;
}

__________________
the sky is falling

Last edited by SkooL; 07-17-2001 at 10:32 PM..
Reply With Quote
  #2  
Old 07-17-2001, 04:56 PM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
*bump*
__________________
the sky is falling
Reply With Quote
  #3  
Old 07-17-2001, 05:09 PM
Cybnext_Design Cybnext_Design is offline
Registered User
Join Date: Jun 2001
Posts: 244
Cybnext_Design is on a distinguished road
Send a message via AIM to Cybnext_Design
NPC Code:

if (created) {
setstring playermagic,playermp;
}

if (playerenters) {
toweapons -200 MP;
}

if (strtofloat(#s(playermagic))>playermp) {
tempplayermagic=int(strtofloat(#s(playermagic))-playermp/2);
setstring playermagic,#v(tempplayermagic);
}



This might work, im not sure. Im too tired to load up the editor so....You just have to try it.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #4  
Old 07-17-2001, 05:24 PM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
Quote:
Originally posted by Cybnext_Design
NPC Code:

if (created) {
setstring playermagic,playermp;
}

if (playerenters) {
toweapons -200 MP;
}

if (strtofloat(#s(playermagic))>playermp) {
tempplayermagic=int(strtofloat(#s(playermagic))-playermp/2);
setstring playermagic,#v(tempplayermagic);
}



This might work, im not sure. Im too tired to load up the editor so....You just have to try it.
Didn't work
I thought maybe it was working because of the order of operations...
NPC Code:
if (created) {
this.playermagic=playermp;
}
if (playerenters) {
toweapons -200MP;
}
if (this.playermagic>playermp) {
playermp+=int((this.playermagic-playermp)/2);
this.playermagic=playermp;
}


That didn't work either.
__________________
the sky is falling
Reply With Quote
  #5  
Old 07-17-2001, 06:35 PM
Guest
Posts: n/a
You should...should...wait for Kaimetsu to get back. He could help you out. God knows when he'll be back though...
Reply With Quote
  #6  
Old 07-17-2001, 06:46 PM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
Quote:
Originally posted by ZanderX
You should...should...wait for Kaimetsu to get back. He could help you out. God knows when he'll be back though...
I thought he said a week in a thread he made...it's been longer than a week
__________________
the sky is falling
Reply With Quote
  #7  
Old 07-17-2001, 06:47 PM
Guest
Posts: n/a
I think I saw in another thread that he lost internet access. We don't have the Script Monkey...
Reply With Quote
  #8  
Old 07-17-2001, 06:48 PM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
Quote:
Originally posted by ZanderX
I think I saw in another thread that he lost internet access. We don't have the Script Monkey...
__________________
the sky is falling
Reply With Quote
  #9  
Old 07-17-2001, 06:50 PM
Guest
Posts: n/a
Your avatar = Creeps me out.
Reply With Quote
  #10  
Old 07-17-2001, 07:14 PM
Vash Vash is offline
:D.
Vash's Avatar
Join Date: Mar 2001
Location: The Planet Gunsmoke and/or Ragol
Posts: 2,246
Vash is on a distinguished road
Send a message via AIM to Vash
Re: 200 Mp

Quote:
Originally posted by SkooL
I am trying to create an NPCw to make it seem as though the player has 200 MP. It will be an item the player may purchase. Anyways, I was wondering if anyone could figure out why this doesn't work...
NPC Code:
if (created) {
this.playermagic=playermp;
}
if (playerenters) {
toweapons -200MP;
}
if (this.playermagic>playermp) {
playermp+=int(this.playermagic-playermp/2);
this.playermagic=playermp;
}

I don't even know how to make an npc that when you touch it you get full mp
__________________
AIM: EvilVash


There's something that cannot be expressed in words. Human emotions. Emotions of the heart cannot be defined. But there's a way to read the emotions. Look into their eyes. The girl lied to me. But I believed her. The man lied to me. But I trusted him. But the moment I looked into his eyes, the angel of destiny began to unravel the truth. Just look into their eyes. There is only one truth.

"Vash. For 12 years old, you're so damn smart that it isn't even funny." - Marle
Reply With Quote
  #11  
Old 07-17-2001, 07:18 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
I do!!!

if (pleyertouchsesmeh) {
pleyahM-pee + = 100;
}

Kaimetsu will be missed!
Reply With Quote
  #12  
Old 07-17-2001, 07:20 PM
Vash Vash is offline
:D.
Vash's Avatar
Join Date: Mar 2001
Location: The Planet Gunsmoke and/or Ragol
Posts: 2,246
Vash is on a distinguished road
Send a message via AIM to Vash
Quote:
Originally posted by Slaktmaster
I do!!!

if (pleyertouchsesmeh) {
pleyahM-pee + = 100;
}

Kaimetsu will be missed!
ooooooooooooookay
__________________
AIM: EvilVash


There's something that cannot be expressed in words. Human emotions. Emotions of the heart cannot be defined. But there's a way to read the emotions. Look into their eyes. The girl lied to me. But I believed her. The man lied to me. But I trusted him. But the moment I looked into his eyes, the angel of destiny began to unravel the truth. Just look into their eyes. There is only one truth.

"Vash. For 12 years old, you're so damn smart that it isn't even funny." - Marle
Reply With Quote
  #13  
Old 07-17-2001, 07:25 PM
Guest
Posts: n/a
Pay no attention to the strange ones, Vash.
Reply With Quote
  #14  
Old 07-17-2001, 07:26 PM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
Quote:
Originally posted by Slaktmaster
if (pleyertouchsesmeh) {
pleyahM-pee + = 100;
}
You have mad skills, etc...
__________________
the sky is falling
Reply With Quote
  #15  
Old 07-17-2001, 08:49 PM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
Quote:
Originally posted by ZanderX
Your avatar = Creeps me out.
You use the equal sign wrong! The equal sign takes the place of 'is' and if you replace the equal sign with 'is' in that sentance, it makes no sense.
__________________
the sky is falling
Reply With Quote
  #16  
Old 07-17-2001, 10:44 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
Quote:
Originally posted by SkooL

You use the equal sign wrong! The equal sign takes the place of 'is' and if you replace the equal sign with 'is' in that sentance, it makes no sense.

No sense
Reply With Quote
  #17  
Old 07-17-2001, 10:47 PM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
Quote:
Originally posted by Slaktmaster

No sense
The equal signs takes the place of the word 'is' or 'are'. Not too complicated.
__________________
the sky is falling
Reply With Quote
  #18  
Old 07-17-2001, 10:52 PM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Hmm. It seems as though you use the variable this.playermagic to hold excess magic. Please tell me what you are trying to do in the 'if (this.playermagic>playermp) {' section. If you tell me what you are trying to create, I can create it for you. But, your code makes no sense to me. =P
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #19  
Old 07-17-2001, 11:02 PM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
Quote:
Originally posted by BocoC
Hmm. It seems as though you use the variable this.playermagic to hold excess magic. Please tell me what you are trying to do in the 'if (this.playermagic>playermp) {' section. If you tell me what you are trying to create, I can create it for you. But, your code makes no sense to me. =P
When I use this.playermagic=playermp does it store the players current MP or does it change with the playermp variable?
__________________
the sky is falling
Reply With Quote
  #20  
Old 07-17-2001, 11:39 PM
Brady2 Brady2 is offline
Registered User
Brady2's Avatar
Join Date: Mar 2001
Location: Phoenix, AZ and Wichita Falls, TX
Posts: 924
Brady2 is on a distinguished road
Jadis:

NPC Code:

if (playertouchsme) {
toweapons MPBARSIR;
hidelocal;
timeout = .05;
this.mp = playermp;
}
if (timeout) {
timeout = .05;
if (this.mp>playermp) {
playermp+=int(abs(this.mp-playermp)/2);
this.mp = playermp;
}
if (this.mp<playermp) this.mp = playermp;
}

Reply With Quote
  #21  
Old 07-17-2001, 11:40 PM
T-Squad T-Squad is offline
Banned
T-Squad's Avatar
Join Date: Mar 2001
Location: United States of America
Posts: 1,733
T-Squad is on a distinguished road
Re: 200 MP

Quote:
Originally posted by SkooL
I am trying to create an NPCw to make it seem as though the player has 200 MP. It will be an item the player may purchase. Anyways, I was wondering if anyone could figure out why this doesn't work...
NPC Code:
if (created) {
this.playermagic=playermp;
}
if (playerenters) {
toweapons -200MP;
}
if (this.playermagic>playermp) {
playermp+=int(this.playermagic-playermp/2);
this.playermagic=playermp;
}

try somethign like

if (playerenters) {
toweapons -200MP;
}
while (this.magic != playermp) {
if (this.magic>playermp) {
playermp = int((this.magic-playermp)/2+playermp);
}else{
this.magic = playermp;
}
}
Reply With Quote
  #22  
Old 07-18-2001, 12:01 AM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
Not much makes sense theses days
And I am stupid and should stick to level design
Reply With Quote
  #23  
Old 07-18-2001, 12:08 AM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
None of the worked
I'll just make it so when the player has -200MP the flag 200MP is set. In the NPCs that use magic it will deduct half when 200MP is true. Thanks to all who tried to help
__________________
the sky is falling
Reply With Quote
  #24  
Old 07-18-2001, 08:03 AM
Guest
Posts: n/a
maybe you should try to make the mp-bar longer
with imgvision and stuff..
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 12:39 AM.


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