Jump to content
bma

[Released] - Peberspray script 1.0

Recommended Posts

That would be a posibility, it would just require me to install it as a child on all the people which will make it less userfriendly for other people who wants to use it for their mod

Link to comment
Share on other sites

Are the other scripts set as childs (Shears, fire extinguisher etc.)? I would check those out and see how the positions are scripted with them. I haven't looked at them too much yet.

 

Or check out the script for the fire and how that is positioned. From what I see it looks like it acts as the hose script but changes the distance and texture? 

Link to comment
Share on other sites

Are the other scripts set as childs (Shears, fire extinguisher etc.)? I would check those out and see how the positions are scripted with them. I haven't looked at them too much yet.

 

Or check out the script for the fire and how that is positioned. From what I see it looks like it acts as the hose script but changes the distance and texture? 

 

I have thought about that, only problem is that most of them are coded from the game, so its not possible to see how they have made it, they just make an "pushactionextinguish" command and then the game takes care of the rest, so we can't see how it works. 

Link to comment
Share on other sites

The position of the person (pos variable) is going to give you the [0,0,0] position of the model...which is between the legs at floor level (as seen in the picture). What you need to do is play around and manually offset the position of the particle by adding to the Z axis.

 

I would create a Vector and add it to your pos variable.

Vector offsetV = new Vector(0.f,0.f,50.f); //My offsetpos = pos + offsetV; //Operator overloaded by default so we can add vectors in this manner

Unfortunately, this will require that you manually tweak the offset value...which can be time consuming. Essentially you need to change the "50" to a value that causes the particle to go where you need it.

 

Since all adult models are the same size, this should work for all person models (except children). If you want children models to use it, its an "easy" addition.

 

 

EDIT: It appears as though you tried to do a manual offset, but I don't see you adding your offset to the Z axis...only the X and Y.

Link to comment
Share on other sites

Okay then it must be a placement option.

 

I NEVER have luck with "Custom". I always end up using bounding box or another option since Custom seems to lock the Z-axis for me. Try going into editor, selecting the particle prototype, placing a copy on a blank map and try raising the particle on the Z-axis (hold alt + Left Mouse). Try changing the placement option until you are able to move it along the Z axis. That will be the placement option to use.

Link to comment
Share on other sites

One thing is bugging me...

Nowhere in your code are you actually offsetting the Z-axis.

Math::RotateVector(offset.x, offset.y, offset.z, r);pos.x += offset.x;pos.y += offset.y;

I see that part of the code (offseting the X and Y axis...but where are you offsetting the Z-axis? There is no

pos.z += offset.z;

 

Unless you added that later and its not reflected in your first post.

Link to comment
Share on other sites

One thing is bugging me...

Nowhere in your code are you actually offsetting the Z-axis.

Math::RotateVector(offset.x, offset.y, offset.z, r);pos.x += offset.x;pos.y += offset.y;
I see that part of the code (offseting the X and Y axis...but where are you offsetting the Z-axis? There is no

pos.z += offset.z;

Unless you added that later and its not reflected in your first post.

Of course! It works now, thank you very much!

Link to comment
Share on other sites

I Solved the first problem but ran into a new one :)

 

For some reason the particle always faces the same dirrection on the map, so nomather how the officer is turning the particle always turns towards the same direction. 

 

Help? 

fRp4kCg5.png

Link to comment
Share on other sites

I fixed it? Cool. I did something!

What minor error would that be?

 

The minor error would be the spray being a little off, was fixed by removing // at a specific line. So now the script works and it looks awesome ;)

 

 

But now the script is ready for release. 

It can be downloaded from our homepage: Copenhagen mod - Download page

 

mexUTWZR.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...