-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved "Spawn UFO" effect #3059
base: master
Are you sure you want to change the base?
Improved "Spawn UFO" effect #3059
Conversation
holy fuck thats awesome man |
Only the cannibal camp? would be cooler if existed more locations that the UFO can go |
Well, when I did the elevation part of the effect, I thought, "now what?" at first I thought the ufo would fly high into the sky and disappear, but that means I can't pick up the player because at some point I need to release him... so then I thought wouldn't it be fun, if aliens delivered people to cannibals? xD but you are absolutely right, ufo can deliver peds somewhere else, the question is to where? |
i can think of some: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if there is still any desire to merge as it's been half a year now (I apologize for the delay).
You'd need to adapt the changes to reflect the current state of the codebase and take a look at all the suggestions, mostly nitpicks. You should also let clang-fmt format the file.
const float UFO_RADIUS = 26.f; | ||
const int MAX_UFO_AMOUNT = 3; | ||
const int SPAWN_INTERVAL = 13000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const float UFO_RADIUS = 26.f; | |
const int MAX_UFO_AMOUNT = 3; | |
const int SPAWN_INTERVAL = 13000; | |
static const float UFO_RADIUS = 26.f; | |
static const int MAX_UFO_AMOUNT = 3; | |
static const int SPAWN_INTERVAL = 13000; |
(or just make them macros)
#include <algorithm> | ||
#include <math.h> | ||
#include <random> | ||
#include <stdafx.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <algorithm> | |
#include <math.h> | |
#include <random> | |
#include <stdafx.h> | |
#include <stdafx.h> | |
#include <algorithm> | |
#include <math.h> | |
#include <random> |
stdafx.h should always be the first header. Adding a blank line ensures clangfmt doesn't shuffle it around
for (auto ufo : ufoList) | ||
if (ufo.target == player) | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (auto ufo : ufoList) | |
if (ufo.target == player) | |
return 0; | |
for (auto ufo : ufoList) | |
{ | |
if (ufo.target == player) | |
{ | |
return 0; | |
} | |
} |
For the sake of consistency with the rest of the project
if (ped == player) | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (ped == player) | |
continue; | |
if (ped == player) | |
{ | |
continue; | |
} |
if (ped == 0) | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (ped == 0) | |
continue; | |
if (ped == 0) | |
{ | |
continue; | |
} |
if (toDropPosVec.Length() < 400) | ||
ufo.destination = DROP_POS; | ||
else | ||
ufo.destination = ufo.destination + toDropPosVec * (350.f / toDropPosVec.Length()) * timeDiff; | ||
|
||
if (IS_ENTITY_A_PED(target) && !IS_PED_RAGDOLL(target)) | ||
SET_PED_TO_RAGDOLL(target, 5000, 5000, 0, true, true, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (toDropPosVec.Length() < 400) | |
ufo.destination = DROP_POS; | |
else | |
ufo.destination = ufo.destination + toDropPosVec * (350.f / toDropPosVec.Length()) * timeDiff; | |
if (IS_ENTITY_A_PED(target) && !IS_PED_RAGDOLL(target)) | |
SET_PED_TO_RAGDOLL(target, 5000, 5000, 0, true, true, false); | |
if (toDropPosVec.Length() < 400) | |
{ | |
ufo.destination = DROP_POS; | |
} | |
else | |
{ | |
ufo.destination = ufo.destination + toDropPosVec * (350.f / toDropPosVec.Length()) * timeDiff; | |
} | |
if (IS_ENTITY_A_PED(target) && !IS_PED_RAGDOLL(target)) | |
{ | |
SET_PED_TO_RAGDOLL(target, 5000, 5000, 0, true, true, false); | |
} |
else | ||
DRAW_SPOT_LIGHT(ufoPos.x, ufoPos.y, ufoPos.z, ufoPedDir.x, ufoPedDir.y, ufoPedDir.z, 255, 255, 255, 500, | ||
1.f, 0.f, 7.f, 1.f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else | |
DRAW_SPOT_LIGHT(ufoPos.x, ufoPos.y, ufoPos.z, ufoPedDir.x, ufoPedDir.y, ufoPedDir.z, 255, 255, 255, 500, | |
1.f, 0.f, 7.f, 1.f); | |
else | |
{ | |
DRAW_SPOT_LIGHT(ufoPos.x, ufoPos.y, ufoPos.z, ufoPedDir.x, ufoPedDir.y, ufoPedDir.z, 255, 255, 255, 500, | |
1.f, 0.f, 7.f, 1.f); | |
} |
else | ||
ufo.destination = Vector3(targetPos.x, targetPos.y, targetPos.z + 75.f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else | |
ufo.destination = Vector3(targetPos.x, targetPos.y, targetPos.z + 75.f); | |
else | |
{ | |
ufo.destination = Vector3(targetPos.x, targetPos.y, targetPos.z + 75.f); | |
} |
if (DOES_ENTITY_EXIST(prop)) | ||
DELETE_OBJECT(&prop); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (DOES_ENTITY_EXIST(prop)) | |
DELETE_OBJECT(&prop); | |
if (DOES_ENTITY_EXIST(prop)) | |
{ | |
DELETE_OBJECT(&prop); | |
} |
static RegisterEffect registerEffect(EFFECT_SPAWN_UFO, OnStart, OnStop, OnTick, EffectInfo | ||
{ | ||
.Name = "Spawn UFO", | ||
.Id = "misc_spawnufo", | ||
.EEffectGroupType = EEffectGroupType::SpawnGeneric | ||
} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static RegisterEffect registerEffect(EFFECT_SPAWN_UFO, OnStart, OnStop, OnTick, EffectInfo | |
{ | |
.Name = "Spawn UFO", | |
.Id = "misc_spawnufo", | |
.EEffectGroupType = EEffectGroupType::SpawnGeneric | |
} | |
); | |
// clang-format off | |
REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo | |
{ | |
.Name = "Spawn UFO", | |
.Id = "misc_spawnufo", | |
.EffectGroupType = EEffectGroupType::SpawnGeneric | |
} | |
); |
I changed the "Spawn UFO" effect, before it just spawned a UFO on the top of the player's head, now the UFO will select a ped or plater, hover over the him, pick him up, carry him to the cannibal camp and drop him there.