Hi
,
after a few days and a few questions here in the forum, i have finally done my rpg like camera
This camera is a 3rd person similiar to wow( world of warcraft)
Futures:
Also works by variable: Hero[1~6] (unit variable).
so to add this to map, you can easly import it and just set each player's hero. and it all works.
Here are the codes:
CameraScript:
The Main triggers:
i need to credit some people for this, with out them i couldnt have done it, i don't remember who they are exactly so, if u do see this and u know u helped me, just tell me, i'll rep you and write ur name down here
.
I am interested in making an rpg with this camera, if some one is interested too, tell me.
Link to map, check it out
:
after a few days and a few questions here in the forum, i have finally done my rpg like camera
This camera is a 3rd person similiar to wow( world of warcraft)
Futures:
- Camera is affacted by ground level, wich means if the hero goes up - so is the camera.
- Ability to Rotate camera right, left. Using the arrow keys.
- Ability to change angle of attack up, down. Using the arrow keys.
- A smooth movment.
- The distancce to target is changeable, by Typing: "V [number from 0 to 9999].
And also the height is affacted by the distance wich makes your hero always visible, even if you put 3000 distance, unless your already seeing black.
Also works by variable: Hero[1~6] (unit variable).
so to add this to map, you can easly import it and just set each player's hero. and it all works.
Here are the codes:
CameraScript:
JASS:
function SetCameraZ takes real z, player p returns nothing
if GetLocalPlayer() == p then
set z = GetCameraField(CAMERA_FIELD_ZOFFSET)+z-GetCameraTargetPositionZ()
call SetCameraField(CAMERA_FIELD_ZOFFSET,z,- 0.01)
call SetCameraField(CAMERA_FIELD_ZOFFSET,z,0.01)
endif
endfunction
The Main triggers:
-
OverAll
-
Events
-
Time - Every 0.10 seconds of game time
-
-
Conditions
-
Actions
-
Player Group - Pick every player in (All players) and do (Actions)
-
Loop - Actions
-
Camera - Lock camera target for (Picked player) to Hero[(Player number of (Picked player))], offset by (0.00, 0.00) using Default rotation
-
Camera - Set (Picked player)'s camera Distance to target to (Real(CameraDistance[(Player number of (Picked player))])) over 0.10 seconds
-
Camera - Set (Picked player)'s camera Angle of attack to (Real(CameraAngle[(Player number of (Picked player))])) over 0.10 seconds
-
Camera - Set (Picked player)'s camera Rotation to ((Facing of Hero[(Player number of (Picked player))]) + (Real(CameraRotation[(Player number of (Picked player))]))) over 0.50 seconds
-
Set Loc[(Player number of (Picked player))] = (Position of Hero[(Player number of (Picked player))])
-
Custom script: set udg_TerrainHeight[(GetPlayerId(GetEnumPlayer()))+1] = GetLocationZ(udg_Loc[(GetPlayerId(GetEnumPlayer()))+1])
-
Set CameraHeight[(Player number of (Picked player))] = ((Integer(TerrainHeight[(Player number of (Picked player))])) + (CameraDistance[(Player number of (Picked player))] / 4))
-
Custom script: call SetCameraZ (udg_CameraHeight[GetPlayerId(GetEnumPlayer())+1] , Player(GetPlayerId(GetEnumPlayer())))
-
-
-
-
-
Distance
-
Events
-
Player - Player 1 (Red) types a chat message containing v as A substring
-
Player - Player 2 (Blue) types a chat message containing v as A substring
-
Player - Player 3 (Teal) types a chat message containing v as A substring
-
Player - Player 4 (Purple) types a chat message containing v as A substring
-
Player - Player 5 (Yellow) types a chat message containing v as A substring
-
Player - Player 6 (Orange) types a chat message containing v as A substring
-
-
Conditions
-
Actions
-
Set CameraDistance[(Player number of (Triggering player))] = (Integer((Substring((Entered chat string), 3, 6))))
-
-
i need to credit some people for this, with out them i couldnt have done it, i don't remember who they are exactly so, if u do see this and u know u helped me, just tell me, i'll rep you and write ur name down here
I am interested in making an rpg with this camera, if some one is interested too, tell me.
Link to map, check it out