Scripts / Changing player variable at runtime

Author
Message
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 13th Jun 2014 21:09
Hi!

I want to change a player variable at runtime via a script. How can I do that?
I should be able to access, and change any entities variable that can be seen in it's properties table in the same manner.

I mean in a language like C/C++ or similar I can access object variables by typing: object.itsVar;
but how to do this in LUA and FPSCR?

www.memblockgames.com
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 13th Jun 2014 21:14
Lua is not fully installed lots of functions not possible yet, also a lot of the things are still hard coded to the engine, like enemy weapons and such, not sure its possible but then im not a coder so maybe what your after is, what variable was you trying to change? maybe your in luck and some1 can see about it?!.

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 13th Jun 2014 21:25
After you've placed out your player (the green arrow) (or any other entity) you can right click them and change things like health, speed etc. In this particual case I wanted to change the players gravity if a certain condition is meet during gameplay. It should work, but as you say, it might be hardcoded into the engine. But a feature like that would really increase our flexibility to make our games. I really hope this can be done somehow. If not, I surely would love to have it implemented!

www.memblockgames.com
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 13th Jun 2014 21:28
yeah i think those are mostly still hard coded to the engine, would be nice to have the gravity change option for if you want to say handglide off a mountain to escape or something like that your right.

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 13th Jun 2014 21:39
I'm a coder and trying to write a swimming script. I have a slight idea on how to do it by manipulating the player properties once the player is under the water surface but since I cannot access the variables I can't continue the script.

www.memblockgames.com
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Jun 2014 23:22
you are correct in that we can not access this variable, the commands for scripting we have are being added at a user level (only the devs of the actual engine can control everything)
this is annoying for people who want (and know how) to control everything but eventually the idea is to have the scripting done on a more user-friendly command based system (i.e. MoveForward(e,v) rather than having to write a full piece of code that would find the specific object's rotation, find it's location and then move it "forwards" based on these values)

in the end it allows for very fast writing of scripts but until all commands are added it does limit potential

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 14th Jun 2014 20:14
This is sad. Even FPSC classic was NOT coder-friendly. But if we look at what the software is: It's not a tool for creating any game, it's a tool for making First person shooters whilst I can understand that a part of the 'gameplay' programming must already be there. The FPS cam itself is coded, and that part of code is not the actual engine. The engine just contain routines and instructions how things shall be done, rendering and stuff.

If you eg. negate (a - sign before tha value) the players gravity, he will instantly travel up, and If this could be done at runtime we could come up with a story where the player is suddenly abducted by aliens or something. If fpsc becomes more frienly for elite coders our imagination for making game storys would expand, thou it could retain it's simplicity.

www.memblockgames.com

Login to post a reply

Server time is: 2024-09-08 04:00:59
Your offset time is: 2024-09-08 04:00:59