My Try:
var/MinX=10
var/MaxX=100
var/MinY=10
var/MaxY=100
loc=locate(rand(MinX,MaxX),rand(MinY,MaxY),2)
Any ideas?
ID:155355
Jul 23 2011, 6:38 am
|
|
what would be the best way to make the location pick from 2 variables?
My Try: var/MinX=10 Any ideas? |
In response to Lugia319
|
|
Lugia319 wrote:
> mob I'm not entirely sure what you mean but this is one way that I'd try to do it. This is the base for my spawning proc, modified it can teleport you within any region you wish. this isnt even close to what i mean... i mean proc/TornamentStartProc() |
In response to XxLucifersJesterxX
|
|
Calm down. The problem is you have the pick return a text string and your switch checks for a number.
|
In response to Lugia319
|
|
Lugia319 wrote:
Calm down. The problem is you have the pick return a text string and your switch checks for a number. Calm down? i was jsut correcting you -.-;... Anyway, Example please? |
In response to XxLucifersJesterxX
|
|
No example for you. You can figure this one out, it's very simple. Here's your answer in the form of a hint.
"1" != 1 |
In response to Lugia319
|
|
Lugia319 wrote:
No example for you. You can figure this one out, it's very simple. Here's your answer in the form of a hint. Nice way to be one of the rather useless people on BYOND, guess ill wait for Gakumerasara to get on or for someone else to actually decide to HELP instead of say whats wrong. |
In response to XxLucifersJesterxX
|
|
XxLucifersJesterxX wrote:
Lugia319 wrote: If all you want is someone to write code for you, I suggest you hire a programmer. Lugia has explained what is wrong quite adequately. You will learn by working to solve a problem. You will not learn by copy-pasting. I will further demonstrate Lugia's point, in DM: var/a = "1" |
In response to Murrawhip
|
|
Murrawhip wrote:
XxLucifersJesterxX wrote: > var/a = "1" i wasnt asking for someone to write code i was asking for what you did, AKA, an example so i can SEE what ive doen wrong, not an explanation of what i did that leaves me clueless. |
In response to XxLucifersJesterxX
|
|
That was a rather rude way to talk to someone trying to help.
What Lugia319 is saying is that your procedure is botched because of the way you have your switch() proc. proc/TornamentStartProc() The root of the problem is this line.
Your pick() will return "1","2","3", or "4" However! You switch() doesn't have a return for any of those values! Here's what you have, switch(WarMap) I believe the point Lugia319 was trying to make was right there. And that was the root of the "hint." "1" is not the same as 1. 1 is a number, and "1" is a text string. Your switch checks for a number, while the value itself is a text string! |
In response to XxLucifersJesterxX
|
|
XxLucifersJesterxX wrote:
i wasnt asking for someone to write code i was asking for what you did, AKA, an example so i can SEE what ive doen wrong, not an explanation of what i did that leaves me clueless. Clearly by posting in reply to your thread, Lugia's only intention is to help you. If you didn't understand his example of what you were doing wrong, you should probably have asked for further clarification instead of being rude. Lugia319 wrote: "1" != 1 Is a notation that would be familiar to many programmers. It says that the string 1 is-not-equal to the number 1. |
In response to XxLucifersJesterxX
|
|
I've always found Lugia rather helpful, he was only telling you in the form of a hint because of how obvious your problem was.
|
In response to XxLucifersJesterxX
|
|
Lugia gave you exactly what you needed, you only had to ponder what ! meant in programming
example if(!src.complete) meaning not complete. |
I'm not entirely sure what you mean but this is one way that I'd try to do it. This is the base for my spawning proc, modified it can teleport you within any region you wish.