ID:1711544
 
(See the best response by Gokussj99.)
So, first off, I made an enemy that has a certain amount of health in my main script. Now, I want to make more than one enemy.. but when I kill the other enemy, it has the same amount of health for the next enemy. Basically, how can I make multiple NPCs have different health?
Best response
Override their New(). And use rand to set their health upon creation. Or make new instances of them with your map editor and change their health variables.

EDIT: Oh and I forgot you can use pick() if you don't want random values.
I personally make a variable and add to it every time a mob is killed, then add that number to the stats on newly spawned mobs, which causes the game to consistently get harder. There's many ways you can achieve effects like this.
In response to Gokussj99
Gokussj99 wrote:
EDIT: Oh and I forgot you can use pick() if you don't want random values.

pick proc
Returns: One of the given values randomly chosen.

Well, at least you tried.
You can set it to have an increased or decreased chance of choosing the variables. Plus, pick involves a list the developer chooses, making a random choice out of a set list of non-random values. Making the result favorable compared to a completely random value between two values, chosen by rand().
In response to Lightwell
Lightwell wrote:
Gokussj99 wrote:
EDIT: Oh and I forgot you can use pick() if you don't want random values.

pick proc
Returns: One of the given values randomly chosen.

Well, at least you tried.

I was comparing rand() to pick() rand returns a total random value between 2 numbers I meant non random as you enter exact numbers into pick() ex: pick(1,6,4) which will return one of those values.

Gokussj99 still thinks:
EDIT: Oh and I forgot you can use pick() if you don't want random values.

pick proc
Returns: One of the given values randomly chosen.

So you basically say that if I DON'T want random values I should use method that DOES return random values.
Well that is an interesting approach! I wish you the best of luck using this method.
In response to Lightwell
pick() is a random choice from a set list. rand() is s random number between two set points, you have some control of the result in pick().
Yeah, but I just don't understand one thing: When I explicitly don't want random values should I still use pick() ?

Gokussj99 wrote:
EDIT: Oh and I forgot you can use pick() if you don't want random values.

This is certainly something that most programmers should focus on. Please explain this more in depth.

Oh, and also I'd like to thank you! People like you, helping beginners and only wanting these imaginary points in exchange, really make this place so much better.

Thanks @NNAAAAHH and @Gokussj99 ! Best helpers! Ever!
In response to Lightwell
Now I am helping people for points? That's cool.

It's not our fault you don't understand pick() not being random in the same way as rand(). Please, feel free to open your own topic to settle this matter, so to make it simpler for anyone else like you to find information on the issue you're presenting. Thank you.
I can see that one of us don't understand pick() and I know that it is not me.
Why are you even talking on forums if you can't explain yourself?
And also stop ignoring my main questions.
In response to Lightwell
I'm sorry your experience here has been unpleasant. I must be missing your question, please repeat in a clear manner what you are asking. Preferably, as stated, in your own topic, since it is unrelated to the OP's question.
Ok :D

My Question is:
When I explicitly don't want random values should I still use pick() ?

as Gokussj99 wrote:
EDIT: Oh and I forgot you can use pick() if you don't want random values.

Thanks in advance! ^^
In response to Lightwell
pick() returns a random value out of a list you present it, so if you distinctly want a set variable, please avoid pick(). However, pick() allows you to specify the probability of each entry you present it. This allows for more of a controlled random.
Lightwell if you have nothing to contribute other than pointing out my poor wording begone sir. I can see how it may have been confusing for new developers. I certainly in the future will try to elaborate more clearly.