Scripts / World Script.

Author
Message
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 11th Feb 2015 20:31 Edited at: 12th Feb 2015 12:41
The forum page where I posted my world script seems to have some attention but I wanted to create my own thread specifically to organize the world scripts and those that attach to it. The one I posted before and the script had different versions because I altered it for many games so it didn't fit together well. In addition some things weren't working when fpsc was updated.



These are free to use, even in commercial works but credit to Jonathan Blackman of DSA games (Myself).



If you have suggestions or you make a add in script please post it!



Add this to you global.lua



(Script version 1.2)





My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 11th Feb 2015 20:37 Edited at: 11th Feb 2015 20:40
Vending machine Scripts that work with this system.



Drinks (vendingdrink.lua)





Food/Snack (vendingfood.lua)



My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 11th Feb 2015 20:43
In order for anything in the script to function, something need to continuously call Time() function. I use a trigger and make sure all player areas have this.
Timer (runtimer.lua)


My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 11th Feb 2015 20:47 Edited at: 11th Feb 2015 20:48
Eating and Drinking pickup items (Chips, bottled water).



Eat (eat.lua)





Drink (drink.lua)



My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 11th Feb 2015 21:04 Edited at: 12th Feb 2015 12:49
List of available commands!



--Exadion.DSA world script macro commands version 1.2



--Health related

SetMaxHealth(v)

GetMaxHealth()

SetMaxHealthRegen(v) -- Maximum that auto regen can reach

GetMaxHealthRegen()



--Time

SetTime(Hour, Minute)

GetTimeHour()

GetTimeMinute()



--Food

AddFood(v)

SetMaxFood(v)

GetMaxFood()

GetFood()



--Drink

AddDrink(v)

SetMaxThirst(v)

GetMaxThirst()

GetThirst()



--HUD

ShowHudMenu()

HideHudMenu()



--Respect

RemoveRespect(v)

AddRespect(v)

SetMaxRespect(v)

GetMaxRespect(v)



--Money

GetMoney()

SpendMoney(v)

GiveMoney(v)



--Lights

SetLighting(v)

StopLighting()

FlashStart(dark,light)

FlashStop()

DreamStart()

DreamStop()



--Pick up items

GetPickupDist() -- max range

SetPickupDist(v)

SetPickupWeight(v) -- max weight

GetPickupWeight(v)

MoveCollision(boolean) -- objects collide when moving

GetObjId() -- object id of carried object. -1 means no object

GetObjweight() -- weight of current object.

My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 11th Feb 2015 21:08 Edited at: 11th Feb 2015 21:16
Restaurant script make a restaurant with multiple items (Includes stealing/rep loss).



Note: This Script requires Omegacore! Thank you tomjscott.

Omegacore: http://fpscrforum.thegamecreators.com/?m=forum_view&t=209253&b=2



(restaurant.lua)





My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 11th Feb 2015 21:35 Edited at: 12th Feb 2015 01:57
Next update:



I am working hard on updating this the lighting is working for day/night but call special states (darkzones etc) do not work with the newest fpscr version(1.009).. They work on the previous version. Fixed..



Also working on making it more efficient (as suggested trying to use case selects and simplify it).



More macro functions.

My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
shakyshawn8151
11
Years of Service
User Offline
Joined: 9th Nov 2013
Location: United States
Posted: 11th Feb 2015 22:02
wow, amazing, will be nice to see a video with it all running.

CPU; Intel G850 2.9ghz GPU: Raedon HD 7750 1gb 4GB Ram

Windows 10 1TB HD 60GB HD
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 11th Feb 2015 23:28
Can't wait to test some of these

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce 420 GT
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 11th Feb 2015 23:53 Edited at: 12th Feb 2015 06:12
Quote: "wow, amazing, will be nice to see a video with it all running."




I could try to make one but ill need to get a screen capture program.. Know anything that works good?

My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 12th Feb 2015 01:52 Edited at: 12th Feb 2015 03:16
Just finished testing a dark trigger zone. This is used because the regular dark zones no longer work when the world is running (the wold lighting script would simply over write them).



Just note that regardless of name the zone does not have to be dark. (But the example defaults to dark).





(darktrigger.lua)





SetLighting(intensity) -disables day and night and sets lighting to a specific intensity

StopLighting() - returns lighting to normal day/night.



The matching Light zone..

(lighttrigger.lua)





Two more triggers.

Flash trigger causes a screen flash from light to dark each minute. Used to get the players attention but may be an interesting effect elsewhere.

(flashtrigger.lua)





FlashStart(darkest,lightest) -- ends normal lighting and switches to flashing state.

FlashStop - return to normal lighting



