Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   200 Mp (https://forums.graalonline.com/forums/showthread.php?t=7488)

SkooL 07-17-2001 02:08 PM

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;
}


SkooL 07-17-2001 04:56 PM

*bump*

Cybnext_Design 07-17-2001 05:09 PM

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.

SkooL 07-17-2001 05:24 PM

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.

07-17-2001 06:35 PM

You should...should...wait for Kaimetsu to get back. He could help you out. :) God knows when he'll be back though...

SkooL 07-17-2001 06:46 PM

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 :(

07-17-2001 06:47 PM

I think I saw in another thread that he lost internet access. :( We don't have the Script Monkey...

SkooL 07-17-2001 06:48 PM

Quote:

Originally posted by ZanderX
I think I saw in another thread that he lost internet access. :( We don't have the Script Monkey...
:( :( :(

07-17-2001 06:50 PM

Your avatar = Creeps me out.

Vash 07-17-2001 07:14 PM

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

Slaktmaster 07-17-2001 07:18 PM

I do!!!

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

Kaimetsu will be missed! :(

Vash 07-17-2001 07:20 PM

Quote:

Originally posted by Slaktmaster
I do!!!

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

Kaimetsu will be missed! :(

ooooooooooooookay

07-17-2001 07:25 PM

Pay no attention to the strange ones, Vash. :D

SkooL 07-17-2001 07:26 PM

Quote:

Originally posted by Slaktmaster
if (pleyertouchsesmeh) {
pleyahM-pee + = 100;
}

You have mad skills, etc...

SkooL 07-17-2001 08:49 PM

Quote:

Originally posted by ZanderX
Your avatar = Creeps me out.
:eek: 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.:eek: :eek: :eek:

Slaktmaster 07-17-2001 10:44 PM

Quote:

Originally posted by SkooL

:eek: 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.:eek: :eek: :eek:

:(
No sense :(

SkooL 07-17-2001 10:47 PM

Quote:

Originally posted by Slaktmaster
:(
No sense :(

The equal signs takes the place of the word 'is' or 'are'. Not too complicated.

BocoC 07-17-2001 10:52 PM

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

SkooL 07-17-2001 11:02 PM

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?

Brady2 07-17-2001 11:39 PM

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;
}


T-Squad 07-17-2001 11:40 PM

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;
}
}

Slaktmaster 07-18-2001 12:01 AM

Not much makes sense theses days :(
And I am stupid and should stick to level design :(

SkooL 07-18-2001 12:08 AM

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 :)

07-18-2001 08:03 AM

maybe you should try to make the mp-bar longer
with imgvision and stuff..


All times are GMT +2. The time now is 12:49 AM.

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