wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 06-30-2010, 12:42 PM   #1
PsiSan
User
 
PsiSan's Avatar
 
Join Date: Oct 2008
Posts: 20

PsiSan has little to show at this moment (0)

Send a message via MSN to PsiSan
Default Random Spawn Location!

Is there a way to make units players send start at random regions?

And whats the best way to script units to keep attack a unit (thats allrdy in a unit group)
PsiSan is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 07-02-2010, 06:43 AM   #2
Tot
6
 
Tot's Avatar
 
Join Date: Oct 2008
Posts: 841

Tot will become famous soon enough (53)Tot will become famous soon enough (53)

Default

1) don't understand what you want...sry

2) periodically loop through the group and issue "attack"-order

OR

register all order-events (ISSUE_ORDER, ISSUE_POINT_ORDER, ISSUE_TARGET_ORDER) and check if the ordered unit is within your group, if it is and the order is different from "attack" then disable the order-trigger, pause the unit, issue "stop", unpause it, issue "attack", enable the order-trigger. this method requires to issue "attack" when an unit is added to the group.

i thing second way is more efficient, but also more difficult to code...
__________________
Current Projects:
  • Masters Of WarCraft: Some mixture of AoS and RPG
    Terrain: 100%, Coding: 75%, Heroes: 0%, Items: 0%, Creeps: 0%, Upgrades: 0%
  • hunting emos
____________________________________
scheiss kack dreck sausacksau bundeswehr
Tot is offline   Reply With Quote
Old 07-02-2010, 08:56 AM   #3
PsiSan
User
 
PsiSan's Avatar
 
Join Date: Oct 2008
Posts: 20

PsiSan has little to show at this moment (0)

Send a message via MSN to PsiSan
Default

Cool thanks that helped alot!!

Ok what i meant by the first one is, i have a region, where the units enter (like creep sends), then i want those units that enter the region to spawn in random other regions?
PsiSan is offline   Reply With Quote
Old 07-02-2010, 09:12 AM   #4
Tot
6
 
Tot's Avatar
 
Join Date: Oct 2008
Posts: 841

Tot will become famous soon enough (53)Tot will become famous soon enough (53)

Default

use unit enters region event and an array with all possible random locations/regions
everytime an units enter the region, move it instantly to the location/region at a random place in the array. use a random integer form <index of first location/region> to <index of last location/region> as index to determine the location/region where you wanna move your unit
__________________
Current Projects:
  • Masters Of WarCraft: Some mixture of AoS and RPG
    Terrain: 100%, Coding: 75%, Heroes: 0%, Items: 0%, Creeps: 0%, Upgrades: 0%
  • hunting emos
____________________________________
scheiss kack dreck sausacksau bundeswehr
Tot is offline   Reply With Quote
Old 07-05-2010, 10:05 AM   #5
PsiSan
User
 
PsiSan's Avatar
 
Join Date: Oct 2008
Posts: 20

PsiSan has little to show at this moment (0)

Send a message via MSN to PsiSan
Default

How do i add regions to the array?
PsiSan is offline   Reply With Quote
Old 07-05-2010, 11:33 AM   #6
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,085

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by PsiSan
How do i add regions to the array?
You need to do it in a trigger that runs on map initialization: just use the "set variable" action.
__________________
Anitarf is offline   Reply With Quote
Old 07-05-2010, 01:13 PM   #7
PsiSan
User
 
PsiSan's Avatar
 
Join Date: Oct 2008
Posts: 20

PsiSan has little to show at this moment (0)

Send a message via MSN to PsiSan
Default

Will this work on multipale regions?
PsiSan is offline   Reply With Quote
Old 07-05-2010, 02:13 PM   #8
Tot
6
 
Tot's Avatar
 
Join Date: Oct 2008
Posts: 841

Tot will become famous soon enough (53)Tot will become famous soon enough (53)

Default

yes, you need a region-array and an integer to count how many regions you have.
then simply populate the array and set the count-integer to the maximal used index of your array.
__________________
Current Projects:
  • Masters Of WarCraft: Some mixture of AoS and RPG
    Terrain: 100%, Coding: 75%, Heroes: 0%, Items: 0%, Creeps: 0%, Upgrades: 0%
  • hunting emos
____________________________________
scheiss kack dreck sausacksau bundeswehr
Tot is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 05:36 PM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services