Animating object and dialog problems

Started by , Thu 25/09/2003 19:40:45

Previous topic - Next topic

Do0kie

Hi
First of all I'd like to apologize I'm not registered, even though I've been watching this forum for a couple of months now. I'll register soon, I promise.
I started making a game, some of my characters are ready, so are some rooms and the story.
However, I've got some problems.
First: I want to use and animated object in a certain room. Let's say it's room #4, which it actually is. I want the object to animate as soon the room loads, and I've got no idea how to do this. I tried:

function on_event (int event, int data) {
 if (event == ENTER_ROOM) MoveToWalkableArea(GetPlayerCharacter());
else if ((event == ENTER_ROOM)&&(data==4)) {MoveToWalkableArea(GetPlayerCharacter()); SetObjectView(0,12);
AnimateObject(0,0,0,1);
}}

but nope, it didn't animate. The only way I can animate the object is by interacting with it, but that's quite lame, so please help me.

Second problem:
When I talk to a character he is supposed to give me something. But it seems as if the dialog script can't handle the addinventory function, even though I get no error message. What can I do? Oh, and once the player character gets that inventory item, the option to ask for it should be permanently removed. That cand be done easily with variables, but when I increment a var in the dialog script, the main script doesn't recognize it as incremented.

Thanx in advance for your help.

P.S. Sorry if these topics have already been discussed, but I searched the entire forum and didn't find anything that could help me with them...

SSH

#1
1. Why not set up a script under "Enter room - after fadein" in the room interactions editor?

but anyway:
you need to swap the order of yours ifs around: becuase the "else" means it will never find the second condition true!

2. can you post your relevant dialog and main script so we can have a look?
12

JD

Hello Do0kie,

About your first problem: You should use the AnimateObject(0,0,0,1); command
in the "Player enters room" Interaction. That should work!

About the second problem: How are you trying to run the AddInventory function?
This is what the manual says about it:

* run-script X
Runs global text script function "dialog_request", with X passed as the single parameter. This allows you to do more advanced things in a dialog that are not supported as part of the dialog script. The "dialog_request" function should be placed in your game's global script file, as follows:


 function dialog_request (int xvalue) {
   // your code here
 }
 
I think you should use that. If you need any further help just ask.

Do0kie

Hey, thanx guys! I've been searching for a room_load function for several days now, but it never crossed my mind to look at the icons in the room settings window... ;)
As for the other issue, I was wondering how to get an inventory item when the character talks to another character and selects a certain option. For instance, if the options were:
1 - I don't want it
2 - I want it
3 - I don't know
when I click option 2 (I want it), the character should get that certain item. Also, I need to know how to use variables to check whether the player character has got that item and how to use them in order to disable the 2nd option in order not to get that item again.

Thanx again!

JD

Here is the dialog script for the inventory thing. You don't have to use
variables for this, since the dialog editor has built in functions to handle this:

Quote
// dialog script file
@S  // dialog startup entry point
EGO: "Hi"
Man: "Hello"

@1  // option 1 (dont want it)

@2  // option 2 (want it)
Ego: "I want it"
Man: "Here..."
add-inv 3 (adds inventory item 3 to the player's inventory)
option-off 2 (disables option number 2, "I want it")
stop

@3  // option 3 (dunno)

SMF spam blocked by CleanTalk