Jump to content

[SOLVED] [setCameraInterior()]/[mystery ped] issue


Recommended Posts

Ok, so basically I have this ped, with CJ's skin, in some kind of state of suspended falling just under the farm at 0,0,0.

[situation updated a little bit, see below in [EDIT]]

[update2: the ped mystery is solved, but the (offtopic) problem described under P.S. is still unsolved]

[update3: it's all solved now, thx for the input ppl]

screenie:

mysterypedresized.png

At first I thought it was something I was doing wrong, but after turning off not only my own gamemode etc. I also turned off every non-essential resource, so in the end I only had: admin, ajax, resourcebrowser, resourcemanager and webadmin on, and the ped was still there.

So, basically what I'm asking here is:

Is it supposed to be there? Why is it there? If not, what could I be doing wrong? If it IS there on purpose, what can I do to remove it (makes this annoying falling sound)?

Thanks in advance,

BladeArtist

[EDIT (after P.S. below, chronologically] I spawned myself via admin panel and set myself as the camera target, and when I set my camera matrix to 0,0,2,0,0,0 again, the ped seemed to have disappared. So is it reasonable to conclude this mystery ped is myself? If so, is it client-side? Or will it have a giant pile of people when they join the server but dont log in straight away? I don't see why it would work this way, am I missing something? o.O

Thanks again,

BladeArtist

P.S.

Oh and while I'm at it, there's this other question I have too.

I'm trying to make a skin selection thing, in which I add a dummy ped, bring it into an interior and set the camera matrix so it's targeted at this dummy ped, but for some reason it's not working, the screen just goes nearly black (fooled around with this a bit, and it seems there's a black spot at the interior's coordinates, but when I teleport there with the "admin" resource, it works just fine, though o.O).

So what would be the correct steps to accomplish the following (a simple explanation should suffice):

- make a dummy ped the skin of which I can change

- have it be in an interior of some description

- make it so I can see said ped as well =P

I'm also trying to do this all client-sided -- do-able?

Edited by Guest
Link to comment

There is nothing wrong with peds at 0,0,0, it must be your script. But as a player spawns for a split-second they are located at 0,0,0.Try turning off every resource exept admin, runcode, and play.

EDIT: Mr.Hankey beat me to it :|

Link to comment
I believe that players who have not yet been spawned are frozen hang around at 0,0,0 so your thought would be correct.

Ah, my hypothesis would be correct then. Can I circumvent this or should I just ignore it?

Regarding the second question: Did you use setCameraInterior?

Yes, I did use it, this is the exact stuff I used:

-- stuff
fadeCamera(true)
	Dummy = createPed(34, 0, 0, 3)
setElementInterior(Dummy, 14, 205, -165, 1000.6)
setCameraInterior(14)
setCameraMatrix(204, -165, 1001, 205, -165, 1001)

K that wasn't EXACTLY what I had when I encountered the problem. I changed it to this, and what happens now is:

- camera fades, it goes very dark

- I see a faint ghost of a ped falling

And if you check the wiki, in interior 14, at 205,-165,1000.5 there is a Ds clothes shop.

Doesn't display it correctly here though. What am I doing wrong?

[EDIT] it also seems like every time I set the interior of the camera and tab out of the game and tab back in, the entire screen is black (or otherwise messed up, have to restart the game) o.O

[EDIT2]This works just fine:

function makePedInDs()
local Dummy = createPed(14, 0, 0, 0)
setElementInterior(Dummy, 14, 205, -165, 1000.6)
end
addCommandHandler("makeDsPed", makePedInDs)

[EDIT3]I added this thing:

function printCamMatrix()
local Mat = {}
Mat.x,Mat.y,Mat.z,Mat.tx,Mat.ty,Mat.tz = getCameraMatrix()
local strs = {}
strs.x,strs.y,strs.z,strs.tx,strs.ty,strs.tz = "camera X","camera Y","camera Z","target X","target Y","target Z"
for k, v in pairs(Mat) do
outputChatBox(strs[k] .. ": " .. v)
end
end
addCommandHandler("camMat", printCamMatrix)

With it, I started the gamemode, teleported into the interior, aimed my camera just right and ran that command.

It printed me with the PERFECT coordinates, which I used (with two decimals) to set the cam matrix in my original script.

And it STILL just displays dark. I'm sure I'm setting the interior to 14 as well. So I have no idea what is going on o.O

[EDIT4] I realize I've seriously derailed the topic, and I'm sorry about that. You could change the title of the thread or something maybe?

Anyway, I've tried a lot of things now, and whatever I do, I can't seem to be able to set the camera interior and matrix to this interior properly. I haven't tried other interiors, so I guess it could be a problem with this specific one.

So, has anyone done this specific interior with setCameraMatrix()? How about interiors in general? Is there anyone who can spot what I'm doing wrong, if I am? I'm addressing anyone who has actually used this before.

Thanks again for the help,

BladeArtist

[EDIT5] Also tried moving my not-yet-spawned player element to this interior, just incase it's out of my stream or whatever?

Like if for some reason it's streaming based on my player element's location and not the camera's.

Yet alas, no success =/

Problem persists.

Link to comment

It works now.

All I need to do is:

setElementInterior(getLocalPlayer(), 14) -- clientside works just fine

Strange, huh?

Guess the camera can only show the interior your player element is in?

And in this case, I don't really get what setCameraInterior() is even for.

I would still like someone more familiar with the system to enlighten me a bit, but hey, it works.

Thanks for the replies, guys,

BladeArtist

[sOLVED]

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...