PDA

View Full Version : Question about the Random parameter



UnknownMaster21
February 24th, 2015, 15:57
Will this work?


ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,RANDOM,-2,5,10,0)


CREATE_PARTY(RANDOM)
ADD_TO_PARTY(RANDOM,RANDOM,RANDOM,0,ATTACK_DUNGEON _HEART,0)
ADD_TO_PARTY(RANDOM,RANDOM,RANDOM,0,ATTACK_DUNGEON _HEART,0)
ADD_TO_PARTY(RANDOM,RANDOM,RANDOM,0,ATTACK_DUNGEON _HEART,0)
ADD_TO_PARTY(RANDOM,RANDOM,RANDOM,0,ATTACK_DUNGEON _HEART,0)
ADD_TO_PARTY(RANDOM,RANDOM,RANDOM,0,ATTACK_DUNGEON _HEART,0)
ADD_TO_PARTY(RANDOM,RANDOM,RANDOM,0,ATTACK_DUNGEON _HEART,0)
ADD_TO_PARTY(RANDOM,RANDOM,RANDOM,0,ATTACK_DUNGEON _HEART,0)

As I tried, nothing happened really... did I made something wrong or, what?

YourMaster
February 24th, 2015, 16:54
The add_to_party command does not accept random creatures.

Also, you try to spawn a party with an 'add_creature_to_level' command.

This works:
CREATE_PARTY("RANDOM")
ADD_TO_PARTY("RANDOM",MONK,RANDOM(1,10),0,ATTACK_DUNGEON_HEART,0)

ADD_PARTY_TO_LEVEL(PLAYER_GOOD,"RANDOM",1,1)

UnknownMaster21
February 24th, 2015, 17:29
Yeah, good! Doing final missions of oncoming campaign. Bonus levels needs to be a random thingy

OFFTopic:
I have downloaded latest patch and... I think now my campaign is impossible!!! Everything changed up!

But no worries, I make a fix

I had used nb 1456, now nb 1604

YourMaster
February 24th, 2015, 17:40
What changed in those versions that made an impact for you?

There are quite a few random things possible, for example:

* Random amount of creatures available
* Random rooms available
* Random party drop locations
* Random sizes of hero parties
* Random timings on triggers
* Random levels of creatures

UnknownMaster21
February 24th, 2015, 17:47
Maybe it was an imagination but quick_information blinks now.

Is there a link where to see a log about what is changed in what patch?

Is there anything changed about computer behaviour? Maybe it is only me, but computer reacts much "smoother" and more effectively

more than 130 patches upgraded, there must be something changed


EDIT: Nevermind, found it... Never even seen this one before


EDIT: Horny is nerfed and CP casts CTA spell more properly. This is the reason, why maps goes nearly impossible. I have created mapplay wrongly. Have to fix it.

Woudo
February 25th, 2015, 07:14
I remember you saying once that when a value had been chosen at random, it would stay the same for the remainder of the level. Is that still the case?

mefistotelis
February 25th, 2015, 07:31
Yes, RANDOM values are selected once at start.

Also, if you want to select random item from a list (ie. creature model) - use just "RANDOM"; for numbers (ie. level) you must provide range (ie. "RANDOM(1,10)").

YourMaster
February 25th, 2015, 10:07
Maybe it was an imagination but quick_information blinks now.

Is there a link where to see a log about what is changed in what patch?

Is there anything changed about computer behaviour? Maybe it is only me, but computer reacts much "smoother" and more effectively

more than 130 patches upgraded, there must be something changed


EDIT: Nevermind, found it... Never even seen this one before
EDIT: Horny is nerfed and CP casts CTA spell more properly. This is the reason, why maps goes nearly impossible. I have created mapplay wrongly. Have to fix it.

Yes, 130 changes, but there are not that many that affect game-play. But indeed, Horny has been nerfed back a bit, there was a recent change that made him far to powerful(One horny could almost solo an avatar), that has been brought back in line. Horny is still far more powerful now than in basis 0.4.5 and at level 10 over 10 times more powerful than he was at level 10 in vanilla keeper.

CP using CTA now is indeed very different, it is great and results in the CP now sometimes actually attacking the player. Unfortunately at the moment he still doesn't quite know when to turn CTA off.

Unread quick_information messages now blink, yes, just like they did the original game and just like display_information messages. They stop blinking when you read them.

Here is the full changelog: https://code.google.com/p/keeperfx/source/list


Yes, RANDOM values are selected once at start.

Also, if you want to select random item from a list (ie. creature model) - use just "RANDOM"; for numbers (ie. level) you must provide range (ie. "RANDOM(1,10)").

You do know right that in many cases where you use "RANDOM" for a creature it gives an error wanting more parameters?

For example, these don't work:

ADD_TO_PARTY(HELLO,RANDOM,10,0,ATTACK_DUNGEON_HEAR T,0)
KILL_CREATURE(​PLAYER0,RANDOM,MOST_EXPERIENCED,� ��1)

dayokay
February 25th, 2015, 18:54
I think we need a way to randomly 'kill' creatures, as a tool for preventing too many creatures from inhabiting a map. Some mechanism that allowed the weakest or lowest ranking creatures to be chosen first maybe? Probably a new script instruction?

Also, there was talk of a dynamically random variable being added, so we could have multiple random values within a script? While I'm greedy, how about universal flags that exist within a campaign instead of a single map? So events in map2 can be influenced by what you did in map1?

dayokay

mefistotelis
February 25th, 2015, 22:59
You do know right that in many cases where you use "RANDOM" for a creature it gives an error wanting more parameters?

Ok, now I know.
Yes, I can see how the implementation is wrong.