Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-19-2001, 01:54 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
Scripting Help

I am trying to make a script where it takes your ATM Account and puts every number in a different tempstring like this:

say the ATM Account has 1 million dollars in it.

baccount1=1
baccount2=0
baccount3=0
baccount4=0
baccount5=0
baccount6=0
baccount7=0

And let me remind you that this ATM Account will change in amount.

And i know how to to do this with a 3 digit number but everything i try never works on a 7 digit number.

Can anyone help?
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #2  
Old 08-19-2001, 02:10 PM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
En Ingles Por Favor?
No Comprendo tu Pregunta.
====================
In Englsh please?
I dont understand your quesiton =\
__________________

subliminal message: 1+1=3
Reply With Quote
  #3  
Old 08-19-2001, 02:13 PM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
I mean you can get certain digets. Such as if ytou want the thousands you can do...

(number/1000 - (number/1000)%1)%10
__________________

subliminal message: 1+1=3
Reply With Quote
  #4  
Old 08-19-2001, 02:24 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
Works

Thanks that script worked quite nicely.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #5  
Old 08-19-2001, 03: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
Nevermind...that script end up not working all the time, i had my bank account set at 999900 and it displayed 1998900.

Could you maybe tell me what is wrong?
here is what i did with the scrip that you gave me.

NPC Code:

