Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kanawanagasaki
Copy link

@Kanawanagasaki Kanawanagasaki commented Jun 11, 2022

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.

@TerrizX
Copy link

TerrizX commented Jun 12, 2022

holy fuck thats awesome man

@ReiDaTecnologia
Copy link

Only the cannibal camp? would be cooler if existed more locations that the UFO can go

@Kanawanagasaki
Copy link
Author

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?

@ReiDaTecnologia
Copy link

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:
Galileo Observatory, Zancudo Military Base, Del Perro Pier, LSA, Pier 400, Top of the Chilliad Mountain, Paleto Bay, Top of the Mount Gordo, Trevor's Trailer, Procopio Truck Stop etc... guess you just gotta spread out the waypoints so it cover all the map.

Copy link
Member

@pongo1231 pongo1231 left a 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.

Comment on lines +27 to +29
const float UFO_RADIUS = 26.f;
const int MAX_UFO_AMOUNT = 3;
const int SPAWN_INTERVAL = 13000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)

Comment on lines +5 to +8
#include <algorithm>
#include <math.h>
#include <random>
#include <stdafx.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#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

Comment on lines +44 to +46
for (auto ufo : ufoList)
if (ufo.target == player)
return 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Comment on lines +60 to +61
if (ped == player)
continue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (ped == player)
continue;
if (ped == player)
{
continue;
}

Comment on lines +154 to +155
if (ped == 0)
continue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (ped == 0)
continue;
if (ped == 0)
{
continue;
}

Comment on lines +201 to +207
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
}

Comment on lines +279 to +281
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
}

Comment on lines +291 to +292
else
ufo.destination = Vector3(targetPos.x, targetPos.y, targetPos.z + 75.f);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
else
ufo.destination = Vector3(targetPos.x, targetPos.y, targetPos.z + 75.f);
else
{
ufo.destination = Vector3(targetPos.x, targetPos.y, targetPos.z + 75.f);
}

Comment on lines +313 to +314
if (DOES_ENTITY_EXIST(prop))
DELETE_OBJECT(&prop);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (DOES_ENTITY_EXIST(prop))
DELETE_OBJECT(&prop);
if (DOES_ENTITY_EXIST(prop))
{
DELETE_OBJECT(&prop);
}

Comment on lines +328 to +334
static RegisterEffect registerEffect(EFFECT_SPAWN_UFO, OnStart, OnStop, OnTick, EffectInfo
{
.Name = "Spawn UFO",
.Id = "misc_spawnufo",
.EEffectGroupType = EEffectGroupType::SpawnGeneric
}
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
}
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants