HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

help me plz

10-13-2004, 07:17 AM#1
grd
ok...
I want to make a menu pop up at the start of the game to ask what hero the player wants to be, once the player selects the heroes name it creates the hero at players starting location and turns off trigger for player.

-------------------I give rep to people that help me, if I use their soultion----------------
10-13-2004, 07:52 AM#2
ValIe
Here..
try to learn it, instead of just c&p mine...

btw what is it for?

-Valle
10-13-2004, 08:05 AM#3
grd
I'm looking at it now, if it helps I'll give you rep.
10-13-2004, 09:36 AM#4
grd
wow, thanks :o
ok I don't know if you can do this, but..
I want to make a shooting game where you move the hero with w,a,s,d (i know how to do that) but I want to make so it looks like you viewing the game from your heroes eyes so when you move your hero the camera follows like counter-strike
10-13-2004, 11:16 AM#5
ValIe
I can't help with that..
but some others already made such a camera take a look at that

Download FPS Mod Here

-Valle
10-13-2004, 03:25 PM#6
a thing
Code:
function FPCCameraFields takes nothing returns nothing
    local integer i = 1
    loop
        exitwhen i > 12
        call SetCameraFieldForPlayer( ConvertedPlayer(i), CAMERA_FIELD_TARGET_DISTANCE, -85.00, 0 )
        call SetCameraFieldForPlayer( ConvertedPlayer(i), CAMERA_FIELD_ANGLE_OF_ATTACK, 360.00, .50 )
        call SetCameraFieldForPlayer( ConvertedPlayer(i), CAMERA_FIELD_FIELD_OF_VIEW, 700.00, 0 )
        call SetCameraFieldForPlayer( ConvertedPlayer(i), CAMERA_FIELD_ZOFFSET, 195.00, 0 )
        set i = i + 1
    endloop
endfunction

Code:
Update camera
    Events
        Time - Every 0.20 seconds of game time
    Conditions
    Actions
        Custom script:   local unit thingy
        Custom script:   call FPCCameraFields()
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Terrain cliff level at ((Position of [b]UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[/b][(Integer A)]) offset by 120.00 towards (Facing of [b]UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[/b][(Integer A)]) degrees)) Greater than (Terrain cliff level at (Position of [b]UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[/b][(Integer A)]))
                    Then - Actions
                        Camera - Set (Player((Integer A)))'s camera Angle of attack to ((Angle of attack of the current camera view) + 10.00) over 0.19 seconds
                    Else - Actions
                Camera - Set (Player((Integer A)))'s camera Rotation to (Facing of [b]UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[/b][(Integer A)]) over 0.39 seconds
                Unit - Create 1 [b]invisable unit[/b] for Neutral Extra at ((Position of [b]UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[/b][(Integer A)]) offset by 40.00 towards (Facing of [b]UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[/b][(Integer A)]) degrees) facing (Facing of [b]UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[/b][(Integer A)]) degrees
                Custom script:   set thingy = GetLastCreatedUnit()
                Custom script:   call SetCameraTargetControllerNoZForPlayer( ConvertedPlayer(GetForLoopIndexA()), thingy, 0, 0, true )
                Camera - Lock camera target for (Player((Integer A))) to [b]UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[/b][(Integer A)], offset by (0.00, 0.00) using The unit's rotation
                Custom script:   call RemoveUnit( thingy )

Change the bold stuff.
10-13-2004, 07:57 PM#7
grd
thank you so much, I don't know if it works yet but I'm giving you rep...
I want to make it so a unit will not attack any enemy units unless they have been clicked on, and one click equals one shot, so they will fire then stop unless continuous clicking on the enemy.

I don't think you can do this but if you can, or have another solution plz post.
10-13-2004, 08:10 PM#8
a thing
Quote:
Originally Posted by grd
thank you so much, I don't know if it works yet but I'm giving you rep...
I want to make it so a unit will not attack any enemy units unless they have been clicked on, and one click equals one shot, so they will fire then stop unless continuous clicking on the enemy.

Something like this:

Code:
E-
Player selects unit

C-
(Triggering unit) not equal to UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Player number of (Triggering player))]

A-
Unit - Order UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Player number of (Triggering player))] to attack (Triggering unit)

Quote:
Originally Posted by grd
I don't think you can do this but if you can, or have another solution plz post.

That worked in my map.
10-13-2004, 08:38 PM#9
sweet5
wow.... a thing actually knows triggers? ^_-
10-14-2004, 05:18 AM#10
grd
a thing I need help with your 1st code

Update camera
Events
Time - Every 0.20 seconds of game time
Conditions
Actions
Custom script: local unit thingy
Custom script: call FPCCameraFields()
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain cliff level at ((Position of UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Integer A)]) offset by 120.00 towards (Facing of UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Integer A)]) degrees)) Greater than (Terrain cliff level at (Position of UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Integer A)]))
Then - Actions
Camera - Set (Player((Integer A)))'s camera Angle of attack to ((Angle of attack of the current camera view) + 10.00) over 0.19 seconds
Else - Actions
Camera - Set (Player((Integer A)))'s camera Rotation to (Facing of UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Integer A)]) over 0.39 seconds
Unit - Create 1 invisable unit for Neutral Extra at ((Position of UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Integer A)]) offset by 40.00 towards (Facing of UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Integer A)]) degrees) facing (Facing of UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Integer A)]) degrees
Custom script: set thingy = GetLastCreatedUnit()
Custom script: call SetCameraTargetControllerNoZForPlayer( ConvertedPlayer(GetForLoopIndexA()), thingy, 0, 0, true )
Camera - Lock camera target for (Player((Integer A))) to UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Integer A)], offset by (0.00, 0.00) using The unit's rotation
Custom script: call RemoveUnit( thingy )


red is stuff I can't do.. could you try to explain it like I'm a n00b NOTE: I'm a n00b
10-14-2004, 12:42 PM#11
a thing
Quote:
Originally Posted by grd
Code:
                        ([color=Red]Terrain cliff level at ((Position of UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Integer A)]) offset by 120.00 towards (Facing of UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Integer A)]) degrees)) Greater than (Terrain cliff level at (Position of UNIT ARRAY THAT HOLDS THE PERSON THAT A PLAYER IS PLAYING AS[(Integer A)]))

There's an integer function "Environment - Terrain cliff level". The point function is polar offset.

Quote:
Originally Posted by grd
Code:
                    Then - Actions
                        Camera - Set (Player((Integer A)))'s camera Angle of attack to ((Angle of attack of the current camera view) + 10.00) over 0.19 seconds

You get (Player((Integer A))) with the player function "Convert player index to player". The index is (Integer A).

That's it for now, I g2g.
10-14-2004, 08:18 PM#12
grd
holly shit this is hard, can you put it on a map and attach it to a post on this thread like what ValIe done, plz...
it would end up being quicker then trying to explain it all to me ^_^
10-16-2004, 06:44 AM#13
grd
ok, more trigger help..
this should be easy but I still don't know how to do it :(
I want, when a player owns a unit equal to a Troll Headhunter use the Berseker Upgrade.

if you can tell me how to do this and it works I'll give you rep.
10-17-2004, 03:19 AM#14
grd
help me............
10-17-2004, 03:33 AM#15
a thing
Quote:
Originally Posted by grd
ok, more trigger help..
this should be easy but I still don't know how to do it :(
I want, when a player owns a unit equal to a Troll Headhunter use the Berseker Upgrade.

if you can tell me how to do this and it works I'll give you rep.

Do you mean when a unit is made that is a headhunter?