Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - WHAM

#2821
I've tried working on the advise you gave me, Ashen, but I keep getting a parse error. This is the firs global variable I've created, so I put the whole script here, in case you can find out what it keeps complaining about. I've been changing bits and pieces of this for the last hour and something, and am gettin a little bit frustrated. ^^ This might, again, be just something I missed 'cause I lack experience, but heck!


//This is the room script for the door
#sectionstart region1_a  // DO NOT EDIT OR REMOVE THIS LINE
function region1_a() {
  // script for Region 1: Player walks onto region

if (doorsopen == false) {
SetObjectView(0, 3);
AnimateObject(0, 1, 3, false);
// this opens the door
//the next line has an error(?)
doorsopen == true;
}
}
#sectionend region1_a  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart region1_b  // DO NOT EDIT OR REMOVE THIS LINE
function region1_b() {
  // script for Region 1: Player walks off region
if (doorsopen == true) {
SetObjectView(0, 4);
AnimateObject(0, 1, 3, false);
// this closes the door
doorsopen == false;

}

//This is the global script used to create the bool
bool doorsopen;
export doorsopen;

Elsewhere in the game I have door that are opened bu pushing a switch, and I have the doors remain open as you enter/exit the door, but now the script is on a region near the door, as you can see. This poses a totally different challenge, as in the current situation, when the player enters the next room, he is already standing on the region that opens the door, and triggering the door opening animation. I cant disable the region and activate it later, because it would not close the door then, as the player get further away from the door.

Hope you're still following me here.
#2822
No biggie, but this is annoying me:

If you download the version I linked earlier, you'll see whats happening to the doors when you enter them. As you enter the next room, the door animates, and opens again behind you, even though you opened it earlier on the other side.

Any tips on how to get rid of this?

I simply have the doors animate when player steps into a region set in front of the door:

object[0].SetView(3);
object[0].Animate(1, 3);

Thanks'a'again!
#2823
Quote from: Pumaman on Sat 24/03/2007 17:45:41
Just as a side note, I'd strongly recommend against using numbered objects and characters like you've been doing:

object[0].SetView()
character[2].Walk()
etc

It's very difficult to read the code, since you don't know what object 0 is or which character 2 is. Give the objects and characters a script name in the editor, then you can do:

oDoor.SetView()
cDavid.Walk()
etc

which is much easier to read.



This may be easier to read by someone else, but I'm used to using short abbreviations and numbers in the codem and having their meanings written down in a separate .txt file.

Thanks for the tip though, and I might give it a try in the next part, but this first part will be made as it has been started.
#2824
This is no question, but I wanted those interested to see what they've helped me create here.

http://protoni.huittinen.fi/~tkahkone/Compiled.rar

The version behind the link is, as you probably guessed, far from complete, as it lacks voice acting, most sounds, most music, most rooms, and most of everything.

A friend of mine (a great drawer) has promised to help create better animations, that will be used as base for the final characters.

A proper intro will be added too, when I get there.

Thank you all, for helping me out.
#2825
Hahaha!

Thanks for the perfect readymade code! I owe you one big time!
#2826
Ok, call me an asshole for not getting this, but I just dont get the manual on this part at all.

I'm using the BASS base on my game, so I have an inventory already made. When I click on an item in the inventory, the cursor begomes the item, check.

How do I define how the same hotspots react to the use of this item on them?

As in: when I pick a gun from the inventory, and then click on another character, how do I get the shooting to actually happen? (No, I'm not asking about how to assign the views and loops here. Just to be clear.)

UseInventory on character/hotspot? Probably, but what kind of scripts do I define there, and how do I define which inventory item the hotspot reacts to?
#2827
Ok, I'll take some time to read the manuals.

I'll admit it, I get bored reading manuals, and I just want to get creating and learn as I go, thats why I keep asking this stuff.

Thanks again for all the help.
#2828
if (GetGlobalInt(1) == 0) {
character[0].StopMoving();
cAi1.Say("&1 Ok, lets get moving!");
cAi1.Say("&2 Ellie, I want you to check the containers!");
cAi1.Say("&3 Get going!");
cAi2.Say("&1 Yes sir!");
character[2].Walk (269, 140, eBlock);
object[0].SetView(3);
object[0].Animate(1, 3);
character[2].Walk (313,140);
cAi1.Say("&4 Mike, you have to check the engines.");
character[2].ChangeRoom(10);
object[0].SetView(4);
object[0].Animate(1, 3);
cAi1.Say("&5 You know where they are, so get moving!");
cAi1.Say("&6 I have to get to the command room, and send out the distress signal.");
SetGlobalInt(1, 1);
}


Ok, this code works as it is, but where does it set the variable, as in CREATES the variable?

Does this happen automativcally at GetGlobalInt(1)?
#2829
But doesn't this cause the int cutscene to always be zero when read, as it is defined at the start of the script? This is excactly my problem.
#2830
Why did I just start feeling like a moron?...  ;D

Thanks!

But for the future, how can I make a variable that can be called upon any rooms scripts? Is it even possible? I tried setting a variable in the global script, but it couldn't be called upon inside the room. Should it work or was I just... wrong?
#2831
Ok, I'm back... again...

Does anybody have ideas on how to make this script:

character[0].StopMoving();
cAi1.Say("&1 Ok, lets get moving!"); 
cAi1.Say("&2 Ellie, I want you to check the containers!");
cAi1.Say("&3 Get going!");
cAi2.Say("&1 Yes sir!");
character[2].Walk (269, 140, eBlock);
object[0].SetView(3);
object[0].Animate(1, 3);
character[2].Walk (313,140);
cAi1.Say("&4 Mike, you have to check the engines.");
character[2].ChangeRoom(10);
object[0].SetView(4);
object[0].Animate(1, 3);
cAi1.Say("&5 You know where they are, so get moving!");
cAi1.Say("&6 I have to get to the command room, and send out the distress signal.");


To only run once in the game.

The script is run when the player steps into a region, but the second time the player steps into the region, the script is run again, and the game crashes because cAi2 is no longer in the room! I was thinking about making a variable that changes from zero into one the first time this is run, but if I put this variable into the room script, it gets defined into zero every time player enters the room!

I've thought about making a second room, otherwise the same than the first, but without this one region, but this seems a bit troublesome.

My guess is that you people have a simple solution here, but it just eludes me...
#2832
The problem was mislocating the waypoint of the NPC, so that the NPC was trying to move through a blocking object. Moved waypoint, and had the door actually open so that the NPC wasnt trying to walk through the door, and works fine now.

And I had never heard of eblock before ^^. I've tried reading the tutorials, but I've never bumped into that.

Thanks a buch! Getting back to work!
#2833
FIXXED!!!

Figured out the problem myself.

Now for a simple question: How do I get the script to wait for the last one to have been completed before the next part starts?

Situation now: The NPC starts moving, and as soon as the NPC starts moving the door opens.

Wanted situation: The NPC starts moving, reaches his waypoint near the door, the door opens.
#2834
Yeah, I'm back again!

This time I have a new problem going on. In my game's intro, I'm trying to get a character to move to the room's door, and to then go to the next room, but when the NPC wlks onto a region (any region, this one is supposed to change the characters lighting as he walks into the light).

How can I get the NPC to walk over these preset regions. The excact error I get says : "Error: Move character: Character not in current room."

I'm simply using the

"cAi1.Say("&3 Get going!");
cAi2.Say("&1 Yes sir!");
character[2].Walk (296, 140);"

script.
#2835
Hahaha!

I realized my mistake: the original defining of "int tupu" was in the wrong place!

Thanks for the help, I think this will get me quite a bit further with my game.

If I need more help, I'll return to this thread in the future.
#2836
The int tupu; is in this code for now, and thats another problem. I've triedn putting it in global script, but it doesnt work. it just says "undefined symbol 'tupu' ".

EDIT: You were right, the problem was the capital "O":s, but I still cant seem to get the Tupu working.

As it is it is in the global script, and I get the error metioned above.
#2837
Im starting a game, and will probably need quite a bit of scripting help, so I'll make this one thread, and put my questions here as I come up with them.

My first problem is the following:

int tupu = 0;
if (tupu == 0) {Object[0].SetView(7);
tupu++;}
else if (tupu == 1) {Object[0].SetView(8);
tupu--;}

This script gives me an error "variable "[" is already defined." and I have no idea what this means. This script is meant to make a door open when a button is pressed, but if the door is already open, it closes the door.

I am inexperienced with this scripting, but if I'm correct this seems to be very similiar to Java code, with which I have some experience.

Any help, and patience, is truly appreciated.
#2838
Thank you!

I've tried reading the manuals, but I never realized to use "cEgo.Say" (probably because I'm a newbie just starting to learn). Gamemaking AHOY!
#2839
Really sorry for being stupid and all, but:

When I run a script "Display("&1 Looks like a plaque.");" the message appears in a white box (Narrator). Knowing absolutely nothing about these scripts, I have no iea on how do I get the message to appear ar speech on my EGO?

To be excact:
-  How do I get the EGO to enter speech animation (I have the view runing ok)?
-  The message to appear on top of the game character head?
-  The sound to be heard?

If someone could be nice enough to help me out on this, it would be most appreciated.
#2840
The template link is sadly dead.
Any other leads on where to get this?
SMF spam blocked by CleanTalk