Staredit Network

Staredit Network -> UMS Assistance -> How to make certain things work for certain player
Report, edit, etc...Posted by ShadowSnipe4 on 2004-11-03 at 20:48:37
In the map that I'm making I want to have it so that a player can pick a player to be for the whole game, but no two players can have the same unit...I've worked that out but what I cant figure out is how to make it so that when you are that unit and you cast a "Spell" then it only affects you as in you own the spell and the other players dont use it, I cant figure out how to make it so that it figures out which player activated the spell and make it so that they are the ones who the spell affect and nobody else.

Example:
The game starts
you pick a marine
you get the marine's upgrades and specials area
you cast a spell in the specials area of the marine
only you get the spell that you cast (say it was grenade)
you get the grenade and use it
the end

Now how do I get it so that it recognizes which player has the unit without doing alot of switches or alot of triggers?

This has been bugging me for a while so I figured I'd better ask or I'd never get it done.
Report, edit, etc...Posted by greenreaper on 2004-11-03 at 21:11:46
I think I know what you're talking about.....It's pretty easy:

First, make a switch get set or cleared when a player picks a unit. Then use that switch as a condition for when the player casts a spell.

Example:

Conditions
Player 1 brings 1 unit to "marine"

Actions
Set switch "p1 marine" <set or clear>


Then just incorporate the conditions "if switch is set" with your other triggers...
Report, edit, etc...Posted by ShadowSnipe4 on 2004-11-03 at 21:16:28
I knew that already, but what I was asking for was an alternative that tookup less triggers, because since I have 4 players then that way would have me make the same trigger 4 times; once for each player witht he switch set; so Ii wanted to know if there was a "one size fits all" trigger for something like that.
Report, edit, etc...Posted by KlowN. on 2004-11-03 at 21:16:32
current player brings 1 chooser to location "marine"

kill 1 chooser at location marine for current player
wait 1000ms
set switch "marine"


switch "marine" is set

create 1 marine at location start for current player
clear switch "marine"

dont preserve trigger after u set switch "marine" or other players can get it
Report, edit, etc...Posted by ShadowSnipe4 on 2004-11-03 at 21:18:12
QUOTE(KlowN. @ Nov 3 2004, 09:16 PM)
current player brings  1 chooser to location "marine"

kill 1 chooser at location marine for current player
wait 1000ms
set switch "marine"
switch "marine" is set

create 1 marine at location start for current player
clear switch "marine"

dont preserve trigger after u set switch "marine" or other players can get it
[right][snapback]94203[/snapback][/right]

If you look at my first post it states that I already had the unit selection thing done, but what I wanted to know was about having the map recognize whice players have which units. pinch.gif
Report, edit, etc...Posted by KlowN. on 2004-11-03 at 21:21:10
if u did it that way though i think only 1 unit of each would appear unless like glitch when 2 people bring onto beacon at same time
Report, edit, etc...Posted by ShadowSnipe4 on 2004-11-03 at 21:23:19
QUOTE(KlowN. @ Nov 3 2004, 09:21 PM)
if u did it that way though i think only 1 unit of each would appear unless like glitch when 2 people bring onto beacon at same time
[right][snapback]94206[/snapback][/right]

Just so you know, that exactly what I have at the moment. smile.gif Hence the "already have the selection working"
Report, edit, etc...Posted by KlowN. on 2004-11-03 at 21:25:14
then what did u need?? if u have that then like there wouldnt be 2 same units for the heroes
that only takes up like 1 trigger i think
Report, edit, etc...Posted by ShadowSnipe4 on 2004-11-03 at 21:30:15
QUOTE(KlowN. @ Nov 3 2004, 09:25 PM)
then what did u need?? if u have that then like there wouldnt be 2 same units for the heroes
that only takes up like 1 trigger i think
[right][snapback]94211[/snapback][/right]

I need to know how I can get it to cast spells for a unit and recognize which player it is so that I can have it so that the spell, lets say grenade, creates a grenade for the player who cast it and not the rest of the party, I've already experimented with the current player thing to see if I could get it to work that way but when i tried to it made a unit for all the players and not just the one...
Report, edit, etc...Posted by KlowN. on 2004-11-03 at 21:33:56
i think you would have to do seperate triggers unless it was like
curent player commands 1 spell caster
and then u do whatever to cast spell.. maybe move unit to beacon

create 1 greneda at locatin x for current player

anyways im going to sleep now
Report, edit, etc...Posted by LegacyWeapon on 2004-11-03 at 22:25:15
QUOTE(ShadowSnipe4 @ Nov 3 2004, 09:16 PM)
I knew that already, but what I was asking for was an alternative that tookup less triggers, because since I have 4 players then that way would have me make the same trigger 4 times; once for each player witht he switch set; so Ii wanted to know if there was a "one size fits all" trigger for something like that.
[right][snapback]94202[/snapback][/right]

Use death counts. If the person brings unit to 'Marine'. Set death counts to 1 for current player.