Dream state causes random colors to apply to the lighting each minute. I used for a segment involving characters drinking..

(dreamtrigger.lua)





DreamStart() -- begin random effect

DreamStop() -- end random effect

My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 12th Feb 2015 06:30
Quote: "Can't wait to test some of these"


Even better would be and wait for ver 1.2 I plan to get it uploaded here before bed.

It includes several bug fixes.
A pick up and carry item script that run at the same time as culling (one line to default.lua and both culling and pickup dynamic items will be useable.

Improved reputation system. It auto adjust by a set amount every hour. You define a max and the min is zero. The program by default the max is 1000 so it finds half the max. Then every hour, based on the change variable (current default is 10) it moves toward the mean. Up or down. It kinda like the mean is like your an average person. High numbers are like you are well liked, respected. Low numbers are you are bad/disliked. In the restaurant code stealing takes away rep. Doing a quest or helping someone may give rep. By always moving toward the mean it is kind of like people forgive/forget over time. In a open world game, perhaps it could only be possible to do certain missions if you are well liked. You could be shot or arrested for being bad.

Also I split the code into a ton of functions to make it easier for people to edit (and debug).

I also have been trying to remove some unnecessary logic "if" statements for efficiency.

My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
shakyshawn8151
11
Years of Service
User Offline
Joined: 9th Nov 2013
Location: United States
Posted: 12th Feb 2015 17:36
Exadion, use MSI afterburner. I see a lot of people on the forum using other programs, and the video quality is very bad, So I try to tell everyone to use MSI Afterburner, watch a youtube tutorial on how to set it up, after that it will be good to go.
CPU; Intel G850 2.9ghz \ GPU: Raedon HD 7750 1gb \ 4GB Ram

Windows 10 \ 1TB HD \ 60GB HD
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 12th Feb 2015 19:22
Quote: "Exadion, use MSI afterburner. I see a lot of people on the forum using other programs, and the video quality is very bad, So I try to tell everyone to use MSI Afterburner, watch a youtube tutorial on how to set it up, after that it will be good to go.
"


Thanks. I hope you noticed I posted 1.2 last night which included ton of new things including a carry item script that
accounts for the weight of the item (weight is a calculation of the items size).
I will try to make a video but I have a few more things I would like to implement first:
(saving, loading, throw a held item, rotate held item)
My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 12th Feb 2015 19:24 Edited at: 13th Feb 2015 05:59
To make culling and carry script work:

(default.lua)

My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 13th Feb 2015 02:03
Huge improvements are coming!! I have successfully implement saving and loading. For version 1.3!
It saves all 56 essential world variables and reads them back on load. This should be doable automatically..
resuming your game where you were between exit and restarting. Or manually. Just finishing it up.
My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
shakyshawn8151
11
Years of Service
User Offline
Joined: 9th Nov 2013
Location: United States
Posted: 13th Feb 2015 18:23
exadion can you contact me via e-mail? I would like to talk to you, and currently I believe PM's have been turned off.
CPU; Intel G850 2.9ghz \ GPU: Raedon HD 7750 1gb \ 4GB Ram

Windows 10 \ 1TB HD \ 60GB HD
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 13th Feb 2015 22:11
I can but I don't know your address. I am jbb27@pitt.edu .
My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 14th Feb 2015 01:02
Updating the script status! I am still working on the save/load functions but to make it work I got side tracked. Seems as I need an object to move to move to it! This would allow me to reset the player to their last coordinate.. The good news the easiest way to always have an object is to always have the object with the player. The old way always had to have trigger zones to cover them map to call the runtimer. Now I have a permanently attached script that moves and item (that calls the timer) to the player. No trigger zones needed! I should be able to use the use item as a proxy to teleport.

With any luck the next version of the world script should have a simple MovePlayer(x,y,z) which is getting close.

On another note I have been successful in making sure that if the player was holding an object when the game saved the object returns to the player and attaches itself automatically on load. Pick up a box, on load you will still be holding it.

The save state is advancing allot after the player coords resetting are done, the next step will be creating a persistent world (save position of all dynamic items and return them on load) which will be in version 1.3 if possible.
My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 14th Feb 2015 03:35
Yay, first successful test of my integrated TransportPlayerAtWill(x,y,z) command!
My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
exadion
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 1st Nov 2014
Location:
Posted: 17th Feb 2015 07:37
Quick update post I have started assembling a game based on my world script, to allow me to test the script is use. World script 3.5 (internal) is now kinda becoming an archive of scripts but it has greatly expanded capabilities.

Added support for videos through lua interface to VLC media player (custom build).
Expanded saving/loading to now save weapons, ammo and despawn spawn enemies .
Created scripts for 2 way transfers with one open ended side. (example, create on interior and link to 3 outside structures, the player now can enter through any of them and automatically returns to where he cam from on leaving.)
save script also checkpoints.
added level segment scripts, to determine where the player is in the game for saving as well as tracking who to despawn.
Early beta of a custom AI system implemented.


>Add debugging commands... saving current state of characters.
>Need to save add saving lives.
>Beginning work on inventory script and radar script.
>Need to add destroy entities on save/reload
My blog site, free artwork, scripts, textures etc.

http://jadenstockartwork.blogspot.com/
PM
Big Dog Game Studios
12
Years of Service
User Offline
Joined: 18th Jun 2012
Location: Port Angeles, WA
Posted: 3rd Mar 2015 02:21
@exadion These are fantastic scripts! One question though, does this:



do the same thing as setting this on a trigger:



Or is it something different? As it stands, using the HideHuds() command will not even let you see the TAB menu when you are in the editor. Not a huge problem, and easy to work around, but I was just curious. Keep up the awesome work!
GoDevils
10
Years of Service
User Offline
Joined: 24th Sep 2014
Location: Arizona USA
Posted: 3rd Mar 2015 20:27
@Exadion

I'm reading these posts, and while I understand a little, I'm having trouble getting my head around the bigger picture. Do you have a download site for these scripts? Do you have a bigger picture narrative on how all this works with the current system, and what is needed to make them work?

Thanks
"THERE IS NO SPOON"

AMD 6300 6 core 3.5 ghz, Windows 8.1, 8GB ram, GTX 650 2GB ram
AMBOSIRIS
9
Years of Service
User Offline
Joined: 2nd Mar 2015
Location:
Posted: 4th Mar 2015 06:11 Edited at: 4th Mar 2015 08:00
Hey guys i just got into this post here, wow this is amazing for a starter like me.. so much to learn .. :x


my first question here would be this.... how am i inserting this lua scripts into my GG world ?

is this inserted afteryards on a standalone version ?

you said something aboout adding this to my global.lua .... where is this file though ?


thanks ;o)



