Synthetic Reality Forums Post New Topic  New Poll  Post A Reply
my profile | directory login | register | search | faq | forum home

  next oldest topic   next newest topic
» Synthetic Reality Forums » Well of Souls » World Developers Forum » The basics of cookies (Page 1)

  This topic comprises 3 pages: 1  2  3   
Author Topic: The basics of cookies
IceFox/ Silver
Moderator
Member # 2200

Icon 1 posted      Profile for IceFox/ Silver   Author's Homepage     Send New Private Message       Edit/Delete Post 
EmeraldBlyze wanted to know more about cookies and seeing how they confused the hell out of me when I just got started I figured it might help other people as well, therefore I'm making a new topic about it. [Smile]

Basicly you only have 2 types of cookies, the stock cookie list and the self made cookies.

Self made cookies:
Self made cookies are really easy to make, all you have to do is think of a (logical) name and then SET the cookie. For example we'll call the cookie apple, because we want to see how many times somebodies has earned apples during some sort of (in this case imaginary) minigame.
The current amount of apples will be zero.

SET apple, "0"

You have now succesfully made your first cookie. This hopefully didn't seem to hard yet. [Smile]
With cookies you can also do some basic math, like adding numbers, subtracting, multiplying and dividing. For example somebody won 1 apple with that minigame. In that case you'll have to add 1 apple to the current cookie:
ADD apple, "1"

The scene host scored a bonus and his amount of apples will be multiplied with 6 now.
MUL apple, "6"

6 x 1 = 6, the current cookie value will be 6 right now.
Next the scene host will spend 2 apples in exchange for something else, in other words we'll have to substract 2 apples from the cookie:
SUB apple, "2"

(6 - 2 = 4, the current cookie value is 4 now)
Finally if we also want to divide the current amount of apples by 2 we'll have to do this:
DIV apple, "2"

In short the math commands are MUL (for MULtiplying), DIV (for DIViding), ADD (for ADDing) and SUB (for substracting).

You could let the actor tell how many apples you have right now. To do that you'll need to read the cookie. This might seem confusing first, but just try it out in a script:
1: You have #<apple> apples right now %1.

In WoS it will show up as:
Farmer: You have 2 apples right now Silver.

Most bugs in cookies are caused by typos (aplle instead of apple) or because people try this:
ADD #<apple>, "10"
instead of
ADD apple, "10"

You can't do any math or set cookies in the read only mode, that's impossible, please keep that in mind when you're working with cookies. (I even fell for this myself several times.)

Basic explaining compare commands you need:
Cookies are mostly useful if you compare them with other values. For example if you have 10 apples you will win something special in that minigame quest.
To do so we need to compare if the apple cookie has 10 apples or not. We can use the COMPARE command to do that:
COMPARE #<apple>, "10"
IF< @notenoughapplesyet
IF= @enoughapples
IF> @hasmoreapples

Please note that WoS needs to read the cookie now, therefore we use #<apple> and not apple. (You can also store letters, words, even sentences in cookies if you want, I'll talk about that later.)

IF< checks if the value in the cookie is smaller then 10. IF= checks if the value is exactly the same and IF> checks if the value is greater then 10.

If you want you can also compare 1 cookie with a 2nd cookie, this goes like this:
COMPARE #<cookie1>, #<cookie2>
IF< @1issmaller
IF= @thesame
IF> @1islarger

We also have the STRCMP command, STRCMP stands for string compare, basicly you'll use this cookie for checking cookies who have letters and numbers in them, or words. This is mostly useful in to see if cookie 1 is the same as cookie 2.
For example:
SET banana, "yellow"
SET melon, "green"
SET strawberry, "red"
SET colour, "red"

In this example we're going to compare which fruit has the same colour as the current colour in cookie #<colour>. As you can see the strawberry and the #<colour> cookie match, but since WoS isn't as smart as us we'll have to use the STRCMP command to figure that out:
STRCMP #<banana>, #<colour>
IF= @colourmatch1
1: I'm sorry but the banana is colour #<banana> and the colour we're looking for is not.
STRCMP #<melon>, #<colour>
IF= @colourmatch
1: I'm sorry but the melon is not the colour we're looking for.
STRCMP #<strawberry>,#<colour>
IF= @colourmatch3
1: I'm sorry but this strawberry does not have the right colour.
END
@colourmatch
1: Yay you found the right colour!
END

I hope this made some sense... In case it didn't then just reply and I'll try to explain it better.

Last we also have the STRSTR command to play with. STRSTR stands for string in string. Cookie values (the numbers and letters) are also called strings. Sometimes you have a cookie that is partially in cookie 2 also. This makes probably more sense with an example so here goes:
SET cookie1, "Bush"
SET cookie2, "I don't like Bush."
STRSTR #<cookie1>, #<cookie2>
IF> @foundtheword
1: Cookie 1 was not found in cookie 2.
END

You have to use IF> here instead of IF= because of some C stuff which samsyn explains a lot better then I did.
quote:
NOTE: use IF= to see if the string was NOT inside the other. It's odd, but it's easier to remember the behaviour if you are a 'c' programmer, since strstr returns NULL if the string is not found.
You can off course also do something like this:
STRSTR #<cookie1>, "We all love Clinton."
IF> @foundtheword
END

In short:
COMPARE - Use this one to compare numbers only, it won't work with letters and other characters.
STRCMP - Use this one to find out if cookies who contain letters and numbers are a match with your other cookie (or word, soul ID, whatever you want.)
STRSTR - Use this one to see if the first cookie is in the 2nd cookie (or to put it more corrent, if the first string is in the 2nd string).
IF= - Use this one to see if cookie 1 equals cookie 2.
IF> - Use this to see if cookie 1 is larger then cookie 2.
IF< - Use this one to see if cookie 1 is smaller then cookie 2.

