Scripts / Scripting help in return for models.

Author
Message
unfamillia
Forum Support
14
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 29th May 2014 22:43
Hi guys,



As some of you may know, I can make models, textures, animations etc, but, my scripting is just plain awful! I can edit some parts of other peoples scripts to meet my own requirements, but, I am at a loss at the moment!



I am after a kind and generous person to help me with a few scripts. In return, I will make a few models for them.



Who is interested in helping me?



Cheers



Jay.

smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th May 2014 01:11
let me know what you want to do and i'll give it a go if i can

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 30th May 2014 04:05
if you ask here im sure many of us would be glad to have a go

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
science boy
16
Years of Service
User Offline
Joined: 3rd Oct 2008
Location: Up the creek
Posted: 30th May 2014 13:31
im with unfamillia on the situation, not hijacking but if unfamillia the workload is too much i can aid thee if need

an unquenchable thirst for knowledge of game creation!!!
unfamillia
Forum Support
14
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 30th May 2014 13:50 Edited at: 30th May 2014 15:49
I have a friend taking a look at a few scripts for me, however, he and his wife are expecting within the next few weeks, so, I don't feel comfortable really adding to his pressures! I think he has enough on his plate, than having to create scripts for me! haha.



So, the scripts that I would really like to have are as follows:



• Spawn entity when enter trigger zone



• Activate an entities animation by pressing 'E' when the player is within a certain distance from the entity.



• Door initially opened when game starts and SLAMS shut when player gets within X distance.



• Move X entity in X direction when player within X distance.



• increase overall ambient light to almost blinding level for a VERY short time, while spawning entity, then, when ambient light returns to previous settings, destroy spawned entity. All this would happen from within a trigger zone.



• Player needs to collect X number of items to combine them in order to progress (like combining parts of an engine to fire up a generator). Items needed will have empty HUD images and once collected, a new HUD image is shown (I will create artwork).



• a simple script to work out the meaning of life




Please keep in mind, I do have a good working knowledge of FPSC. I own both previous versions and have been working with the engine for nearly 5 years, so, please don't feel the need to make things simple for me.



I am just completely lost when it comes to LUA! (or any code for that matter)



If anyone is able to help me, please let me know what models you might need or want and I will swap a model for a script.



The scripts above (except the last one) are all needed for a horror game I am making. So, if you have any cool ideas of scripts that you are working on that would be good additions to my game, please feel free to let loose in this thread!



I must state, for this exchange, I will only create static entities; no weapons, no characters, no animated models.



Thanks for taking the time to read this lengthy post.



Cheers



Jay.

AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 30th May 2014 16:43 Edited at: 30th May 2014 16:46
1 to 6 should be totally possible except for HUD images at the moment, however no.7 i believe many people are working on this and have been for a LONG LONG Time however i shall get right onto to no.7 .



oh i am also expecting but if i do get around to any of these, i will want in exchange..... your first born child. No but really anything i do is free for all im using these scripts to learn

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
tomjscott
User Banned
Posted: 30th May 2014 16:46
For #7:









System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.006
unfamillia
Forum Support
14
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 30th May 2014 16:56
AuShadow



I appreciate you taking the time to look at these for me.



If you don't require any models now, please keep me in mind for the future. A favour for a favour.



If you don't want to ask for models publicly, please feel free to contact me via email. (link below my signature)



tomjscott



Where do I place your script? I tried adding it in a trigger zone and something called, 'God Mode' was activated! Weird!

smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th May 2014 17:53 Edited at: 30th May 2014 22:35
lol



on topic



Quote: "Spawn entity when enter trigger zone"


would this not be easier to spawn the entity based on distance from it? like so - run this script on the entity that you want to spawn



if however you wanted to have a seperate script on the entity then you can use it on another entity (placed nearby) and just replace the (e) with the value of the hidden entity.





Quote: "Activate an entities animation by pressing 'E' when the player is within a certain distance from the entity."




this is the door script, no?

which model are you trying to animate?





Quote: " Door initially opened when game starts and SLAMS shut when player gets within X distance. "




done





Quote: "Move X entity in X direction when player within X distance. "








added some comments to the settings so you can see what they do





Quote: "increase overall ambient light to almost blinding level for a VERY short time, while spawning entity, then, when ambient light returns to previous settings, destroy spawned entity. All this would happen from within a trigger zone. "


this one just refused to let the timer code work right so i ended up using a varible instead but it works fine for me (the standard timer doesnt seem to start at zero sometimes - no idea why)



life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Jun 2014 18:49
spawnzone.lua


life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 1st Jun 2014 23:14 Edited at: 2nd Jun 2014 15:21
Edit i had gTime when it was meant to be g_Time



@smallg to use the inbuilt and start at 0 just use this







With that TimePassed becomes your timer for that script and it starts at 0, when you want it to reset set TimeStamp1 = 0 and it will reset the timer. That's how I done it in the hunger script anyway it resets every 1 second and works a treat

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
unfamillia
Forum Support
14
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 2nd Jun 2014 00:50 Edited at: 2nd Jun 2014 01:06
@smallg



Thanks for looking into the scripts for me!



Quote: "would this not be easier to spawn the entity based on distance from it?"




I want the entity to spawn behind the player, so, they would have had to already walked past it bef
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Jun 2014 01:26 Edited at: 2nd Jun 2014 01:30
ah i see i was using starttimer(e) and gettimer(e) commands and they give some really odd results, sometimes calling it once can be 0 and then calling it straight after can be something huge like 345000... lol

i swear i had it working at 1 point but i will try with this gTime command



