Alias Type Error
Posted: 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:
This is my sparkle_to_faerie alias:
This is my faerie_to_sparkle alias:
Can someone help with this? Thank you very much.
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!");
Code: Select all
var p = gwc.userdata.paths;
p.go(p.sparkle_to_faerie);
Code: Select all
var p = gwc.userdata.paths;
p.go_back(p.faerie_to_sparkle);