|
|
|
|
| Map Development Discuss your developing maps. Release beta tests and get useful feedback before the final release. If your map is fully complete or is a late Beta, then it can be uploaded directly to our Maps Section. Otherwise, attach the map to your post. This is NOT a forum to ask questions about the Editor! |
 |
10-19-2005, 02:01 AM
|
#1 (permalink)
|
|
User
Join Date: Aug 2005
Posts: 13
|
WC3's Random Number Generator
I'm having a hard time using WC3's random number generator. Everytime I test the map, it spurts out the same numbers, and therefore the same results. I've re-written my triggers 3 times, and it has become clear that they are not to blame.
The map used to be quite random. Does anyone have any ideas about what might cause this? I can post the triggers, but I don't think they caused it.
|
|
|
10-19-2005, 04:18 AM
|
#2 (permalink)
|
|
User
Join Date: Dec 2004
Posts: 181
|
It just happnes.. happened to me many times to. Just like random names on heroes get's the same! It's somthing with the test map in editor, i dosent happen when u play map for real! :lol:
__________________
|
|
|
10-19-2005, 04:28 AM
|
#3 (permalink)
|
|
Former Wc3sear.ch Administrator
Webmaster's Council
Join Date: May 2004
Posts: 3,175
|
That only happens when you play the map through the "test map" feature in the world editor. It will always generate the same variables, even if random. If you really want to test triggers with random variables/numbers, play the map normally by opening wc3 and selecting the map in-game.
-VGsatomi
__________________
|
|
|
10-19-2005, 12:27 PM
|
#4 (permalink)
|
|
User
Join Date: Aug 2005
Posts: 13
|
Quote:
|
Originally Posted by VGsatomi
That only happens when you play the map through the "test map" feature in the world editor. It will always generate the same variables, even if random. If you really want to test triggers with random variables/numbers, play the map normally by opening wc3 and selecting the map in-game.
-VGsatomi
|
No, I was playing normally, not thru the test map feature.
|
|
|
10-19-2005, 01:39 PM
|
#5 (permalink)
|
|
I invoke thee
Join Date: Jul 2005
Posts: 1,082
|
You can turn off generating constant random numbers in editor. Go to File -> Preferences, then to Map testing (or something near, I have localized Wc3) tab and uncheck "Use blahblahblah".
|
|
|
10-19-2005, 04:57 PM
|
#6 (permalink)
|
|
Former Wc3sear.ch Administrator
Webmaster's Council
Join Date: May 2004
Posts: 3,175
|
Well, again, thats a world editor feature.
Quote:
|
No, I was playing normally, not thru the test map feature.
|
If its happening in game after launching normally, then something is messed up with your triggering. Try posting the triggers.
-VGsatomi
__________________
|
|
|
10-19-2005, 09:01 PM
|
#7 (permalink)
|
|
User
Join Date: Aug 2005
Posts: 13
|
Quote:
|
Originally Posted by VGsatomi
If its happening in game after launching normally, then something is messed up with your triggering. Try posting the triggers.
-VGsatomi
|
I'm pretty sure it's not the triggers, but I shall post them. There are 10 triggers (One for every player in the map). They are slightly different, but they all follow this basic code, shown below.
Events
: Is activated by another trigger via the "run trigger" function.
Conditions
: None
Actions
: Set PlayerSlotCaptain = RaceTerran(Random Integer between 1 and 10)
: If (All Conditions are true) Then do (Actions) Else (Actions)
: If - Conditions
: PlayerSlotCaptain slot status != to is playing
: Then - Actions
: Trigger Run (This Trigger)
: Else - Actions
: Trigger Run (Next Random Trigger)
Note: I have used several RND triggers, and these are the latest.
|
|
|
10-20-2005, 02:04 AM
|
#8 (permalink)
|
|
Former Wc3sear.ch Administrator
Webmaster's Council
Join Date: May 2004
Posts: 3,175
|
Okay, here's your problem: You are setting your "PlayerSlotCaptain" variable to be a random intiger...but you are not using random intiger variables in your if/then/else conditions...and instead using player position status. It wont work that way. Here's how what trigger would work:
Set PlayerSlotCaptain = RaceTerran(Random Integer between 1 and 10)
If: PlayerSlotCaptain = 1
Then: actions
Else: actions
If: PlayerSlotCaptain = 2
Then: actions
Else: actions
(Actions would be assigning the payer captain status, however you plan to do that. repeat until all 10 possible random actions are covered)
-VGsatomi
__________________
|
|
|
10-20-2005, 03:16 AM
|
#9 (permalink)
|
|
User
Join Date: Aug 2005
Posts: 13
|
Quote:
|
Originally Posted by VGsatomi
Okay, here's your problem: You are setting your "PlayerSlotCaptain" variable to be a random intiger...but you are not using random intiger variables in your if/then/else conditions...and instead using player position status. It wont work that way. Here's how what trigger would work:
Set PlayerSlotCaptain = RaceTerran(Random Integer between 1 and 10)
If: PlayerSlotCaptain = 1
Then: actions
Else: actions
If: PlayerSlotCaptain = 2
Then: actions
Else: actions
(Actions would be assigning the payer captain status, however you plan to do that. repeat until all 10 possible random actions are covered)
-VGsatomi
|
I don't think that will work because PlayerSlotCaptain isn't an integer variable, it is a player variable, which means it can't equal a number. I could, of course, create another variable just for that. I'll try that tommorow, but I remember doing something like that, and it didn't work.
Anyway, to make sure its clear, the variables PlayerSlotCaptain, and RaceTerran [Array] are player variables. The trigger is designed to give the "Captain Rank" to 1 random player, out of 10 players.
|
|
|
10-20-2005, 03:57 AM
|
#10 (permalink)
|
|
Former Wc3sear.ch Administrator
Webmaster's Council
Join Date: May 2004
Posts: 3,175
|
So you are setting a player variable as a random intiger? Still won't work, because player variables don't use intigers. You need to fix your triggering.
-VGsatomi
__________________
|
|
|
10-20-2005, 05:26 AM
|
#11 (permalink)
|
|
I invoke thee
Join Date: Jul 2005
Posts: 1,082
|
Doesn't he want to spawn creeps for random player? I think he tries to assign a random player from array and then spawn creeps for him. So then:
RaceTerran is a player array
RaceTerran[Random integer number between 1 and 10] returns random player
|
|
|
10-20-2005, 09:46 PM
|
#12 (permalink)
|
|
User
Join Date: Aug 2005
Posts: 13
|
Quote:
|
Originally Posted by VGsatomi
So you are setting a player variable as a random intiger? Still won't work, because player variables don't use intigers. You need to fix your triggering.
-VGsatomi
|
No, the variable RaceTerran is an array, and that array uses the integer to determine what player it affects.
Quote:
RaceTerran is a player array
RaceTerran[Random integer number between 1 and 10] returns random player
|
Thats the idea.
|
|
|
10-21-2005, 12:26 AM
|
#13 (permalink)
|
|
Former Wc3sear.ch Administrator
Webmaster's Council
Join Date: May 2004
Posts: 3,175
|
This is the last time I am going to point your error out to you, then I am just going to ignore you.
: Set PlayerSlotCaptain = RaceTerran(Random Integer between 1 and 10) <----is setting an intiger variable
: If (All Conditions are true) Then do (Actions) Else (Actions)
: If - Conditions
: PlayerSlotCaptain slot status != to is playing <----player slot status comprison has nothing to do with intigers.
That is whats called a "conflictance". It wont work. You are setting up the wrong conditions for the variable.
-VGsatomi
__________________
|
|
|
10-21-2005, 12:35 AM
|
#14 (permalink)
|
|
User
Join Date: Aug 2005
Posts: 13
|
Quote:
|
Originally Posted by VGsatomi
This is the last time I am going to point your error out to you, then I am just going to ignore you.
: Set PlayerSlotCaptain = RaceTerran(Random Integer between 1 and 10) <----is setting an intiger variable
: If (All Conditions are true) Then do (Actions) Else (Actions)
: If - Conditions
: PlayerSlotCaptain slot status != to is playing <----player slot status comprison has nothing to do with intigers.
That is whats called a "conflictance". It wont work. You are setting up the wrong conditions for the variable.
-VGsatomi
|
I acutally figured it out. It has nothing to do with the variables. While the trigger is running I have cinematic mode activated for all palyers. I tried turning off cinematic mode, and the triggers worked perfectly. Appearently Cinematic mode uses the same random numbers. I suppose Blizzard did this because they were worried the RND would mess with the cinematic.
BTW, that is not a conflictance, the RND is affecting the Array number (which is an integer) not the player variable.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|
All times are GMT. The time now is 07:51 PM.
|