SpeechView Script

Started by Unknown_Terror, Tue 30/01/2007 01:22:59

Previous topic - Next topic

Unknown_Terror

Okay, I've looked at the manual and i've not found the answer in there.
I am having a problem

Okay so basically when my character enters one of my rooms i have a region which has Run Script command

2Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, character[LAM].SpeechView = -1;

Then when he makes his way through the darkness and initiates dialogue he doesn't use a speech view which is what i want him to do. Then when he interacts with the lightswitch i do another Run Script

2Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, character[LAM].SpeechView = 4;Ã, 

Which makes it back to normal. But it doesn't....from now on whenever he initiates speech the speechview isn't set to 4 like it should be. it's still set to -1 for some reason..... Is there a way around this?
I tried doing a Script before i set speechview to 4 with "stop" command on the 3rd line but it doesn't like that

Thanks to anyone who can help
"To Live a Perfectly Normal Life, You Must Accept The Fact That Life Will Never Be Normal"

Gilbert

Is it possible that when the light is switched on the character will stand on the region?
In that case you may check in the region whether the light is switched on (with a variable maybe) and only change the view to -1 when the light i soff.

Unknown_Terror

No because when he walks off the region a script runs to disable that region as i only need it for a couple things when he stands on it, thanks for your input though
"To Live a Perfectly Normal Life, You Must Accept The Fact That Life Will Never Be Normal"

Ashen

'stop' is only used in dialog scripting, so it wouldn't like it if you tried to use it in a normal 'Run script' interaction. You might be thinking of 'return', but I don't think you actually need to use it.

Does anything else in the Lightswitch interaction run (change room background/tint, etc)?
I know what you're thinking ... Don't think that.

Unknown_Terror

Yes it changes the room to the lit up version, is this the problem?
By changing room i mean, Character goes from room 4 to room 5 on the same spot he presses the light switch
"To Live a Perfectly Normal Life, You Must Accept The Fact That Life Will Never Be Normal"

Ashen

No, it shouldn't be the problem - I just wanted to check that the Lightswitch interaction was running OK.

So you're using different rooms for the light and dark versions? Could there be something in the 'light' room that's changing the view back? If all else fails, you could always add a 'Player enters room (before fadein)' interaction to the 'light' room that changes the view - but hopefully that won't be necessary.
I know what you're thinking ... Don't think that.

Unknown_Terror

#6
Yea i'm using 2 different rooms for light and dark.....This was before i realised you could change the light levels in a room. But it seems to work perfectly and you wouldn't even notice the room changing.

I will keep messing around with it, if i figure it out i'll post it. It just seems odd that the previous SpeechView script has taken over all the Speechview Scripts...It might have something to do with the room change to be honest. Maybe because the lightswitch is pressed and the script runs in room 4, for some reason it didn't calculate it for room 5 and the rest of the game

EDIT: Ok i got it.....by the way, i hate figuring it out after i've made a post here. It's not that i'm lazy looking for someone else to fix my problems. Just that other peoples input can usually lead people in the right direction.

What i did was in Room 4 After he presses the lightswitch i made a Region in Room 5 where he appears with Run Scripts...Looking like this

While player stands on region - Run Script: Change speechview
Player Walks onto region - Run script: change speechview
Player Walks off Region - Run Script: change speechview, disable region

I ran it once in all region triggers to be certain it run at all

Now it's back to normal....It mustv've been something to do with the lightswitch, it couldn't have run the script properly, or at all.... I had a similar sort of problem earlier where because an interaction changed the room, the commands in the room it changed to made the game freeze. Too much happening at once or something and the problem is that it tries to do the commands i set so quickly it can't catch up with itself. But i found a work-around for that
"To Live a Perfectly Normal Life, You Must Accept The Fact That Life Will Never Be Normal"

Khris

Everything in "While player stands on region" is run 40 times per second. Maybe that's the reason.

Unknown_Terror

Quote from: KhrisMUC on Tue 30/01/2007 08:00:39
Everything in "While player stands on region" is run 40 times per second. Maybe that's the reason.

So in effect i would have to counteract the running script as many times as it was run?
that makes sense, so by adding the new region to change the speechview back to normal while he is standing on it i reversed the effect.
It'd be a whole lot better if you could just End a SpeechView script from running. But nevermind.
"To Live a Perfectly Normal Life, You Must Accept The Fact That Life Will Never Be Normal"

Khris

That's what "player walks onto region" and "player walks off region" are for.
Those are only run once.

"Player stands on region" is only meant for scripting stuff that has to be repeated continously.

Unknown_Terror

Yea ok then, I thought for a while that "While Player Stands on region" just meant after he stopped moving on that region/appeared standing on that region.

At least i can say i won't be making that mistake again.
Thx.

You could mark this post as Solved + Lock it, seeing as i figured out the problem a few posts ago..Cheers.
"To Live a Perfectly Normal Life, You Must Accept The Fact That Life Will Never Be Normal"

SMF spam blocked by CleanTalk