• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Player Control Shift Depend on Lumber

Status
Not open for further replies.
Level 1
Joined
Feb 8, 2012
Messages
4
I am trying to create a scenario in a game where a giant is controlled by the player who has the most wood. But i just can seems to get the write triggers, comment or actions in world editor?
Can someone help me with me with it .... its one of my games main feature.:ogre_haosis:
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Time - Periodic event, every 1 seconds of game time
Actions
set integerVariable = 0
Pick all players in All players and do multiple actions
if current lumber of picked player > integerVariable then
--set playerVariable = picked player
--set integerVariable = current lumber of picked player
endif
if owner of giant not equal to playerVariable then
--change owner of giant to playerVariable
 
Level 1
Joined
Feb 8, 2012
Messages
4
Every 1 seconds of time
if p1 lumber > p2 lumber then
--if owner of giant not equal to p1 then
----change owner of giant to p1
--endif
else
--if owner of giant not equal to p2 then
----change owner of giant to p2
endif

I don't now ho you want to handle when there's equal amount of lumber.
Thanks alot...that worked for me..but the gaint is not a unit that is already on the map...the gaint spawns on the map in a region 10 mins after the game starts..the above triggers are good.. if that unit is already placed on the map...the gaint spwans again in the same region...10 mins after his death...is there a way to make the gaint spawn on the map..and then make him join the player with the higher number of lumber.???
 
Level 2
Joined
Feb 6, 2012
Messages
14
should i use them both on the same trigger??

here's what i have done..

sandworm spwan
Events
Unit - A unit enters sandworm spwam <gen>
Conditions

(Unit-type of (Triggering unit)) Equal to Pit Lord
Actions

Set SAND[1] = Pit Lord

  • sandworm spwan
    • Events
      • Unit - A unit enters sandworm spwam <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Pit Lord
    • Actions
      • Set SAND[1] = Pit Lord
and this on another trigger..? and it doesnt work for me.. am i doing something wrong.

  • v32
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If ((Player 1 (Red) Current lumber) Greater than (Player 1 (Red) Current lumber)) then do (Unit - Change ownership of herosandworm[1] to Player 1 (Red) and Change color) else do (Unit - Change ownership of herosandworm[1] to Player 2 (Blue) and Change color)
what i was previously doing was

i used an elapsed ttime event of 10 min for the gaint to spwan on the map..after 10 mins of map initialization..

and a generic event of unit dies..

with a condition of triggering unit is a unit of unit type gaint..

action
if all conditions are true then do (then actions) else do (else actions)

if conditions
player1 current lumber > player 2 current lumber
then actions
unit change ownership of (i gt stuck here because the variable is declared for unit type and not just unit)...which forces me to add the gaint in the map from the start.

however my else actions would be
if (all conditions are true ) then do (then actions) else do (else actions)
if conditions
Player 1 current lumber < than player 2 current lumber
then actions
unit change ownership (again i gt stuck here because i cant use the unit type variable on unit..) to player to and change color
else actions
game : displays the text : both player have same lumber
unit change owenership of gain to neutral hostile and change color.
 
Level 2
Joined
Feb 6, 2012
Messages
14
thank you for the quick reply..the site was down for a bit.. i just checked the map...and its just perfect except for the fact that..in my game i have lumber as the main resource...its a 1v1 rts/td...inspired by the dunes universe...the lumber system works like this..
there are some special creeps that give you "lumber" as bounty..we call it "spice" in our game. so the game only needs to check the amount of lumber with each player..the one who has more lumber..the GIANT becomes his unit/hero..incase of a scenario when the current value of lumber of player 1 = current value of lumber of player 2 the Giant becomes a neutral passive. The giant being on the sides gives the team an advantage..
 

fladdermasken

Off-Topic Moderator
Level 39
Joined
Dec 27, 2006
Messages
3,690
I won't make the effort. I won't embellish what I jot down here. I won't indulge you a long and pissy quip. I won't try to think of something witty to put here. I won't mind that you'll probably try to pin this as an onslaught. I won't care the day you realize it isn't. I won't walk out of here hoping you'll understand the question I'm about to pose, and finally-- I'll be long gone before you can muster an answer I'll be satisfied with.

"Why in the fucking Introduction section?"

~fladdermasken
 
Status
Not open for further replies.
Top