nope you ignore the _main part in the file names

just call it animate.lua



i will redo the movement script then with a timer so it'll be more like a jump scare

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 2nd Jun 2014 11:02 Edited at: 2nd Jun 2014 11:04
Yeah I was getting all messed up results with start and get timer but I checked global and found a reference to gTime which seems to be a constant running timer in game so it works well to make smaller timer's from gTime, check the hunger script I put it up and that's what it runs on.



Just to clarify I think gTime is a hard coded variable that we can read and that variable is a running timer

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 2nd Jun 2014 11:05
Gets me thinking I wonder what other variabls are hidden. Might go looking for some more

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 2nd Jun 2014 11:58 Edited at: 2nd Jun 2014 12:00
@smallg sorry for the bad intel it's meant to be g_Time my mistake not gTime



@unfamillia here's a screenshot that i thought captured perfectly why i like and recommend notepad++ for learning Lua in reloaded.



As you can see you can have a cheat s
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Jun 2014 12:19
yh no worries i noticed after trying to use it, i had a look at your hunger script and saw the difference
i did see a g_PlayerHealth = 0 variable inside the globals which i was playing with trying to set player HP but it wouldnt work correctly as the enemies don't seem to fire at a set rate (they slow down) for some reason and also there doesnt seem to be a consistent animation for firing, very odd (thinking about it i didn't try using sound, maybe i could link it to the gunshot sound - may try that later)

i may just have to try notepad++, looks good if it can keep track of if/loops/functions etc

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 2nd Jun 2014 13:41
Yeah and when you make an if statement you can collapse it to see more of your script in one screen.

Out of curiosity what have you been using?

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Jun 2014 13:58
standard notepad

new jumpscare script
name it jumpscare.lua


life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 2nd Jun 2014 15:24 Edited at: 2nd Jun 2014 15:25
Standered code snippets seem to be broken but try (code lang=lua) but with the square brackets of course. I edited my post above and it works with line numbers too

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
unfamillia
Forum Support
14
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 10th Jun 2014 21:35 Edited at: 10th Jun 2014 21:35
Hi Smallg,



The Jumpscare script isn't working mate. It causes the engine to crash before it has loaded the test game. I have attached a screenshot of the error.







Also, I see in a lot of these scripts that I need to input the entity number. How do I find this information? Where?



Cheers



Jay.



PS, You still haven't told me what you want me to make for you!

Attachments

Login to view attachments
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Jun 2014 21:42 Edited at: 10th Jun 2014 21:46
you need to use the prompt command to return the e value (if you apply the jumpscare script to the actual object however you dont need it)

edit; http://fpscrforum.thegamecreators.com/?m=forum_view&t=207801&b=2&msg=2488873#m2488873



and that script works, i just tested it (copy & paste from above), so maybe you copied it incorrectly or added something?

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
unfamillia
Forum Support
14
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 10th Jun 2014 21:51 Edited at: 10th Jun 2014 21:52
Quote: "you need to use the prompt command to return the e value"




I honestly feel out of my depth. I don't even understand what you just said.



I know what the prompt command is; its used to show text or information of the screen and can be used during debugging to help let the user know what is happening. However, I don't understand where to put the prompt command or how to create a simple script to show me the entity number?! So sorry for these dumb questions! Ask me something about modelling to make me feel smart again! Please!!



Quote: "and that script works, i just tested it (copy & paste from above), so maybe you copied it incorrectly or added something?"




What am I doing wrong do you think?



Here is what I am doing.



• Add an entity

• Make it dynamic

• Right click on it and change the default lua to jumpscare.lua (copied directly from above)

• test game

• crash

• come here and cry a little about my coding stupidity



Any help here would be fantabulous.



Cheers



Jay.



PS, are you avoiding me making models for you! I am beginning to develop a complex!

tomjscott
User Banned
Posted: 10th Jun 2014 22:24
I don't know what he means by using the Prompt script to return the e value either. If you want an entity's e value, just create an init function before the entity's main function and set a global variable to remember the e value.



System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Jun 2014 22:42
@tomjscott so the entity now has 2 numbers?
the entity is automatically given an object number (e) when it is placed (from 1 for the first placed upwards - this includes everything, start markers , zone markers, buildings, lights etc etc)

in the post
tomjscott
User Banned
Posted: 10th Jun 2014 22:48
@smallg, I think you're confused. My init script is simply an easy way for you to access a desired entity's already assigned e value. The init function stores off that entity's e value in a global variable. You don't have to go around the map in hunt for
unfamillia
Forum Support
14
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 10th Jun 2014 22:52
Quote: "i dont think you are doing anything wrong as such but your error makes no sense as it works for me, could u try using a different entity?
"


Which entity are you using?

I am using Cardboard Box(Small).

I know it says in your script that if you are applying the script directly to the entity, to leave the entity number at '0'. Have you set the entity as '0' or have you set it as its actual entity number?

smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Jun 2014 23:10
@tom was just checking but ok cool, sounds much nicer - be nice if they added that in the global by default then!


@ unfamilla yep im using the exact code from above, tested on the gargoyle and the (first) barrel, both work fine - the box should to
unfamillia
Forum Support
14
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 10th Jun 2014 23:33
Ok, I don't know what I did originally, but, its working now.

I'm not using the same entity. I am using the Gargoyle as well and it does as it should.

Quote: "local speed = 1"


Can this be a fraction of a number? Like 0.5? Or does it have to be a whole number?

Cheers

Jay

Login to post a reply

Server time is: 2024-12-22 05:29:03
Your offset time is: 2024-12-22 05:29:03