[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4771: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4773: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4774: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4775: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
Skyline Forums • View topic - entity.onUpdateStop( ) call to pass id string to event...
Help with your scripting

entity.onUpdateStop( ) call to pass id string to event...

entity.onUpdateStop( ) call to pass id string to event...

Postby ucm » 18 Nov 2012, 11:03

User avatar
ucm
Skyline Padawan
 
Posts: 69
Joined: 26 Oct 2012, 04:19
Location: USA

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby ucm » 18 Nov 2012, 11:07

Forgot to mention the biggest benefit is that the function would first execute any code immediately at the .updateStop call and ''then'' the object/entity/scene would stop it's update passes until a .updateStart() function is called to 'restart' the update passes...

Then something like having a flag set for whether or not the onFirstUpdate should get called 'again' on a .updateStart() call... something like .callFistUpdateOnUpdateStart = true/false ...... or something xD
User avatar
ucm
Skyline Padawan
 
Posts: 69
Joined: 26 Oct 2012, 04:19
Location: USA

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby StarFire » 18 Nov 2012, 13:36

User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: entity.onUpdateStop( ) вызов передать идентификатор стро

Postby ant0N » 18 Nov 2012, 13:40

Thank you NightHawk! now I understand how it works!!! :D
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby StarFire » 18 Nov 2012, 13:46

Pleased to have helped :D
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby ucm » 19 Nov 2012, 09:32

User avatar
ucm
Skyline Padawan
 
Posts: 69
Joined: 26 Oct 2012, 04:19
Location: USA

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby StarFire » 19 Nov 2012, 11:57

User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby ucm » 19 Nov 2012, 12:33

umm are you saying that you need to manually create the various game states during engine build time in the C++ ide ?

hmmmmmm.... well if we could create our own gamestates then that would be a major advantage....

could you program a document-wide setting for 'user-defined states' then at runtime, the player first checks out the states listed in the settings and then links all the appropriate event handler functions to the user-defined states?

lol i 'think' i know what i'm talking about buuuut i probably don't xD
User avatar
ucm
Skyline Padawan
 
Posts: 69
Joined: 26 Oct 2012, 04:19
Location: USA

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby StarFire » 19 Nov 2012, 12:36

Yes in time there will be a way, we could have a number of user states such as onUpdate_User1
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby ucm » 19 Nov 2012, 12:37

User avatar
ucm
Skyline Padawan
 
Posts: 69
Joined: 26 Oct 2012, 04:19
Location: USA

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby StarFire » 19 Nov 2012, 13:16

The states are only active if they are called, until then they lay dormant and add no load to the game( invisible to the system). If you just used the game main state which is the basic state onUpdate(), onkeyDown() etc the other states don't exist until setState is called. You don't need to add their functions to the script unless you want to activate them. This is designed so you don't need to mange them yourself.
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby Shando » 17 Mar 2013, 09:27

Just a quick question on States......

I presume when a State has already been run, and you've changed to another State, that if you change back to the initial State it will start as if it had never run before?

e.g:

State1 runs
State2 called so State1 exits
State1 called so State2 exits <-- I am assuming that State1 does not remember anything about it's previous life???

Regards

Shando
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby SolarPortal » 17 Mar 2013, 12:07

It does, but if you want to change/reset, use that states onEnter() function.
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby Shando » 17 Mar 2013, 12:40

Hi SolarPortal,

So, if I had some Global Variables that existed in State1, they would be persistent across all States?

Regards

Shando
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby StarFire » 17 Mar 2013, 16:21

yes, the scripts global var is persistent across all states, its only the update loops,enter + exit that change.

hope this helps ;)
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby Shando » 19 Mar 2013, 03:22

User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby StarFire » 19 Mar 2013, 16:20

Hey Shando thank you for the request ;)
I will give this some thought but for now we have added it our feature request list. It sounds like it will be possible, as we added many extra states but have not activated them, if you are happy keeping the generic naming (yes comments our our friend, especially in 6 months time when we have to go back over the code!) we should be able to expose them to lua for you. ;)
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby Shando » 19 Mar 2013, 21:36

Hi NightHawk,

Yes, I'd be happy with generic naming - what does the rest of the community think????

Regards

Shando
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: entity.onUpdateStop( ) call to pass id string to event..

Postby Shando » 14 Dec 2013, 00:20

User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer


Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 6 guests