Things to watch out for:
You can use COMPARE for numbers only! Else it simply won't work, some people forget this sometimes.
Don't forget that WoS needs to read cookies, if you write COMPARE apple, "10" instead of COMPARE #<apple>, "10" this will make a major difference for WoS.
Use the IF commands as I wrote them down, Between the IF and =,> or < may NOT be a space. So either use IF=, IF< or IF> and not IF =, IF < or IF >.
After writing down the IF as it should you always have to follow it up with a link, like @gohere and not gohere Also DON'T put any commas between IF= and @link, most likely WoS won't read the line in that case. A good IF command looks like this:
IF= @link
a completely wrong one like this:
IF =, link
This is one of the most caused bugs when working with cookies and is often one of the hardest bugs to find. Even experienced world developers still have this bug sometimes.

If you like you can also read all this info at http://www.synthetic-reality.com/wosquest.htm#Quest
Sometimes this may be confusing though, so I hope that my examples cleared up some of that confusion. Actually I recommend looking up all the above on that webpage, that's the main source I used to learn how to use everything myself.

Stock cookie list:
Basicly the stock cookie list is a long list with mostly read only cookies made by samsyn. These cookies give all kinds of useful values (numbers/letters) about the scene hosts character, the scene itself, monsters, spells, items, pets, real life time, gender and even the server.

Mostly these cookies are read only, but some of them you can set yourself.
For the full list of stock cookies and which ones you can set I have to refer to http://www.synthetic-reality.com/wosCookies.htm#Stock%20Cookies

Let's see what you can use them for though.