So then make a key. 1 = Marine, 2 = Ghost and so on until you have covered all your units.

Then do the triggers for current player.

Death count for current player is exactly X
Report, edit, etc...Posted by (U)Bolt_Head on 2004-11-04 at 01:48:19
QUOTE(KlowN. @ Nov 3 2004, 09:16 PM)
current player brings  1 chooser to location "marine"

kill 1 chooser at location marine for current player
wait 1000ms
set switch "marine"
switch "marine" is set

create 1 marine at location start for current player
clear switch "marine"

dont preserve trigger after u set switch "marine" or other players can get it
[right][snapback]94203[/snapback][/right]

You wouldn't want to do that. That would mess up more than you would belive. First off the wait in the first trigger is compleatly pointless. And seconly, If player 2 went to pick a marine at the start of the game player 1 would get it. Then if another player went there later player 2 would then get a marine also. You complicated stuff alot to make it worse.

ShadowSnipe4: I'm still not sure what you want. Like the gernade your talking about, do you want it so when the player cast it only blows up for one player? Or are you asking how to make it so only the player that is the marine can cast it?

I know this kinda stuff like the back of my hand, its truly amazing that people can get as far as they do in mapmaking and only get this stuff correct with luck.
Report, edit, etc...Posted by 1elias on 2004-11-04 at 08:53:25
If i understand you correctly i would sugest this.

To chose wich unit.

Players

Conditions: Current player bring at least 1 "choser" to "chose marine"

Actions: Kill all "choser" at location "chose marine"
Create 1 Marine at "create marine"
Preserve Trigger

to use the spells/abilities i would suggest u use the droppship method.
And when i say "markers" thats a unit i use instead of switches, i can be apider mines of khalis crystal etc.

Players

Conditions: "current players bring at least 1 grenade(just pick a unit, scv for example and rename it) to "dropship ground" location with all air disabled

And any other stuff like "accumelate enough minerals(grenades)"

Actions: Excute script to enter transport at "dropship Air (another location on the dropship just that air is not disabled)"
Create 1 marker at "center location on unit" for current player
Create 1 marker at "Throwing grenade" for current player
Preserve Trigger


Players

Conditions: Current player brings at least 1 marker to "Center location on unit"
Current player commands at least 1 jim raynor(your marine)

Actions: Remove 1 marker for current player at "Center location on unit" for current player
Move location "player location" at jim raynor owned by current player at anywere
Preserve Trigger

Uwill have to make this trigger for every unit u want

and for this trigger, when i say move spider mine i mean that u will need a unused location where spidermines are created so they are burrowed, and dont to to be burrowed before they can attack the foe. this is just an example of how i would my grenade weapon. you will also need a location that you name "Grenade land here" or something.

Players

Conditions: "current player brings at least 1 marker to "Throwing grenade"

Actions: Center location "throw grenade here" on men owned by foes at "Player location"
Move 1 spider mine from "spidermines" to "throw grenade here"
Preserve Trigger

This may look complex, but really it isnt, just make good use of "comment" on the triggers, and when that part is done, the rest will be pretty simple. and its very easy to fix up any errors. there will be something u have to add, that i didnt take my time here to show u, for example when you give a player grenade for example it will automaticly cast the "grenade" before it unloads droppship, i think you will figure out that part. and hey, dont forget to use hyper triggers or this wont work
;O
Report, edit, etc...Posted by LegacyWeapon on 2004-11-04 at 15:06:05
QUOTE(1elias @ Nov 4 2004, 08:53 AM)
If i understand you correctly i would sugest this.

To chose wich unit.

Players

Conditions: Current player bring at least 1 "choser" to "chose marine"

Actions: Kill all "choser" at location "chose marine"
             Create 1 Marine at "create marine"
             Preserve Trigger
[right][snapback]94372[/snapback][/right]

He wanted to have a count so he knows what unit each player picked :\
Report, edit, etc...Posted by 1elias on 2004-11-04 at 15:15:59
If thats the case, that really sucked, ;O i used a long time writing that ;(

Though he ment how to cast spells etc for each player without making a trigger for each player. well well
Report, edit, etc...Posted by ShadowSnipe4 on 2004-11-04 at 21:31:31
QUOTE(1elias @ Nov 4 2004, 03:15 PM)
If thats the case, that really sucked, ;O i used a long time writing that ;(

Though he ment how to cast spells etc for each player without making a trigger for each player. well well
[right][snapback]94437[/snapback][/right]

I did mean how to cast spells for each player withought making a trigger for each player, so when you say current player, should I make the team that the trigger belongs to, the humans team or have it for each player? Confusing....
Report, edit, etc...Posted by LegacyWeapon on 2004-11-04 at 22:38:47
Making it the human team is the same as making it for every player on the human team.
I don't know what to make it. Prolly 1 for each player then...
Report, edit, etc...Posted by ShadowSnipe4 on 2004-11-04 at 23:24:33
Another Wuick Question, can protoss units be loaded into a dropship and also does the AI script work on human players too or do i have to give the Dropship to a computer, then load the unit, then ive it back to the player, and Legacy, when you say for each player do you mean that have it one trigger and then in the players thing have it for P1, P2, P3, P4 or copy and edit each trigger to work for one player only?
Report, edit, etc...Posted by (U)Bolt_Head on 2004-11-05 at 01:15:18
QUOTE(ShadowSnipe4 @ Nov 4 2004, 09:31 PM)
I did mean how to cast spells for each player withought making a trigger for each player, so when you say current player, should I make the team that the trigger belongs to, the humans team or have it for each player? Confusing....
[right][snapback]94702[/snapback][/right]


Ok i'll try to explain this as simple as i can.

The Secret Behind Group owned triggers and Current Player
Like my title i figured more people would read it this way lol
- Players 1-8 each own there own set of triggers and exicute them if there present in the game. A force or all players cannot own triggers. When a trigger is checked for a force or all players each player in that group owns a copy of that trigger.

-When multiple players own these triggers it looks like one trigger but it isn't. For an example group owned triggers fire compleatly independant of eachother. Anotherwords player 1 can fire the trigger and a hour later player 2 will fire his (even if it isn't preserved)

Current player, is simply the player running the trigger. This does not mean if a trigger is checked for a force current player is all those players. As i will show you a group owned trigger is the same as a copy of that trigger for each player. Current player only refers to the single player running that trigger.

-For and example I'll use several slightly modified triggers and explain the results of each.








Trigger
Players:
¤ Force 1 (1-4)
Conditions:
¤ Current player brings at least one men to locaiton 'beacon'
Actions:
¤ Create one marine for current player at 'spawn center'

Ok this will work for players 1-4 whenever any one of the players goes to the beacon, that one player will get a marine. Also if Player 2 decides to go to the same beacon later in the game he will get a marine just like player 1 did. Each player can run the trigger once but no single player can run it more than once.








Trigger
Players:
¤ Force 1 (1-4)
Conditions:
¤ Current player brings at least one men to locaiton 'beacon'
Actions:
¤ Create one marine for force one at 'spawn center'

In this trigger the actions speifiy the force. When you create a unit for a force each player in that force will get a copy of that unit. But keep in mind in this case the conditions still specify 'current player'. So when player 1 goes to the beacon, players 1-4 will all get a marine. If player 2 goes to the beacon later players 1-4 will get one more marine.








Trigger
Players:
¤ Force 1 (1-4)
Conditions:
¤ Force 1 brings at least one men to locaiton 'beacon'
Actions:
¤ Create one marine for current player at 'spawn center'

In this example the conditions state force 1. What happens here is whenever ANY one player goes to the beacon all the players triggers fire. So each player will end up with one marine. If you look at the 4 players seperatly it makes since. When player 1 checks his trigger it will go off even if player 2 is standing on the beacon. Afterall player 2 is part of force 1 so it satisfies player ones trigger. Also imediately after player 1 runs his trigger Player 2 two will run his creating a second marine. The same will happen for players 3 and 4.








Trigger
Players:
¤ Force 1 (1-4)
Conditions:
¤ Force 1 brings at least one men to locaiton 'beacon'
Actions:
¤ Create one marine for Force 1 at 'spawn center'

This is the two above combined. When ever any player goes to the beacon all 4 player's trigger will fire. But since it is creating the unit for the force each players trigger will create the unit for each player. So if player 3 goes to the beacon each player will get 4 marines.








Trigger
Players:
¤ Force 1 (1-4)
Conditions:
¤ Current player brings at least one men to locaiton 'beacon'
¤ Switch 1 is clear
Actions:
¤ Create one marine for current player at 'spawn center'
¤ Set Switch 1

Now the switch might seem a little pointless but as we saw before without the switch each player that goes to the beacon will get his own marine. This trigger works so only the FIRST player who goes to the beacon will get a marine. After that the switch will be set so the other players cannot get their marine. (keep in mind if the switch is cleared later the remaining 3 players are eligable to get the marine)

Hopefully these examples will help you understand how things work. You must veiw group owned triggers as MULTIPLE triggers, cause they are.

QUOTE(ShadowSnipe4 @ Nov 4 2004, 11:24 PM)
Another Wuick Question, can protoss units be loaded into a dropship and also does the AI script work on human players too or do i have to give the Dropship to a computer, then load the unit, then ive it back to the player, and Legacy, when you say for each player do you mean that have it one trigger and then in the players thing have it for P1, P2, P3, P4 or copy and edit each trigger to work for one player only?
[right][snapback]94748[/snapback][/right]


Yes, Yes, No i doubt he means that if he does you shouldn't do it lol.
Report, edit, etc...Posted by ShadowSnipe4 on 2004-11-05 at 07:07:00
Thank you bolt, I think I get it, very insightful!
Next Page (1)