edit: found the global file , messed around with your food and drink scripts aswell..got your version 1.2 and added it at the end of the current global.lua ... script .... now im getting lua errors evrywhere and insane dynamic light load screens.... defently have to explain further here
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 4th Mar 2015 08:04
C:\Program Files (x86)\Steam\steamapps\common\Game Guru\Files\scriptbank

Make copy of file change name, modify the new file. Never over write the original.

Don't forget to change the standard name in the LUA script for the new scriptname.

Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

AMBOSIRIS
9
Years of Service
User Offline
Joined: 2nd Mar 2015
Location:
Posted: 5th Mar 2015 00:53
do i copy past the gloabl.lua over or under the current global.lua text ??
PM
Noktavian
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 10th Mar 2015 01:54
Hi,

If you make a new file for global.lua, how do you then make that file the stand-point instead of the original.

Thank you in advance
PM
lalemanalex87
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Feb 2015
Location:
Posted: 29th Mar 2015 13:54 Edited at: 29th Mar 2015 15:45
I get and error with the runtimer script says found error in char196 or something l put that in a trigger zone and player is in it and cant see any huds do I have to activate them thanks

edit: runtimer.lua:3:unexpected symbol near char(194) is what shows up when loading game is there something am suppose to but in the runtimer.lua script
PM
shakyshawn8151
11
Years of Service
User Offline
Joined: 9th Nov 2013
Location: United States
Posted: 29th Mar 2015 20:27
cursor shows up on screen using this, any fix?
CPU; Intel G850 2.9ghz \ GPU: Raedon HD 7750 1gb \ 4GB Ram

Windows 10 \ 1TB HD \ 60GB HD
GoDevils
10
Years of Service
User Offline
Joined: 24th Sep 2014
Location: Arizona USA
Posted: 31st Mar 2015 23:52
@Noktavian

You can't really make a copy of global.lua (except for backup purposes) as the engine looks for this global file. It's also not a good idea to add stuff to the global.lua script.

If you have global variables and tables to add, as well as your own common functions, you should do so in a separate file like mygloblal.lua (use whatever name you like). The only thing you add to global.lua is the "require" command. This will attach myglobal.lua to the game, so you can call to it during play.

Hope that helps
Go Devils
"THERE IS NO SPOON"

AMD 6300 6 core 3.5 ghz, Windows 8.1, 8GB ram, GTX 650 2GB ram

Login to post a reply

Server time is: 2024-12-21 13:57:19
Your offset time is: 2024-12-21 13:57:19