Product Chat / Fake forest background

Author
Message
magicmolecules
4
Years of Service
User Offline
Joined: 4th Dec 2019
Location:
Posted: 19th Dec 2019 09:42
Hey game guru's, i want to make a wall ish that looks like a forest, that can be seen in the background, like decals.
I dont want to make it solid (not like a plain in blender with image on, more like a transparent PNG) and no need for collision. is there a good way to make this?

Extra question: i want to make a script for moving an entity from A to B, i already got some that works just fine, but i want to trigger them somehow? any ideas. No need for pasting the scrip here, i want to try it my self just need help with the logic. cheers.
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 19th Dec 2019 09:46 Edited at: 19th Dec 2019 09:50
The only way to do the trees would be an image on a plane. You can choose no collision in the .FPE file by setting collisionmode to 11.

Here's one i did earlier ......

https://forum.game-guru.com/thread/214099?page=1#msg2550296

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Primary Laptop:
i5, NV1050 4GB, 8GB memory, 1x 1TB HDD, Win10.

Secondary Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th Dec 2019 10:43
Uhm planes in blender are transparent if they have transpancy... I use them all the time as reference images
You are talking about a decal or a plane mesh -basically a mesh that is like a piece of paper that just shows 1 side.

And yes, either add a logic check (i.e. if statement that only runs the movement code when some conditions are true) or use a trigger zone to spawn in the object you want to move at the desired time.

lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
magicmolecules
4
Years of Service
User Offline
Joined: 4th Dec 2019
Location:
Posted: 19th Dec 2019 11:02
ohh nice Belidos. Just what i need

smallg. i tried too hook the script up with a triggerzone but no luck. im gonna try to put a script together, if it doesn't work i may cry out for some help.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th Dec 2019 16:05
Quote: "smallg. i tried too hook the script up with a triggerzone but no luck. im gonna try to put a script together, if it doesn't work i may cry out for some help."

this might help you get used to the zones
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
magicmolecules
4
Years of Service
User Offline
Joined: 4th Dec 2019
Location:
Posted: 19th Dec 2019 18:36
Thanks a lot for the video.
I got it working sort of. It does what i want, to move forward when triggered, but it's also spinning around. is there a fix for the spin part?

I use this code for the entity to move from a to b, i use a trigger for spawning the entity that i want to move.

--
g_follow_waypoint_mode = {}
g_follow_waypoint_pathindex = {}
g_follow_waypoint_pathpointindex = {}

function loopwaypoint_init(e)
CollisionOff(e)
g_follow_waypoint_mode[e] = -1
g_follow_waypoint_pathindex[e] = 0
g_follow_waypoint_pathpointindex[e] = 0
end
function loopwaypoint_main(e)
-- play and fade sound if present
PlayerDist = GetPlayerDistance(e)
MaxDist = 1000
SndPerc = (MaxDist-PlayerDist)/MaxDist
if SndPerc > 0 then
SndVol = 50+(SndPerc*50)
else
SndVol = 0
end
LoopNon3DSound(e,0)
SetSoundVolume(SndVol)
-- handle waypoint movement
if g_follow_waypoint_mode[e] == -1 then
-- find closest waypoint
PathIndex = -1
PointIndex = 2
pClosest = 99999
for pa = 1, AIGetTotalPaths(), 1 do
for po = 1, AIGetPathCountPoints(pa), 1 do
pDX = g_Entity[e]['x'] - AIPathGetPointX(pa,po)
pDY = g_Entity[e]['y'] - AIPathGetPointY(pa,po)
pDZ = g_Entity[e]['z'] - AIPathGetPointZ(pa,po)
pDist = math.sqrt(math.abs(pDX*pDX)+math.abs(pDY*pDY)+math.abs(pDZ*pDZ));
if pDist < pClosest and pDist < 200 then
pClosest = pDist
PathIndex = pa
PointIndex = po
end
end
end
if PathIndex > -1 then
g_follow_waypoint_pathindex[e] = PathIndex
g_follow_waypoint_pathpointindex[e] = PointIndex
g_follow_waypoint_mode[e] = 1
end
end
if g_follow_waypoint_mode[e] == 1 then
pDX = g_Entity[e]['x'] - AIPathGetPointX(g_follow_waypoint_pathindex[e],g_follow_waypoint_pathpointindex[e])
pDZ = g_Entity[e]['z'] - AIPathGetPointZ(g_follow_waypoint_pathindex[e],g_follow_waypoint_pathpointindex[e])
if math.abs(pDX)+math.abs(pDZ) < 200 then
-- loop if at end of path
if g_follow_waypoint_pathpointindex[e] >= AIGetPathCountPoints(g_follow_waypoint_pathindex[e]) then
g_follow_waypoint_mode[e] = 2
return
else
g_follow_waypoint_pathpointindex[e] = g_follow_waypoint_pathpointindex[e] + 1
end
end
-- move entity to path node
patrolx = AIPathGetPointX(g_follow_waypoint_pathindex[e],g_follow_waypoint_pathpointindex[e])
patroly = AIPathGetPointY(g_follow_waypoint_pathindex[e],g_follow_waypoint_pathpointindex[e])
patrolz = AIPathGetPointZ(g_follow_waypoint_pathindex[e],g_follow_waypoint_pathpointindex[e])
tDistX = g_Entity[e]['x'] - patrolx
tDistZ = g_Entity[e]['z'] - patrolz
tAngleY = math.atan2(tDistX,tDistZ)
tAngleY = (tAngleY * 57.2957795)
SetRotationYSlowly(e,tAngleY,4)
MoveForward(e,-80)
end
end

PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 19th Dec 2019 20:32
Spinning around... ?
Did you set it (whatever it is) to // Properties // isimmobile = yes

Isn't this line for facing the waypoint? == SetRotationYSlowly(e,tAngleY,4)
Maybe a video would help...
PM
J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 19th Dec 2019 22:18
Spinning around...?

I had a play with your script and added the code to loop around the waypoints...
I used a barrel and it happily went back and forth around the path.
I then used plastic crates stack entity and it also went around ok.. but then it got stuck at one waypoint and spun about it.
I then tried a hover car from lafette-II and it spun on the first waypoint...
So my conclusion is it is the size of the entity and the..
near distance check and the move distance used in the script ...
if this is not correct for size of model then these 2 check and move combine to loop the entity around the waypoint..


PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th Dec 2019 22:30
is it possible you have 2 waypoint nodes at the same location or very close together? i can only imagine this would happen if it's too close to the next waypoint and spinning/moving just far enough away to be outside of the range to get the next point.

if you change the 200 in
if math.abs(pDX)+math.abs(pDZ) < 200 then
to a higher number it should also fix it but the higher you go the earlier the model will turn while following the path.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
magicmolecules
4
Years of Service
User Offline
Joined: 4th Dec 2019
Location:
Posted: 20th Dec 2019 07:14
I tried to set it up from scratch this morning, and now it works just fine. strange.
PM

Login to post a reply

Server time is: 2024-05-08 22:38:10
Your offset time is: 2024-05-08 22:38:10