Alias Type Error

Need help with quests? Maybe just some advice on which guilds to choose? This is the forum for you. Note that you must be a validated player to view this forum. (Note: Quest help should come in the form of helpful suggestions/hints, but not direct solutions/walkthrough info.)
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Post Reply
Lelouch
Novice
Posts: 2
Joined: 31 May 2016 03:41

Alias Type Error

Post by Lelouch » 29 Jun 2016 21:12

Hello, I'm new to the forums and game, so if this falls under "sensitive game information," sorry, I didn't mean to.
Well, recently I've tried out the paths alias that is written in the guide on the website. The code I have is directly copied and pasted from the guide, but when I added a new path, there was a problem. The orcs to shop path in the guide worked both ways, but when I made a path from sparkle to faerie, the "sparkle_to_faerie" command worked fine, but faerie_to_sparkle didn't work. When I typed in "faerie_to_sparkle", the system said the following:
Error in alias TypeError: Cannot read property 'reverse' of undefined

Now, the path is correct, since I could travel from sparkle to faerie without a hitch, but the reverse didn't work for some reason. This is my code for update_paths:

Code: Select all

gwc.userdata.paths = {
shop_to_orcs:[
'n','w','w','w','n','n','w','w','w',
'w','w','w','w','w','w','w','w','w',
'n','w','w','n','n','n','n','n'
],

sparkle_to_faerie:[
'w','n','n','w','w','w','w','w','w',
'w','w','w','w','w','w','w','w','w',
'sw','s','s','sw','w','sw','sw','sw',
's','se','s','se','e','se','se','se',
'se','e','e','se','se','e','se','se'
],

reverse : {
'n':'s', 's':'n', 'e':'w', 'w':'e',
'nw':'se', 'ne':'sw', 'sw':'ne', 'se':'nw',
'u':'d', 'd':'u', 'in':'out', 'out':'in'
},

go:function(path) {
path.forEach(function(step) {
gwc.connection.send(step);
});
},

go_back:function(path) {
path.reverse();
path.forEach(function(step) {
step = gwc.userdata.paths.reverse[step];
gwc.connection.send(step);
});
}
};
gwc.output.append("Your paths have been updated!");
This is my sparkle_to_faerie alias:

Code: Select all

var p = gwc.userdata.paths;
p.go(p.sparkle_to_faerie);
This is my faerie_to_sparkle alias:

Code: Select all

var p = gwc.userdata.paths;
p.go_back(p.faerie_to_sparkle);
Can someone help with this? Thank you very much.

User avatar
Gronkas
Beginner
Posts: 14
Joined: 09 Jun 2016 14:33
Location: Sparkle

Re: Alias Type Error

Post by Gronkas » 30 Jun 2016 00:31

Took me a while to spot, you probably found the error yourself by now.

The definition for the faerie_to_sparkle alias needs to be:
Code:
var p = gwc.userdata.paths;
p.go_back(p.sparkle_to_faerie);


the p.go_back will reverse the path, but of course you only defined the sparkle_to_faerie path in the upgrade_paths alias - which
is the one you plan to reverse.

So only the alias is called "faerie_to_sparkle", the path inside is "p.go_back(sparkle_to_faerie)"

User avatar
Melarec
Rising Hero
Posts: 318
Joined: 29 Feb 2016 19:51
Location: Everywhere
Contact:

Re: Alias Type Error

Post by Melarec » 30 Jun 2016 01:31

I just use my numpad.
;-;

Orien
Apprentice
Posts: 42
Joined: 10 Jun 2016 17:08

Re: Alias Type Error

Post by Orien » 30 Jun 2016 08:47

Tips: Change "update_path" to "z", "sparkle_faerie" to "sun_tree", well Orien obsesses with typeless and no-spam. You need to update your path after using too, if not your path will gone mess

Example: Normal path: e e n n w w s s Normal reverse: n n e e s s w w
Mess reverse: w w s s e e n n
Image

Orien are cute (Cool too) kender, if ya disagree with Orien, Orien agree with ya, Orien loves all ^bounce^

Lelouch
Novice
Posts: 2
Joined: 31 May 2016 03:41

Re: Alias Type Error

Post by Lelouch » 01 Jul 2016 19:28

Thanks, I'm not that good with coding (if not a complete newbie), I just understand the basic theory behind what a code means. So errors like this I can't really spot. I see the mistake now, though. Thanks for the help once again!

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/