Scripts / What have I been up to?

Author
Message
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 12th Oct 2016 23:00 Edited at: 12th Oct 2016 23:11
For those wondering here is a hint:

https://vimeo.com/187088562

ezplatform.lua as I call it is an all in one single script which can be applied to any entity to turn it into a platform.

When finished it will work with my pickuppable script so entities can be picked up, stacked, placed on platforms etc.

The platforms move by a sort of turtle like script, for example the right most platform is executing the following sequence:
{"x-300;y300;t90;z200", "x300;y-300;t-90;z-200"}

Although this was triggered by someone asking about platforms on the forums it is far more flexible as any dynamic entity could be 'animated' using this script.

And yes, when it is finished, it plus the pickuppable script will be free and hopefully, Lee wiling, will be included in future GG releases.
"
Been there, done that, got all the T-Shirts!
PM
granada
Forum Support
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 13th Oct 2016 12:46
Now that Is great news,thank you.

Dave
PM
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 13th Oct 2016 13:29
that's looking great...... much needed.
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 14th Oct 2016 13:51
Very nice work, definitely something we have been needing in the game world.
HP Pavilion Laptop - AMD A8-4555M APU with Radeon(tm) HD Graphics - 1.6GHz, 8GB Memory, Windows 10 Home, 64-bit Operating System.

I've got something to say - It's better to burn out than fade away.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 14th Oct 2016 17:01 Edited at: 14th Oct 2016 17:12
Although the actual platform/entity movement stuff is all sorted, can only rotate in the Y plane until we get some 3d math package added, I'm wondering what game-play things I need to add.

For example I have a global variable which will be set whenever the player is on a platform, currently storing the entity id (from which the platform name name can be accessed) and player offset on platform. What else would be useful?

Also the platform sequence list can contain an 'h' (or 'H') instruction which just means stop where you are and I need to add a mechanism whereby logic elsewhere can get it started again, maybe a function call specifying the entity id or 'full' name, not sure which would be more useful.

let me explain the 'full' name bit, I plan on the first part of the name specifying the sequence the entity will use, for example "escalator1" but you would name the entity with some other info, "escalator1_A" would mean that this is one of multiple escalators and identified uniquely by the additional 'A' part. "escalator1_A_1 would be the first 'step', "escalator1_A_2" the second etc. Each step would execute the same pattern but starting at a different sequence position, when the step reaches the last sequence it would start back at the beginning so a five step escalator sequence might look like this:

seq1 seq2 seq3 seq4 seq5
{"x50;y50","x50,y50","x50;y50","x50,y50","x50;y50","r"}

The "r" at the end just means transport the step back to the original position of the first step, by hiding the first and last step positions the effect would be a constantly moving escalator.

Other 'instructions' that can occur in a sequence are:
"p" (or "P") - Pause, should be followed by a number denoting the number of seconds to wait e.g. "P5"
"v" (or "V") - Velocity, ditto but this time specifying how long each sequence from now on should take e.g. "v10"
"m" (or "M" - move forwards, number this time in number of units, can be negative if you want to move backwards e.g "M-100"
"s" (or "S" - move sideways, -ve for left +ve for right, by number of units e.g."s-200"
"x","y","z" (or "X","Y","Z") pretty self explanatory
"t" (or "T" - turn by angle, e.g. "T-45" will rotate the entity left by 45 degrees.

Up to five movement instructions can be in each sequence but only one of each kind, for example "v10;x500;y200,z-20,t90" would mean:

in the next 10 seconds move from entity.x to entity.x + 500 units, go up by 200 units, move from entity.z to entity.z -20 and rotes by 90 degrees clockwise. All the movements occurring together!

To do the same thing but one by one it would be: "v5","x500","y200","z-20","t90"

Obviously the first sequence would take 10 seconds and the second would take 20 overall as each individual move takes 5 seconds.

If you don't put an "h" or an "r" at the end then the sequence just starts again so in this case the entity would just disappear into the distance climbing and rotating for ever!

For most game uses on single platforms I would expect the movement sequence to simply return to its start position so for example a platform just going backwards and forwards between to points with a slight pause at the ends would look like:

"x500","p2","x-500","p2" (no need to specify a "v" value as it will just take the default which can be configured in the script)

Hope that all makes sense, if anyone has any suggestions feel free to post them.
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 17th Oct 2016 00:52
Hmmm, having a few issues, I've attached the latest script and an example fpm file but I think the issues are engine based.

Issue 1: SetFreezeAngle only appears to take integer values! If the Y angle changes by less than 1 degree it doesn't get applied. This makes it impossible to place the player smoothly on a rotating platform! i.e. the platform rotates smoothly but the player jerks around 1 degree at a time.

Issue 2: There doesn't appear to be any way to directly control the angle of third person player character, the Y angle in this case is applied to the camera rather than the player character, is there anyway to find out the entity id of the third person player character? maybe I could directly rotate the character using the Rotate command?

Issue 3: Even on non-rotating platforms the player being on them results in a very small but annoying jerky appearance, again I think this has something to do with the SetFreezePosition command, maybe it too only works to a low resolution of inputs?

Anyhow the movement of the platforms themselves are very smooth event though I still have quite a bit of work left to do.

Have a play, any feedback will be appreciated.

I still have to add the reset 'r' command, still working out the best way to implement it and I haven't fully tested all combinations (if you use 'm', 'x' and 'z' are ignored because they just don't make any sense in combination).

I am currently figuring out a simple way to add a sense of acceleration and deceleration which will allow smoother transitions and also curved paths rather than straight lines.

When adding a new platform its name must match an entry in both lists in the script, the first list defines the movement sequence and the second defines the size of the platform, only use rectangular platforms at present as I haven't completed the code for circular ones yet so the player will probably just slide off them.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM

Login to post a reply

Server time is: 2024-12-22 23:01:22
Your offset time is: 2024-12-22 23:01:22