Example:[
You have made a quest and to finish the quest the scene host needs at least 45 Wisdom (more is allowed), a pet of level 70 (can't be higher or lower), full HP, at least half MP, he must be carring lesser then 50,000 GP and it has to be 5 pm in real life.

Nice quest huh? [Razz]

To check if somebody has at least 45 wisdom you'll first have to look up the stock cookie for the scene hosts wisdom, this cookie is called #<num.hostWIS> as you can see in the stock cookie list (the link I gave earlier).
To make it easy on myself I'll just write down the entire thing, with some self study you should be able to figure out what happens where. Read carefully what has to be done and then check what's happening in the script written below.

COMPARE #<num.hostWIS>, "45"
IF= @questpart2
IF> @questpart2
1: I'm sorry but you're not smart enough yet, so you can not do the quest until you gain more wisdom.
END
@questpart2
COMPARE #<num.hostPetLevel>, "70"
IF= @questpart3
1: I'm sorry but your best pet is to high or to low in level. Get it to level 70.
END
@questpart3
COMPARE #<num.hostHP>,#<num.hostMaxHP>
IF= @questpart4
1: I'm sorry but it seems like you don't have full HP right now.
1: Your HP is current #<num.hostHP> HP and it should be #<num.hostMaxHP> HP.
END
@questpart4
SET checkMP, #<num.hostMaxMP>
DIV checkMP, "2"
COMPARE #<num.hostMP>, #<checkMP>
IF= @questpart5
IF> @questpart5
1: I'm sorry but your MP is to low right now.
1: You need to get your MP up to #<checkMP> MP.
END
@questpart5
COMPARE #<num.hostGP>, "50000"
IF< @questpart6
1: I'm sorry but you're carrying to much GP right now.
1: You have to carry lesser then 50,000 GP.
END
@questpart6
COMPARE #<num.timeHour>,"17"
IF= @questpart7
1: I'm sorry but entered this scene at the wrong time, try again later.
END
@questpart7
1: Yay, you're meeting all my requirements to do this quest.
END

Please note that since all my cookies that I used only contain numbers I only have to use the COMPARE command and not the other 2 compare commands.

Morphing into another class:
This seems to give problems to from time to time and you should be able to handle it now if you understand everything I wrote so far, but to show how easy it is to morph I might as well explain it here too. [Smile]

As you know there is a cookie called #<num.hostClass> To morph into a new class you have to set this cookie to a new value (the class ID you want to morph in). All you have to do is:
SET num.hostClass, "5"
and you'll morph into class 5 now. (In levels.txt you have to divide the class ID with 100 to find the actual class ID.)
Please note that you're setting a cookie and not reading it, so don't use SET #<num.hostClass> cause that won't work.


I hope this covered the basics of cookies, so far writing this thing took me 1,5 hour so I think it's time to stop. If you have anymore questions about cookies then please post them in a reply and I'll try to respond a.s.a.p.

Silver

[ 10-18-2003, 01:47 AM: Message edited by: IceFox/ Silver ]

--------------------
Silver
RoT's Homepage - ProxBeta

Posts: 7098 | From: The Netherlands | Registered: May 2002  |  IP: Logged
Sergey
Healthy Member
Member # 3771

Icon 14 posted      Profile for Sergey   Author's Homepage   Email Sergey   Send New Private Message       Edit/Delete Post 
This has got to be one of the more informative posts on this whole forum. [Big Grin]

Mabie now you can show us how to make a script that stops cookie hacking. If someone plans to have cookies, they need to protect the cookies.
In my world I have a bank and its vary easy to get an account with max money in it. And this dose not include the trick where u type a negetive number OR where you type like 25 9's. All people do is hack the cookies [Frown] .

--------------------
Come play Orino! Its fun!
http://www.trisoft.wosaddict.com

Posts: 262 | From: Rochester | Registered: May 2003  |  IP: Logged
§pawn
Healthy Member
Member # 3861

Member Rated:
4
Icon 1 posted      Profile for §pawn   Email §pawn   Send New Private Message       Edit/Delete Post 
I don't need cookies for my world do I? to many worlds get hacked cause of thoose :-P

--------------------
Opinions are like buttholes, everyone has one, but your's stinks!

Posts: 298 | From: Cali4nia | Registered: Jun 2003  |  IP: Logged
EmeraldBlyze
Healthy Member
Member # 4040

Member Rated:
4
Icon 1 posted      Profile for EmeraldBlyze   Author's Homepage   Email EmeraldBlyze   Send New Private Message       Edit/Delete Post 
Man thats alot of writing and I just got home from school...Not a good mix Ill try and read later

--------------------
Blyze: † This life wasn't meant for perfection, instead, it is preparation for it. †

Posts: 419 | From: Melbourne, Australia | Registered: Jul 2003  |  IP: Logged
gametweeka
Moderator
Member # 3456

Member Rated:
4
Icon 12 posted      Profile for gametweeka   Author's Homepage   Email gametweeka   Send New Private Message       Edit/Delete Post 
It's quite possible to make cookies tamper resistant *not tamper PROOF*. For example, say you have a money cookie #<cash>, and an anti-hack cookie #<cashcheck>. Every instance of "cash" being changed with SET, ADD, SUB, etc. you would follow up with #include cashcheckset.txt. Then in cashcheckset.txt file you would make a complex formula that would read #<cash> and SET the resulting #<cashcheck> cookie. This cookie would then be saved as well. Then when the portion of the game you change the amount of your #<cash> you can have #cashcheck.txt take the #<checkcash> cookie and run it through the process in reverse and compare the two...if they don't match, they cheated, they changed the #<cash> cookie and not the #<cashcheck> cookie. I wouldn't advise naming your cookies that obvious either. It's possible.

Imagine you buy an ATM machine in a scene....after you buy it the script SETS some cookies.

SET cash,0
SET cashcheck,0
END

(Thx Masamune for noticing I forgot to mention this part....)

Then you go and use it here in another scene, (say,in your house?)

ATM Machine Example
Silver outta get a kick outta this...or a headache

SCENE whatever
ACTOR 1, "ATM", myactors, 1, 95, 70
@eventActorClick1
1: Welcome %1, your balance is #<cash>
MENU "Deposit=@deposit","Withdraw=@withdraw","Earn Interest=@earn","Exit=@exit"
END
@deposit
1: Amount of deposit? Enter the amount...
SET deposit, "0"
ASK 60
SET deposit, "#<lastAsk>"
COMPARE "#<lastAsk>","#<hostGP>
IF G#<deposit>, @continued
1: Insufficient funds available for deposit.
GOTO @deposit
END
@continued
1: You would like to deposit #<deposit>? YES/NO
IF NO, @no
IF -G#<deposit>, @nogo
1: One moment please...
HOST_TAKE G#<deposit>
#include cashcheck.txt
ADD cash, "#<deposit>"
#include cashcheckset.txt
1: Processing................................
1: Thank you for your deposit.
GOTO @normal
END
@withdraw
1: Amount to withdraw? Enter the amount...
SET withdraw, "0"
ASK 99
SET withdraw, "#<lastAsk>"
COMPARE #<lastask>, 999999999999999
IF=@cheatattempt
COMPARE #<cash>, #<withdraw>
IF> @continuew
IF= @continuew
1: Insufficient funds............. Your current balance is #<cash>.
GOTO @normal
END
@continuew
1: You would like to withdraw #<withdraw> ? (YES/NO)
IF No, @no
1: One moment please.
HOST_GIVE G#<withdraw>
#include cashcheck.txt
SUB cash, #<withdraw>
#include cashcheckset.txt
1: Thank you for using your ATM!
GOTO @normal
END
@no
1: One moment please...
GOTO @normal
END
@nogo
1: Insufficient funds...
GOTO @normal
END
@earn
COUNTDOWN 60
WAIT 60
HOST_GIVE G500
WAIT 1.0
1: Interest Earned!
1:
GOTO @earn
@exit
1: Thank you for using your ATM.
GOTO @normal
END

@cheatattempt
HOST_GIVE T666 ;being a trigger for ban
END


cashcheckset.txt file would read...
SET cashcheck,#<cash>
ADD cashcheck,1492
SUB cashcheck,983
MUL cashcheck,2
SUB cashcheck,36
blah blah blah...much as you like.


cashcheck.txt file would read...
ADD cashcheck,36
DIV cashcheck,2
ADD cashcheck,983
SUB cashcheck,1942
blah blah blah...much as you like in reverse order
COMPARE #<cashcheck>,#<cash>
IF>,@cheatattempt
IF<,@cheatattempt


This should at least inconvenience cheaters since they would have to look at the formula *make it longer* and figure out what to set BOTH cookies to so that they wouldn't be marked a cheat! I just loooooove to make life miserable for cheats!!! [Smile]

[ 08-14-2003, 12:09 AM: Message edited by: gametweeka ]

--------------------
Hi!

Posts: 1000 | From: Indiana | Registered: Feb 2003  |  IP: Logged
MasaMune
Moderator
Member # 2121

Icon 1 posted      Profile for MasaMune   Author's Homepage   Email MasaMune   Send New Private Message       Edit/Delete Post 
PFFFT Gametweeka, you chump, I spotted the bug and you din even say thank you >< pffft.

--------------------
posted 06-29-2003 02:06 PM, (stupid newbie hacker masses!)-Samsyn
Lawlsuit Oekaki | Override Designs

Posts: 1992 | From: Beaverton, OR | Registered: Apr 2002  |  IP: Logged
IceFox/ Silver
Moderator
Member # 2200

Icon 1 posted      Profile for IceFox/ Silver   Author's Homepage     Send New Private Message       Edit/Delete Post 
I'm using something similar as Gametweeka is in my blacksmith script, hiding the actual value in several different cookies helps a little bit, but in the end it's nearly impossible to protect it right.Also if you work with divide you have to be very careful that you only get exact outcomes, cause WoS won't handle stuff like 6.66666 It'll just make it 6. This was one of the reasons I got banned with a legit char by my own scripts.

I did think of a completely new hack proof bank system though, only problem now is t souls and world breaking, but other then that my new bank works perfect. [Big Grin]

My cookie protection systems work mostly well with stock cookies. For example you want to take care somebody can't t soul. The 2 main things that make a char look t souled are its hours and its amount of monster kills. In RoT I made a script that checks somebodies hours and monsters kills compared to their level, if one of those is to low I assume something nasty happened with the char and the char will be banned. In Evergreen I noticed that my suspecions were almost always correct so I think it's pretty safe to ban characters when my scripts spot to low hours or to low monster kills (or both).

Silver

--------------------
Silver
RoT's Homepage - ProxBeta

Posts: 7098 | From: The Netherlands | Registered: May 2002  |  IP: Logged
Lance Maverick
Member
Member # 3895

Rate Member
Icon 1 posted      Profile for Lance Maverick   Email Lance Maverick   Send New Private Message       Edit/Delete Post 
AAAAHHHHHHHHHH!!!!!! Too... many... cookies... sugar content too high! [Eek!] Okay, seriously, that's confusing as all get-out. I think my head might explode if I tried that stuff. [Roll Eyes] Making them hack-resistant/proof is good, but is it worth the trouble? The stuff's making my head spin.

--------------------
I didn't do it!!!

Posts: 11 | From: Ummm.... my house, I hope. | Registered: Jun 2003  |  IP: Logged
IceFox/ Silver
Moderator
Member # 2200

Icon 1 posted      Profile for IceFox/ Silver   Author's Homepage     Send New Private Message       Edit/Delete Post 
Maybe it's a little bit to much info if you try everything at once, you should practice little parts of the bold things and then move up a step when you think you're ready for it.

At least that's what I did when I had to figure out how it all worked, each time I understood a new part I went on to the next till there was nothing more to learn. [Razz]

Ow and believe me it's worth the trouble to protect your cookies, if you don't people will have a real easy time doing illegit stuff and ruin your world. I don't care if they ruin their own fun off line, but I do care if they bring their hacks on line and ruin other peoples fun.

Silver

--------------------
Silver
RoT's Homepage - ProxBeta

Posts: 7098 | From: The Netherlands | Registered: May 2002  |  IP: Logged
gametweeka
Moderator
Member # 3456

Member Rated:
4
Icon 1 posted      Profile for gametweeka   Author's Homepage   Email gametweeka   Send New Private Message       Edit/Delete Post 
I'm going to immortalize this post in a world html file [Smile] Too good to let it go.

--------------------
Hi!

Posts: 1000 | From: Indiana | Registered: Feb 2003  |  IP: Logged
Dan77307018
Veteran Member
Member # 4126

Icon 1 posted      Profile for Dan77307018   Author's Homepage         Edit/Delete Post 
Good idea! Just gotta post here before I save it [Smile]

--------------------
I'm back. For some reason.

Posts: 779 | From: Yes | Registered: Aug 2003  |  IP: Logged
IceFox/ Silver
Moderator
Member # 2200

Icon 1 posted      Profile for IceFox/ Silver   Author's Homepage     Send New Private Message       Edit/Delete Post 
Several other links with useful data I wrote down might be interesting for you guys too:

Shop Explaining
Soul ID protection and ban scripts
Pet Help
Password protected scripts (small note: soul ID protection works a lot better and is more secure.)
Morphing trouble
Soul ID protections (Small note: this explaining is better then that of a previous link in this post.)
Heal Scenes
Giving item N a X amount of times. (Note: This is now outdated because of GIVE Inn.x but the idea behind it might be interesting for other scripts.)
Debuff/ rebuff items (This is more an informative post lol.) [Razz]
@eventActorAttack1 trouble (To summarize that all in short, @eventActorAttack does not work when you don't have a weapon equiped, I think because WoS can't find an item ID, Item ID gets automatically set to the ID from the weapon you used.)

You might have some use of this. [Smile]
That's pretty much all the links I saved since I started helping world developers out. It's sometimes nice to read through and see with what limitations we had to work in the past, like only 1023 item IDs and no GIVE Inn.X

Silver

--------------------
Silver
RoT's Homepage - ProxBeta

Posts: 7098 | From: The Netherlands | Registered: May 2002  |  IP: Logged
gametweeka
Moderator
Member # 3456

Member Rated:
4
Icon 1 posted      Profile for gametweeka   Author's Homepage   Email gametweeka   Send New Private Message       Edit/Delete Post 
Anyone else wanna write a FAQ on a WoS topic? If you do I'll put it in my HowToMakeWorlds World. I already put this in the "custom cookies" section. [Wink] Send me the FAQ saved as a txt file to gametweeka@yahoo.com and I'll post it immidiately and credit you in the world.

--------------------
Hi!

Posts: 1000 | From: Indiana | Registered: Feb 2003  |  IP: Logged
IceFox/ Silver
Moderator
Member # 2200

Icon 1 posted      Profile for IceFox/ Silver   Author's Homepage     Send New Private Message       Edit/Delete Post 
Can Not do you think that will help with the explaining? It'd only make it look a lot harder then it actually is.

If people want to change cookie names for safety reasons regarding modders then they can always do that later, but please note this is an example script and if things don't get explained clearly there then people will only get confused and mess things up, the opposite of what I'm trying to achieve. :-/

I'll get to work to more advanced cookie explainations sometime soon, it's just that it's a very large subject to explain since you can do tons of things with cookies and I'm low on time. [Frown]

Silver

--------------------
Silver
RoT's Homepage - ProxBeta

Posts: 7098 | From: The Netherlands | Registered: May 2002  |  IP: Logged
The Excalibur
Healthy Member
Member # 4473

Member Rated:
2
Icon 1 posted      Profile for The Excalibur   Author's Homepage   Email The Excalibur   Send New Private Message       Edit/Delete Post 
i dont even know what cookies are?

--------------------
My New WoS Website
My Worldwide Website

Posts: 117 | From: England | Registered: Nov 2003  |  IP: Logged
IceFox/ Silver
Moderator
Member # 2200

Icon 1 posted      Profile for IceFox/ Silver   Author's Homepage     Send New Private Message       Edit/Delete Post 
Samsyns explaining about Cookies is:

quote:
SET <cookieName>, <cookieValue>

This command sets the named cookie to the specified value. A cookie is just a named string variable, stored in the scene host's character file. Once set, you can pull a cookie back out of thin air by using the #<...> syntax.


It's a bit hard to explain what cookies exactly are if you really don't have a clue. Basicly cookies is data that can store real time information, like answers that were given to questions, how long it took somebody to solve a quest, how much somebodies strength increased from level 54 to 67. That are just a few examples, cookies can be used for many things and they make my life as a scripter a lot easier. [Cool]

I hope this helped you a bit.

Silver

[ 11-23-2003, 01:07 AM: Message edited by: IceFox/ Silver ]

--------------------
Silver
RoT's Homepage - ProxBeta

Posts: 7098 | From: The Netherlands | Registered: May 2002  |  IP: Logged
Mike Ravenelle
Member
Member # 4478

Member Rated:
4
Icon 3 posted      Profile for Mike Ravenelle   Author's Homepage   Email Mike Ravenelle   Send New Private Message       Edit/Delete Post 
Tweeka im kinda confused with that atm thing can some one put a full working scene of that cuz thatll make me understand it better..lol

--------------------
Mike Ravenelle

Posts: 97 | From: Norfolk,NE | Registered: Nov 2003  |  IP: Logged
Hal
Veteran Member
Member # 1426

Member Rated:
5
Icon 1 posted      Profile for Hal   Author's Homepage   Email Hal   Send New Private Message       Edit/Delete Post 
Hey! I was the person who came up with the world to help people make worlds. I don't even remember what I called it, but it was really cool. Never finished and I reformatted. :-(

Anyways, great FAQ. I think. I really only ever screwed up with syntax. :-P

Oh, and you can do SET #<blah>, 10

It's called arrays. But that's kinda advanced.

--------------------
Any and all velca will be added to your personal hahta in Angamando.

Posts: 711 | From: Chanhassen, Minnesota | Registered: Oct 2001  |  IP: Logged
IceFox/ Silver
Moderator
Member # 2200

Icon 1 posted      Profile for IceFox/ Silver   Author's Homepage     Send New Private Message       Edit/Delete Post 
I tried it tons of times, but that doesn't work.

What does work however is doing this:
SET blah#<blah2>, "10"

You need to use something else before using a cookie else it won't work though, just using SET #<blah>, 10 doesn't work. [Frown]

If it did work it would have made my life a lot easier.

Silver

--------------------
Silver
RoT's Homepage - ProxBeta

Posts: 7098 | From: The Netherlands | Registered: May 2002  |  IP: Logged
EmeraldBlyze
Healthy Member
Member # 4040

Member Rated:
4
Icon 1 posted      Profile for EmeraldBlyze   Author's Homepage   Email EmeraldBlyze   Send New Private Message       Edit/Delete Post 
Before I ask for help -
I'm Back and you wanna know why I left...Because I had loads and Loads of homework I got into The ACE class at school and have been to busy with Final Fantasy and Chrono Cross..and Ice Fox Scared me away with The essay on Cookies....And WoS world making is way way way to confusing I seem to Intertwine tokens and mess everything up... Like You'll be in a fight and you'll beat a boss get given a token then when you reenter it happenes again...But i said IF T5 @scene1 anyway

On Topic
I need help with cookies Ice fox I wanna make a cookie system...Well you tell me if I need cookies to do this.. If youvve played Final Fantasy 9 you'll know about Stallizios if not there are 13 special coins you collect and give to someone to get prizes....I am going to scatter about 20-100 Items called the Feathers of the Eaglet or something like that around my world.....But Do I need cookies or Heaps of tokens? Because when you get a certain number of em i want something to happen.

-Will-

[ 11-27-2003, 05:18 PM: Message edited by: EmeraldBlyze ]

--------------------
Blyze: † This life wasn't meant for perfection, instead, it is preparation for it. †

Posts: 419 | From: Melbourne, Australia | Registered: Jul 2003  |  IP: Logged
Mike Ravenelle
Member
Member # 4478

Member Rated:
4
Icon 1 posted      Profile for Mike Ravenelle   Author's Homepage   Email Mike Ravenelle   Send New Private Message       Edit/Delete Post 
just do this

SCENE 123 blah blah
ACTOR blah blah
IF I1, @I1
1: Please collect these things or w/e
@I1
IF I2, @I2
1: Please collect these things or w/e
END
@I2
IF I3, @I3
1: Please collect these things or w/e
END
@I3
IF I4, @I4
1: Please collect these things or w/e
END


Its a example but ull get th idea..

--------------------
Mike Ravenelle

Posts: 97 | From: Norfolk,NE | Registered: Nov 2003  |  IP: Logged
EmeraldBlyze
Healthy Member
Member # 4040

Member Rated:
4
Icon 1 posted      Profile for EmeraldBlyze   Author's Homepage   Email EmeraldBlyze   Send New Private Message       Edit/Delete Post 
OK....I need an Advance WoS scripting for idiots guide.

--------------------
Blyze: † This life wasn't meant for perfection, instead, it is preparation for it. †

Posts: 419 | From: Melbourne, Australia | Registered: Jul 2003  |  IP: Logged
EmeraldBlyze
Healthy Member
Member # 4040

Member Rated:
4
Icon 1 posted      Profile for EmeraldBlyze   Author's Homepage   Email EmeraldBlyze   Send New Private Message       Edit/Delete Post 
Dont't get me wrong I'm not Dumb its just that WoS is quite confusing specially when scripts go wrong..ESPICIALLY TOKENS!!! *waves fist at Dan " YOu just love making it harder on me Don't you DON'T YOU!

--------------------
Blyze: † This life wasn't meant for perfection, instead, it is preparation for it. †

Posts: 419 | From: Melbourne, Australia | Registered: Jul 2003  |  IP: Logged
EmeraldBlyze
Healthy Member
Member # 4040

Member Rated:
4
Icon 1 posted      Profile for EmeraldBlyze   Author's Homepage   Email EmeraldBlyze   Send New Private Message       Edit/Delete Post 
Also Excuse all the posts. I want the guy to say you have 50 and you have 50 more to go....Does that involve cookies?

--------------------
Blyze: † This life wasn't meant for perfection, instead, it is preparation for it. †

Posts: 419 | From: Melbourne, Australia | Registered: Jul 2003  |  IP: Logged
Durfenity
Healthy Member
Member # 4024

Member Rated:
3
Icon 1 posted      Profile for Durfenity   Email Durfenity   Send New Private Message       Edit/Delete Post 
Have you spend your time taking a look at Evergreen scripts as an example? (RoT and other worlds are advanced scripts)
Posts: 316 | Registered: Jul 2003  |  IP: Logged
Makarei
Verbose Member
Member # 1646

Member Rated:
4
Icon 1 posted      Profile for Makarei   Author's Homepage   Email Makarei   Send New Private Message       Edit/Delete Post 
I thought most worlds would have basic, and advanced scripts. not just one of them..

--------------------
7 Years almost done.

Posts: 1040 | From: Australia | Registered: Dec 2001  |  IP: Logged
IceFox/ Silver
Moderator
Member # 2200

Icon 1 posted      Profile for IceFox/ Silver   Author's Homepage     Send New Private Message       Edit/Delete Post 
quote:
On Topic
I need help with cookies Ice fox I wanna make a cookie system...Well you tell me if I need cookies to do this.. If youvve played Final Fantasy 9 you'll know about Stallizios if not there are 13 special coins you collect and give to someone to get prizes....I am going to scatter about 20-100 Items called the Feathers of the Eaglet or something like that around my world.....But Do I need cookies or Heaps of tokens? Because when you get a certain number of em i want something to happen.

As a dedicated FFF (Final Fantasy Fan) [Razz] I have indeed a FF9 copy here, in fact the original idea for my auction script came from FF9. I never got to collect more then 2 or 3 coins though... Anyways you won't be needing cookies for this script and you only need 13 items (those coins) and perhaps a few tokens.

Basicly your script would look like this:


Info:
I'm only doing 4 coins in this script else it's to much work for a short example, with some experimentating you can figure out the rest yourself.
Using item 301 as coin 1, 302 as coin 2 etc. You should make this soul items and you could write new quests for people to get/ find these coins.



SCENE 500, grass,SCENE, "Coin Man",0,0

ACTOR 1, "Coin Master", coinman, 4, 20,80

IF T401, @didquest
IF T400, @back
1: Hi there, I'm the Coin Master,
1: if you find the 4 hidden coins in this world then I'll give you a special reward!
HOST_GIVE T400

@back
1: Hey you're back...
1: Let me see if you got all 4 coins already.
WAIT 5.0
IF I301+I302+I303+I304, @coins
1: Hey man!
1: Don't be pulling weird tricks on me!
1: You don't have all 4 coins yet, don't get back here unless you do.
END
@coins
1: Great!
1: You got all coins!!
WAIT 3.0
N: The Coin Master takes your 4 coins...
HOST_TAKE I301
HOST_TAKE I302
HOST_TAKE I303
HOST_TAKE I304
1: Alright, fair is fair, here is your reward.
WAIT 3.0
N: You learnt %S600!
HOST_GIVE S600
HOST_GIVE T401
1: Time for me to enjoy my nifty lookin' coins.
1: See you later %1
MOVE 1,-20,80
END
@didquest
1: Hey %1, thanks for giving me those coins.
END

I hope I kept it easy enough to understand. [Smile]

Makarei, worlds have simple, normal and advanced scripts mostly. RoT isn't all uber 1337 scripting lol, it'd probably give me a large headache if I would only make advanced scripts. However if you make scripts more complicated you can also make them shorter usually (that's pretty much the reason you make them complicated in the first place).

Some of you may know my item tracer script, to find 1 item in a world by it's name I only need like 38 script lines in total now and I can very easily expand the script to search for 10k items instead of 100 items but just changing 1 number. Imagine I had to write out the entire script to search through every item without cookies... Can you imagine it? Good, well now try imagining to upgrade that script to find 10,000 extra items by their name. (I know the item limit is 5119 in WoS, but if it was more it'd require a lot more scripting too.) You'll probably get the idea... about 4 lines per items would make the script at least 40,000 lines long.
Personally I rather go for 36 lines in that case. [Razz]

You can basicly script most things without cookies, but if you want to make your life easier then cookies can be really useful at times. [Cool]

Silver

[ 11-29-2003, 12:53 PM: Message edited by: IceFox/ Silver ]

--------------------
Silver
RoT's Homepage - ProxBeta

Posts: 7098 | From: The Netherlands | Registered: May 2002  |  IP: Logged
Sir Mj
Obsessive Member
Member # 4642

Member Rated:
3
Icon 14 posted      Profile for Sir Mj     Send New Private Message       Edit/Delete Post 
Silver's advice is on the money here, however, If you wanted to enable the scene NPC to "update" the player as to what items/coins/whatever they still need, using cookies would be best to keep it simple and cut down on the total script size.

There is no reason to feel bad for anyone who has trouble understanding cookies when they begin using them. As the experts have already said you will understand them better as you use them more.

In just a few months of study and practice I myself went from having ZERO knowledge of anything regarding scripting to writing a script that I believe will earn me a promotion from n00b world developer to dabbling world developer....I can only hope tho right? [Razz]

--------------------
Come ride with me through the veins of history,
I'll show you how god falls asleep on the job.

Posts: 5438 | Registered: Dec 2003  |  IP: Logged
Devil Hunter
Member
Member # 4660

Member Rated:
4
Icon 1 posted      Profile for Devil Hunter   Author's Homepage   Email Devil Hunter   Send New Private Message       Edit/Delete Post 
I seem to have got through world development without making any cookies (if i have, ive been totally oblivious to it) Does not having cookies make your world bad?

--------------------
If there are other worlds out there... Then our's is just a small piece of something much greater

Posts: 53 | From: UK | Registered: Jan 2004  |  IP: Logged
ML4 creator
Healthy Member
Member # 4011

Member Rated:
4
Icon 1 posted      Profile for ML4 creator   Author's Homepage   Email ML4 creator   Send New Private Message       Edit/Delete Post 
hmmm...
/a suddenly realizes the potential of silver's item tracer...

Silver, could you please post that script or email it to me? It would be really useful. Can it be adapted for spells too? Also, can it put a number in a cookie and then give the item of that number?

--------------------
Viva La Resistance!

Posts: 411 | From: The Realm of Chaos | Registered: Jul 2003  |  IP: Logged
ML4 creator
Healthy Member
Member # 4011

Member Rated:
4
Icon 1 posted      Profile for ML4 creator   Author's Homepage   Email ML4 creator   Send New Private Message       Edit/Delete Post 
I have scripted so many things without cookies. I just did my first script WITH me putting in cookies. It is an All-New, Made-From-Scratch Random Placement Script!! Okay, so someone's probably already written a similar one [Roll Eyes] , but here's what mine does:

1: Gives you some stats on your character(testing whether or not i could do the cookie thing. it worked, so i left it in there)
2: Detects whether you are on the 1337 world dev team [Big Grin] (My first team effort on a WoS world!)
3: Detects if you are banned [Razz]
4: If you are not 1337 or banned, it sends you to one of the first 20 links on one of the first 3 maps.

Is that 1337 or what?!!? now to find out if they are gonna use it or not... [Roll Eyes]

BTW, NOT having any cookies in your world does NOT make it bad.

[ 01-07-2004, 09:59 AM: Message edited by: ML4 creator ]

--------------------
Viva La Resistance!

Posts: 411 | From: The Realm of Chaos | Registered: Jul 2003  |  IP: Logged
Sir Mj
Obsessive Member
Member # 4642

Member Rated:
3
Icon 1 posted      Profile for Sir Mj     Send New Private Message       Edit/Delete Post 
That is indeed a cool script ML4, but the random warp part sounds alot like the random warp link in RoT.

--------------------
Come ride with me through the veins of history,
I'll show you how god falls asleep on the job.

Posts: 5438 | Registered: Dec 2003  |  IP: Logged
IceFox/ Silver
Moderator
Member # 2200

Icon 1 posted      Profile for IceFox/ Silver   Author's Homepage     Send New Private Message       Edit/Delete Post 
quote:
Silver, could you please post that script or email it to me? It would be really useful. Can it be adapted for spells too? Also, can it put a number in a cookie and then give the item of that number?


Actually...

The item tracer still needs to get updated to allow more search functions, I did indeed already make a spell tracer script too! [Big Grin]
The spell tracer works really well and is pretty cool.
I also want to add a monster tracer script.

All of it will be included in proxbeta v2.1
Right now the latest proxbeta version that's published is proxbeta v1.8

You can download it here: http://members.home.nl/epsilon5/proxbeta_v1.8.zip

Compared to the newest proxbeta version (v2.0) this version is really crappy, but the item and spell tracer work pretty well. The newest versions are a lot more user friendly but I haven't had time yet to update proxbeta and allow even more commands (for example setting scene flags too).

Once I added the monster tracer, updated item tracer and added the other commands I wanted to add several months ago already I'll publish the newest version. I'm glad people are still showing intrest in it, it takes quite some time to update all of it since I'm so low on time always. [Frown]

Silver

[edit]
quote:
BTW, NOT having any cookies in your world does NOT make it bad.

I completely agree with that. In my first scripts I never used any cookies and could do almost just as much, it usually just takes more time to get things done though and scripts will become larger. Cookies are more complicated but can make scripts a lot shorter, however you can do just as much without cookies.
When I started world developing I learnt everything except cookies, I saved those for last. When I finally managed to do all scripts pretty well and memorized most of those script commands I started to learn more about cookies and thanks to Corpse Collector and Dazman I eventually understood what cookies truly are about. Since then I love them, but before then I really hated them since they were so confusing first.

That's also one of the reasons for this topic, trying to learn others how to work with cookies, what to do and what not to do. [Smile]

[ 01-08-2004, 02:21 AM: Message edited by: IceFox/ Silver ]

--------------------
Silver
RoT's Homepage - ProxBeta

Posts: 7098 | From: The Netherlands | Registered: May 2002  |  IP: Logged
Tamriel
Healthy Member
Member # 4758

Member Rated:
4
Icon 1 posted      Profile for Tamriel   Author's Homepage   Email Tamriel   Send New Private Message       Edit/Delete Post 
I have a question about cookies. For example, if I wanted to make an inn scene where the innkeeper gives you a price based on the number of people in the scene, would I be able to do something like this?:
code:
  
SCENE 100 stuff, "The Inn", 0, 0
ACTOR 1, "John the Innkeeper", Johnny, 1, 71, 17
SET innprice, 30
MUL innprice, num.peopleinscene
1: Greetings, %1, the price for your party of #<num.peopleInScene> to stay one night is #<innprice>.
1: Will you stay the night?
ASK 32000

Would those cookies work or would I have to revise anything?

[ 07-05-2004, 04:31 PM: Message edited by: IceFox/ Silver ]

--------------------
Best. Website. Evar?
JapaneseLearning.com- Learn Japanese, and about the Japanese culture, for free.

Posts: 402 | From: Seoul, South Korea | Registered: Jan 2004  |  IP: Logged
ML4 creator
Healthy Member
Member # 4011

Member Rated:
4
Icon 1 posted      Profile for ML4 creator   Author's Homepage   Email ML4 creator   Send New Private Message       Edit/Delete Post 
methinks it should be this instead, but someone let me know if i'm wrong...

code:
 MUL  innprice, #<num.peopleinscene> 

instead of:

code:
 MUL  innprice, num.peopleinscene 

but that's just what i think... [Wink]

--------------------
Viva La Resistance!

Posts: 411 | From: The Realm of Chaos | Registered: Jul 2003  |  IP: Logged
Tamriel
Healthy Member
Member # 4758

Member Rated:
4
Icon 1 posted      Profile for Tamriel   Author's Homepage   Email Tamriel   Send New Private Message       Edit/Delete Post 
Yeah, it was. My final script ended up looking like this:
code:
SCENE 100 Bedroom,SCENE,"The Adventurer's Inn"
ACTOR 1, "Ralph the Innkeeper", joshTownsfolk, 9, 17, 71
SET innprice, 30
SET people, #<num.PeopleInScene>
MUL people, #<innprice>
IF DEAD, @Dead
@alive
1: Hello, your party of #<num.PeopleInScene> can stay the night for #<People> Septi.
1: Would you like to stay?
ASK 32000
IF YES, @Yes
1: Please come again.
END
@Yes
IF G#<People>, @canAfford
1: I'm sorry, but you don't seem to have enough money.
@CanAfford
1: Thank you. Rest well.
WAIT 3
HOST_TAKE G#<People>
GIVE H1
GIVE H32000
GIVE M32000
END
@Dead
1: Hmm.. You seem to have been seriously wounded in battle.
1: Let me take care of that for you...
WAIT 2
GIVE H1
1: All better!
GOTO @Alive
END

Thanks for replying though, I ended up figuring it out myself, but I figured I'd ask on this forum first, since the point of this IS to help others out.

[edited out the stretching... - Silver]

[ 07-05-2004, 04:33 PM: Message edited by: IceFox/ Silver ]

--------------------
Best. Website. Evar?
JapaneseLearning.com- Learn Japanese, and about the Japanese culture, for free.

Posts: 402 | From: Seoul, South Korea | Registered: Jan 2004  |  IP: Logged
Darangen
Compulsive Member
Member # 780

Icon 1 posted      Profile for Darangen   Email Darangen   Send New Private Message       Edit/Delete Post 
Another thing you might want to change is your

GIVE H1 [Razz] .

If you want to revive them, it's

GIVE Ln.

~Darangen~

[EDIT]

Also, you COULD shorten the code by replacing this:

SCENE 100 Bedroom,SCENE,"The Adventurer's Inn"
ACTOR 1, "Ralph the Innkeeper", joshTownsfolk, 9, 17, 71
SET innprice, 30
SET people, #<num.PeopleInScene>
MUL people, #<innprice>

With this:

SCENE 100 Bedroom,SCENE,"The Adventurer's Inn"
ACTOR 1, "Ralph the Innkeeper", joshTownsfolk, 9, 17, 71
SET innprice, 30
MUL innprice, #<num.PeopleInScene>


It only gets rid of one line of code, but it's an alternative you could use [Razz] .

~Darangen~

[ 01-30-2004, 12:57 PM: Message edited by: Darangen ]

--------------------
It's ok, I like girls.
Lea, a world in development.

Posts: 2464 | From: Not of this world | Registered: Mar 2001  |  IP: Logged
ML4 creator
Healthy Member
Member # 4011

Member Rated:
4
Icon 1 posted      Profile for ML4 creator   Author's Homepage   Email ML4 creator   Send New Private Message       Edit/Delete Post 
the cookie junk i know that sorta hasnt been discussed:

SET cookie, #<cookie2>

okay. now, when setting cookies, you dont need the thingys on the first one. however, when setting a cookie from a cookie, you need the "value of" symbols ( #<> , as in #<cookie2> means, "the value of the cookie called 'cookie2'")
so that it doesnt set #<cookie> = "cookie2"

when multiplying, dividing, adding, or subtracting, the same rules apply.

--------------------
Viva La Resistance!

Posts: 411 | From: The Realm of Chaos | Registered: Jul 2003  |  IP: Logged
Avelon Hellfyre
Healthy Member
Member # 3600

Member Rated:
2
Icon 1 posted      Profile for Avelon Hellfyre   Author's Homepage   Email Avelon Hellfyre   Send New Private Message       Edit/Delete Post 
[Eek!] Wow, nice FAQ you have going here, Silver! I guess I'll throw in my 2˘ worth. =)

There's 1 other opCode for cookies that isn't listed above anywhere. Think of it as being most like DIVide...

Modulus (short: MOD) is used to find the remainder of a cookie when you divide it by the argument you specify.

SET mod1, 22
MOD mod1, 10
1: #<mod1> should now equal 2.

In this case, 10 is the argument you specified. You're probably wondering now what use this has. I'll just give you an example.

SET mod1, 73
SET mod2, 73
DIV mod1, 10
MOD mod2, 10
ADD mod1, #<mod2>
1: #<mod1> should now equal 10.

In this case, you have two cookies that are equal. You DIV the first by 10 (the result being 7.3), but WoS doesn't *do* decimals. So the outcome is 7. The second you MOD by 10...

What happens here is 10 goes into 73 as many times as it can (7) and then saves the remainder (3).

So now you have #<mod1> (7) and #<mod2> (3). Adding them together gives you 10. Funky, eh? I plan on making full use of MOD in my project. [Cool]

--------------------
"I'm afraid you cannot enter with your weapons," the gate guard said. Avelon looked deep into the guard's eyes, was silent for a moment. He softly replied, "My blade? It is no weapon. It is a tool. I am the weapon."

Posts: 106 | From: the second star on the right and straight on 'til morning | Registered: Mar 2003  |  IP: Logged
IceFox/ Silver
Moderator
Member # 2200

Icon 1 posted      Profile for IceFox/ Silver   Author's Homepage     Send New Private Message       Edit/Delete Post 
Yeah, it wasn't till a few months later that I saw MOD was on the list too when I was updating proxbeta, but I couldn't bother to update the FAQ here, so thanks for taking the trouble to explain it to everybody. [Smile]

If you want I'll include your post in the first topic (and add the proper credits for you off course.) [Cool]

I always said this is our forum and not just mine. [Razz]

Silver

[ 04-22-2004, 12:10 PM: Message edited by: IceFox/ Silver ]

--------------------
Silver
RoT's Homepage - ProxBeta

Posts: 7098 | From: The Netherlands | Registered: May 2002  |  IP: Logged
  This topic comprises 3 pages: 1  2  3   

Quick Reply
Message:

HTML is not enabled.
UBB Code™ is enabled.

Instant Graemlins
   


Post New Topic  New Poll  Post A Reply Close Topic   Unfeature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Synthetic Reality

Copyright 2003 (c) Synthetic Reality Co.

Powered by UBB.classic™ 6.7.3