baccount=strtofloat(#s(bankaccount));
baccount1=int((baccount/1000000-(baccount/1000000)%1)%10);
baccount2=int((baccount/100000-(baccount/100000)%1)%10);
baccount3=int((baccount/10000-(baccount/10000)%1)%10);
baccount4=int((baccount/1000-(baccount/10000)%1)%10);
baccount5=int((baccount/100-(baccount/100)%1)%10);
baccount6=int((baccount/10-(baccount/10)%1)%10);
baccount7=int((baccount/1-(baccount/1)%1)%10);

__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #6  
Old 08-19-2001, 09:34 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
i know how sir
use #e
also im using an array so to get a value u would do baccount[1] instead of baccount1
(and it starts at 0 not 1)
NPC Code:

if (playerenters) {
setarray baccount,strlen(#s(bankaccount));
for (this.i=0;this.i<strlen(#s(bankaccount));this.i++) {
baccount[this.i]=strtofloat(#e(this.i,1,#s(bankaccount)));
}
}

__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #7  
Old 08-19-2001, 09:44 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by Kaimetsu


Correct except for the fact that he said that he wanted them in strings. Still pretty easy to adapt your code, though.
in string
NPC Code:

if (playerenters) {
for (this.i=0;this.i<strlen(#s(bankaccount));this.i++) {
setstring baccount#v(this.i),strtofloat(#e(this.i,1,#s(banka ccount)));
}
}

__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #8  
Old 08-19-2001, 09:48 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by Kaimetsu


Indeed. Except also he probably wants the original bankaccount to be a variable rather than a string.
SHUT THE FUC* UP
IN GRAAL THERE IS STRING AND NUMERICAL VARIABLES
SO IF HE WANTS TOO BAD CUZ U CANT DO NETHING BOUT IT
u say the stupidest things
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #9  
Old 08-19-2001, 10:01 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by Kaimetsu


Why so angry? I never attacked you, I just said that he'd probably want it a different way. Can you perhaps read his mind? Do you know exactly what he wants? If not then how can you shout at me for making an interpretation when you did the very same thing?
too bad ur dumb
if u read the whole thread u would of stfu cuz i answered his Q
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #10  
Old 08-19-2001, 10:43 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by Kaimetsu


Uh... no. He didn't specify whether the original number was a variable or a string. And why are you lashing out at me here? Have I insulted you in this thread? Or are you just insecure?
like I said you need hook3d on phonics
when he replied to that guys code he said
it didnt work and he posted what he tried
giving out his code
which was a string called bankaccount
learn how to read
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #11  
Old 08-19-2001, 10:50 PM
Knightoffrost Knightoffrost is offline
and Delph Inc.
Knightoffrost's Avatar
Join Date: Jul 2001
Location: Canada
Posts: 1,162
Knightoffrost is on a distinguished road
Send a message via ICQ to Knightoffrost Send a message via AIM to Knightoffrost Send a message via Yahoo to Knightoffrost
Here we go again. Kaimetsu dont critize (sp?) Liquids effort to help someone with a script when you never help anyone as far as I can tell. You mearly critize their script rather then writing one for them. You'd say to bad this and to bad that and only if this and if only that but do you ever really help people on the forums?
__________________
Xerphier Dintch
Featuring
Reply With Quote
  #12  
Old 08-20-2001, 12:52 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
Excuse me but, Liquid Ice, You are showing your childish nature to us right now buy insulting grammer when you already have grammer mistakes in your post. I suggest you stop being a hypocrite and stop being so childish. I think its becuase you cannot deal wth the fact that there are people better then you so you take all your anger out on them. Well that does not help. In fact it makes matters worse. Not get out of your booster chair and act like you have reached puberty.
__________________

subliminal message: 1+1=3

Last edited by Falcor; 08-20-2001 at 12:55 AM..
Reply With Quote
  #13  
Old 08-20-2001, 01:00 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
falcor u got the whole thing around
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #14  
Old 08-20-2001, 01:32 AM
CrazedMerlin CrazedMerlin is offline
Some Guy :\
Join Date: Apr 2001
Posts: 3,619
CrazedMerlin is on a distinguished road
Send a message via AIM to CrazedMerlin Send a message via Yahoo to CrazedMerlin
hey "ur dumb."
Reply With Quote
  #15  
Old 08-20-2001, 01:35 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
Wonderfull...This time a thread called "scripting help" falls to an argument...Dont you folks have anything to do besides argue? Hey..Im not saying you have no life...Im just saying...There are better places to argue than in the thread of someone looking for help..Please use at least a little discretion?
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #16  
Old 08-20-2001, 01:50 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by Xaviar
Wonderfull...This time a thread called "scripting help" falls to an argument...Dont you folks have anything to do besides argue? Hey..Im not saying you have no life...Im just saying...There are better places to argue than in the thread of someone looking for help..Please use at least a little discretion?
I helped the guy. and apperently the only one
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #17  
Old 08-20-2001, 08:08 AM
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
Actually Kaimetsu, i want the original bankaccount to go back into string form.

So LiquidIce is right.

And i hope one of those scripts work.

And bankaccount needs to be strings.
But i dont really care if the baccount0-6 are just variables.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T

Last edited by Cybnext_Design; 08-20-2001 at 08:14 AM..
Reply With Quote
  #18  
Old 08-20-2001, 08:33 AM
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
Quote:
Originally posted by Kaimetsu


May I ask what it's for? If it's to show numbers as portions of an image, then use variables.
Just a way to display how much money you have in your bank account. And im going to use an array for it.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #19  
Old 08-20-2001, 11:06 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
http://forums.graal2001.com/forums/s...ght=shownumber

thats some thread i posted a function that uses the states.png to put numbers on the screen ..
it also goes thru it number by number like u can say
this.number=strtofloat(#s(bankaccount));
and it would display all ur money on the screen .. and crap like that
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #20  
Old 08-21-2001, 01:59 PM
Knightoffrost Knightoffrost is offline
and Delph Inc.
Knightoffrost's Avatar
Join Date: Jul 2001
Location: Canada
Posts: 1,162
Knightoffrost is on a distinguished road
Send a message via ICQ to Knightoffrost Send a message via AIM to Knightoffrost Send a message via Yahoo to Knightoffrost
<[ Delph Inc. ]>
Thanks for posting that script...I wouldn't have known what to do because I'm hopeless with '%', I wouldn't have a clue what to do with it. Same with a few other little symbols...Like...I know it get the remainder of a/b but I just don't know where it could fit in because it's hard to understand how it would get a number you actually want every time...just like the bank script from Liquid.
The only way around I had was this:
NPC Code:

this.rupeecount1=int(playerrupees/1000000);
this.rupeecount2=int((playerrupees-this.rupeecount1*1000000)/100000);
this.rupeecount3=int((playerrupees-(this.rupeecount1*1000000)-(this.rupeecount2*100000))/10000);
this.rupeecount4=int((playerrupees-(this.rupeecount1*1000000)-(this.rupeecount2*100000)-(this.rupeecount3*10000))/1000);
this.rupeecount5=int((playerrupees-(this.rupeecount1*1000000)-(this.rupeecount2*100000)-(this.rupeecount3*10000)-(this.rupeecount4*1000))/100);
this.rupeecount6=int((playerrupees-(this.rupeecount1*1000000)-(this.rupeecount2*100000)-(this.rupeecount3*10000)-(this.rupeecount4*1000)-(this.rupeecount5*100))/10);
this.rupeecount7=int((playerrupees-(this.rupeecount1*1000000)-(this.rupeecount2*100000)-(this.rupeecount3*10000)-(this.rupeecount4*1000)-(this.rupeecount5*100)-(this.rupeecount6*10)));



It works fine but only allows '9999899' and it's too long for my liking...the other way should probably make this system script a bit shorter.
Well...this isn't the system script...The system script is quite a bit larger...this is only the rupee part...I had a screenshot but when I uploaded it...it practically chewed half the image up...honestly...you would be impressed for it coming from an only average scripter.
I'll try get the screen now.

</[ Delph Inc. ]>[
__________________
Xerphier Dintch
Featuring

Last edited by Knightoffrost; 08-21-2001 at 02:12 PM..
Reply With Quote
  #21  
Old 08-22-2001, 02:41 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
hehe np =P

I like to make tons of functions and i just call em for system npc's and its easy to edit/add crap in it
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #22  
Old 08-22-2001, 03:06 AM
General General is offline
Banned
Join Date: Apr 2001
Location: Station Square
Posts: 984
General is on a distinguished road
Send a message via ICQ to General Send a message via AIM to General Send a message via Yahoo to General
Re: Scripting Help

Quote:
Originally posted by Cybnext_Design
I am trying to make a script where it takes your ATM Account and puts every number in a different tempstring like this:

say the ATM Account has 1 million dollars in it.

baccount1=1
baccount2=0
baccount3=0
baccount4=0
baccount5=0
baccount6=0
baccount7=0

And let me remind you that this ATM Account will change in amount.

And i know how to to do this with a 3 digit number but everything i try never works on a 7 digit number.

Can anyone help?
I just LOVE how he is NAT Chief in dino valley
Reply With Quote
  #23  
Old 08-22-2001, 03:07 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Re: Re: Scripting Help

Quote:
Originally posted by General


I just LOVE how he is NAT Chief in dino valley
mind ur own business =\
if ur not gonna post nething smart then dont post
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:43 AM.


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