Scripts / Dont touch the fire / CollisionOn ?

Author
Message
nightbringer
8
Years of Service
User Offline
Joined: 21st Feb 2016
Location: DE
Posted: 25th Feb 2016 22:43 Edited at: 26th Feb 2016 00:05
/// Collide and get hurt by enity ///

Hello Everyone! =)

I'm new to this whole scripting thing. So I read this article:
http://steamcommunity.com/sharedfiles/filedetails/?l=german&id=398177770
and trying out if I understood it correctly.

I actually wanted to hold it quite simple, but unfortunately it does not work as I imagine it ^^
So here is the problem:
I go through the door into the church. Once I touch the trigger zone, the (decal) fire appears. "Oh no, I will never get out of here! The fire blocks my way out ..." or not. I can go through it and dont lose health : D

Now I want that the Player collides with the fire, so he can not go through it. In addition, the fire should pull off the health.
So I have figured out this together:



What am I doing or understand wrong?
A picture is attached...

Thank you and best regards!

Attachments

Login to view attachments
PM
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 26th Feb 2016 01:26 Edited at: 26th Feb 2016 01:35
nightbringer,
If you want to use collision on the fire decal then you will have to modify its fpe settings, edit it in notepad like a script.
change
collisionmode = 11 from, to collisionmode = 0

the fpe is located "C:\Program Files (x86)\Steam\steamapps\common\Game Guru\Files\entitybank\Decals\Fire 1.fpe", if this is the decal you used..

I modified your code, so the player will not die straight away when he gets within range.
This script goes into the fire decal, and has to be named fire.lua
in your screenshot you have Feuer.lua attached to the decal, that wont work as the names need to match, and only use lowercase lettering for scripts and function names.
This script needs to be named fire.lua

Desktop: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 CPUs), ~3.6GHz, Windows 8.1 64-bit, 16 GB Ram, NVIDIA GeForce GTX 750 Ti, Display Memory: 4018 MB. Resolution 1360x768, Passmark 3528.
Laptop: Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)

Attachments

Login to view attachments
nightbringer
8
Years of Service
User Offline
Joined: 21st Feb 2016
Location: DE
Posted: 26th Feb 2016 13:28
Hi Perelect,

Thank you for your help!
I already thought that there have to be a time delay in the code, otherwise the 10 health are deducted within seconds. Is there a list somewhere where I can find all possible commands and functions for gameguru? Or someone knows a nice lua tutorial dedicated to games (exept of lua.org/pil/contents.html) ?

I know it´s a nooby question but I would like to know why you put some codes in or above the _init(e) and not in the _main(e) sections.


Ok, something else again, because unfortunately there is another problem:
collisionmode is now set to 0 and the script is getting used. I lose health if i touch it and I can not go through the fire. Or even walk on it^^
Strangely, in the test mode the fire positioned itself differently. It climbs up the terrain as it would have not enough space.
Any ideas how I can fix this mistake?
Here are the Fire 1.fpe stats:


Thanks!

Attachments

Login to view attachments
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 26th Feb 2016 14:22
change isinmobile = yes to stop it from moving
for the guide use the steam guide
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 26th Feb 2016 14:23
Hi,

Quote: "Is there a list somewhere where I can find all possible commands and functions for gameguru?"

On steam there are heaps of guides for GG..
http://steamcommunity.com/sharedfiles/filedetails/?id=398177770

Quote: "local delay = {} -- why is this code up above
function fire_init(e)
delay[e] = 2000 -- or this two lines in the _init(e) ?
StartTimer(e)
end
"


All theses are only read once on startup of the game these sections are used to create / declares variables


Quote: "Strangely, in the test mode the fire positioned itself differently. It climbs up the terrain as it would have not enough space. "


Try this, Set IsImmobile to yes in the properties window. This stop the entity from being pushed around.

If you want to walk through the fire you need to turn the entities collision off, now you have enabled it in the fpe.
use CollisionOff(e) in the script.

Cheers
Desktop: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 CPUs), ~3.6GHz, Windows 8.1 64-bit, 16 GB Ram, NVIDIA GeForce GTX 750 Ti, Display Memory: 4018 MB. Resolution 1360x768, Passmark 3528.
Laptop: Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)
nightbringer
8
Years of Service
User Offline
Joined: 21st Feb 2016
Location: DE
Posted: 28th Feb 2016 22:09
Ok thanks so far so good.

Hmm... After I set "IsImmobile" to "yes" in the properties window of the fire its being stoped pushed around.
But now it prevents that the attached lua script get activated: The character dont loses health anymore when he touches the fire.

If I put "IsImmobile" to "no" again the character loses health but the fire climbs up the terrain again

Basically the script version of perelect works fine.
Why is the "IsImmobile" function blocking the script? Or any other ideas?

PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 28th Feb 2016 23:41
that's weird, must a new change in the engine.
try turn the physics off in the properties then, that will allow you to walk through the fire again but it should stop it moving - just increase the damage so the player dies faster if you want to stop the player getting through the fire.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-12-22 13:26:35
Your offset time is: 2024-12-22 13:26:35