[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Modding > Triggers & Scripts


Triggers & Scripts In this forum you may ask for help on fixing a trigger or script. But if you need help getting started with a trigger, this is not the right place — use the World Editor Help Zone.

Closed Thread
 
Thread Tools
Old 06-20-2012, 07:22 PM   #1 (permalink)
Registered User xiFackx
User
 
Join Date: Jun 2012
Posts: 3
xiFackx is an unknown quantity at this point (0)
Randoming trigger.

When the trigger creates a random unit its not so random.. its the same unit for everyone, each time its a different hero.. but everyone gets the same hero.. help?

All Random
Events
Player - Player 1 (Red) types a chat message containing -ar as An exact match
Conditions
Actions
Trigger - Turn off Default mode <gen>
Trigger - Turn off Turn off all random <gen>
Trigger - Turn off Allowed Selection <gen>
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Equal to Is playing
Then - Actions
Quest - Display to (All players) the Hint message: ((Name of (Triggering player)) + has selected random mode.)
Set Random_Hero = (Random integer number between 1 and Random_Count)
Unit - Create 1 Heroes_array[RandomData[Player_Count]] for (Player((Integer A))) at ((Player((Integer A))) start location) facing Default building facing degrees
Set RandomData[Random_Hero] = Random_Count
Set Player_Count = (Random_Count - 1)
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Player - Make (Unit-type of (Last created unit)) Unavailable for training/construction by (Picked player)
Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Actions)
Loop - Actions
Camera - Pan camera for (Picked player) to (Center of Team1Circle <gen>) over 0.00 seconds
Player Group - Pick every player in (All allies of Player 6 (Orange)) and do (Actions)
Loop - Actions
Camera - Pan camera for (Picked player) to (Center of Team2Circle <gen>) over 0.00 seconds
Trigger - Turn on Random level 2 <gen>
Trigger - Turn off (This trigger)
Else - Actions
Do nothing
xiFackx is offline  
Old 06-21-2012, 12:47 AM   #2 (permalink)
Registered User Halo7568
User
 
Join Date: Jun 2004
Posts: 84
Halo7568 has little to show at this moment (40)Halo7568 has little to show at this moment (40)Halo7568 has little to show at this moment (40)Halo7568 has little to show at this moment (40)Halo7568 has little to show at this moment (40)
Perhaps you could explain what you were thinking when you designed the random system this way and the purpose behind each of those variables?

Set Random_Hero = (Random integer number between 1 and Random_Count)
Unit - Create 1 Heroes_array[RandomData[Player_Count]] for (Player((Integer A))) at ((Player((Integer A))) start location) facing Default building facing degrees
Set RandomData[Random_Hero] = Random_Count
Set Player_Count = (Random_Count - 1)

I can tell you one thing I have noticed though. Player count is set to random_count - 1, but I do not see random_count being modified anywhere. So it could be that Heroes_array[RandomData[Player_Count]] is using the same player_count for every player except for the first one. Which might be the main reason why several players would be getting the same hero.

On another note, are you trying to avoid players getting the same type of hero when it randoms?
Halo7568 is offline  
Old 06-21-2012, 06:49 AM   #3 (permalink)
Registered User ForeverBeADragon
Forever Be A Dragon
 
ForeverBeADragon's Avatar
 
Join Date: Oct 2011
Posts: 130
ForeverBeADragon has little to show at this moment (26)ForeverBeADragon has little to show at this moment (26)ForeverBeADragon has little to show at this moment (26)
The Warcraft 3 randomizer is really stupid. It results the same each time you start the map it.
Example:
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Game - Display to (All players) the text: (String((Random integer number between 1 and 10)))
It always displays 7 6 1 9 3 10 8... with me...
__________________
ForeverBeADragon is offline  
Old 06-21-2012, 08:00 AM   #4 (permalink)
Registered User defskull
ϟƘƦƖ|ןΣ✘
 
defskull's Avatar
 
Join Date: Mar 2008
Posts: 7,533
defskull has a brilliant future (1284)defskull has a brilliant future (1284)defskull has a brilliant future (1284)defskull has a brilliant future (1284)
Zephyr Contest #9 - Winner: Stringed Shuriken: An assassin is always working like a trickster. This entry proves the theory, as defskull managed to integrate the fictional lore of the human legacy into a single, virtual ability. Strike fast, die instantly! 
The system never is stupid because the stupid would be the human because simply, we created them to act like that.

1. Open World Editor
2. File
3. Preferences...
4. Test Map Tab
5. Untick the "Use Fixed Random Seed"

You're good to go.

If you want to ask "why the hell do they want to get a same value whereas the system itself if called random?"

Well, for some experimenters who wants to repeat the test, they will do it in a controlled variable, where you can easily catch a data or whatsoever.

It is really useful for experimenting with random values with a controlled situation.
defskull is offline  
Closed Thread

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 11:06 PM.





Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle