HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Integers not being properly checked

08-10-2003, 10:17 PM#1
Juvat
I have an option of two different views; 3rd person, or isometric. If you wish to change between the two, you need only type 'view 1' and 'view 2'. However, it doesnt actually change, like it's supposed to. Can anyone help?

Here is an example of what goes on:

e - Player- (Owner of Sulik 0021 <gen>) types a chat message containing view 2 as An exact match
c -
a - Set ViewSulik = 1

That is the change trigger. Now here is a bit of the one it's supposed to work with.

e - Time - Every .01 seconds of game time
c - And All (Conditions) are true
SulikPicked = 1
SulikChoice = 0
a - If (All Condition) are true then do (Then Actions) else do (Else Actions)
If - Conditions
ViewSulik Equal to 0
Then - Actions
*buncha camera stuff here that makes it be a third-person view*
Else - Actions
Camera - Reset camera for (Owner of Sulik 0021 <gen>) to standard game-view over 0.00 seconds

And, yes, SulikPicked does equal 1, and SulikChoice does equal 0. Please tell me if you see any flaws or know of any way to fix my problem. Thanks.
08-10-2003, 10:55 PM#2
Aleph
Ok maybe what I will say is stupid but who knows...
The triggers runs every 0.01 seconds.
It means maybe that multiple instance of the same trigger may be running at the same time and thus things don't work as they should do.
Otherwise I don't see any flaws in the trigger.
A good way to know the value of a variable or to check if a trigger runs is too put some 'text message' while running in game.
08-10-2003, 11:02 PM#3
Juvat
Thanks for the help.

I found the real problem; the Owner of.... blah blah command doesn't work. Is there a substitute that I can use to point to the unit's owner?
08-10-2003, 11:04 PM#4
Draco
Use a player variable (like 'PlayerXOXO'), then set the variable to the owner of the unit. Then have the event for every player and use a condition to check if it was 'PlayerXOXO that entered the string.
08-10-2003, 11:06 PM#5
Sage the Mage
Instead of running that trigger every .01 seconds, why not instead make the camera variables reals and use the variable becomes equal to blah event?
08-10-2003, 11:08 PM#6
Juvat
Two reasons: First of all because it works fine as is, and secondly because I didn't understand one friggin' word of that!:ggani:

Thanks for the help, everyone. I'll try that, Drac.

EDIT: That PlayerXOXO variable-type is simply the Player variable-type, right? If so, then when I choose the 'Owner of Unit' one, the list doesn't allow me to specify a specific unit or unit type. It has a bunch of stuff like 'Last Created Unit' and stuff like that, but that won't work.emote_confused

Another Friggin' Edit: Well, now I got the variable propperly set, but when I have the Player - Chat function pick a player, it won't allow me to use varaibles. WTF?
08-10-2003, 11:21 PM#7
Aleph
Don't use "owner of unit" but "variable" and choose the PlayerXOXO variable.
08-10-2003, 11:26 PM#8
Juvat
But there is no variable option, at least not in the area where you choose what player gets their chat messages checked.

There are the following:

Owner of Unit
Owner of Item
Conversation - Convert Player Index to Player

And that's all there is.:bgrun:
08-11-2003, 04:58 PM#9
Juvat
*Bump*
08-11-2003, 06:20 PM#10
Neo_Genesis
Hello I am guessing that Sulik is a unit that has been prepalced on the map (i.e. not generated)

First set up a Intiger Varible (I actualy recomend boolean but since ask for intiger that is what I will show you). I will also make that varible an array, I am not sure if you need this to work for multiple users but I will code it that way anyhow.

Just to identify the varible better I am going to call the intiger Player_Owner_Sulik[arry]. If a player ownes Sulik then Player_Owner_Sulik[1] = 1 else Player_Owner_Sulik[1] = 0

The code for your trigger should then look like
Trigger 1
Events
Player - Player 1 (Red) types a chat message containing View 1 as An exact Match
Conditions
Player_Owner_Sulik[Player Number of (triggering player)] Equal to 1
Actions
Set ViewSulik = 1

Trigger 2
Events
Time - Every 0.01 second of game time
Conditions
Actions
|--> If (All conditions are true) then do (Then Actions) else do (else Actions)
.....|-->If - Conditions
..........|-->Player_Owner_Sulik[0] Equal to 1
.....|-->Then - Actions
...........|--> If (All conditions are true) then do (Then Actions) else do (else Actions)
................|-->If - Conditions
......................|-->Player_Owner_Sulik[0] Equal to 1
................|-->Then - Actions
......................|-->All your camara actions here (I recomend making it a seperat trigger if you are doing this for multiple players)
................|-->Else - Actions
......................|-->Camera - Reset camera for (Owner of Sulik 0021 <gen> ) to standard game-view over 0.00 seconds
.....|-->Else - Actions

I hope thats what your looking for if its not post and I will rework it.

A few notes though if this will be used for multiple players 0.01 seconds is not a good thing to use when applying to more then 6 people becuase it slows the game down quite a lot, with one player it should be fine.

Neo_Genesis
08-11-2003, 08:46 PM#11
Juvat
No, there are exactly 6 players, and that doesn't fix it.

Is there, possibly, simply a way I can set the Owner of Unit function to work properly?
08-11-2003, 10:50 PM#12
Newhydra
Grrr....Here's the easiest way to do it

E-Player picks Sulik (however you do that)
C-None
A-Add event to trigger(cameraTrigger): Player X(the person who picked sulik, you know who this is 'cause you just created sulik for them) types a chat message containing "view 1" as an exact match

-Add event to trigger(cameraTrigger2): Player X types a chat message containing "view 2" as an exact match

cameraTrigger: All camera actions here using an event response (triggering player?)
cameraTrigger2: The other camera actions using an event response (triggering player?)

Now, if you have to have it running as a periodic trigger then you should keep your first periodic trigger, and set the variables in cameraTrigger and cameraTrigger2

If Sulik can change owners over the course of the game then you'll need to check that the player who entered the chat string is the owner of sulik in cameraTrigger and cameraTrigger2. (alternativly you could have player 1/2/3/4 ect enters chat string as the events for cameraTrigger and cameraTrigger2 and do the same check)
08-11-2003, 11:17 PM#13
Juvat
Sounds like an awesome idea, except for the fact that I can't fit all the 'player that picks sulik' info into the Events area.
08-12-2003, 12:16 AM#14
Newhydra
What? You already let a player pick Sulik, yes? You just take the spot where you assign sulik to a player and stick the event stuff in there too
08-12-2003, 01:24 AM#15
Juvat
w00t?:bgrun:

You are confusing me. I'm pretty sure you can't do that, or else I'm just not getting the message.

To ask a simple question; why doesn't the owner of *unitname* work?