Jump to content

Calls and variables - 1


Thralni

Recommended Posts

You mean parenthases. I don't understand by not knowing where to look. It seems simple, modify the code in ways you think should work, load up the scenario, activate the state in question, and see if it errors. You can even use the print_num() call to help with debugging. If you cannot figure anything out, then come to the boards.

Link to comment
Share on other sites

Ah. Then my definiton of a bracket was wrong.

 

Thanks.

 

EDIT:

 

Okay, this code doesn't do what I want it to do. I have absolutely no clue as to what may be the problem. The onlt thing I know, is there isn't a "Boom_on_char" and no "set_attitude(3)."

 

Code:
 n = 90;		char_ok(n);place_monster((userx - 1),(usery - 2),16,0);put_boom_on_char(n,5,0);set_attitude(n,3);run_animation_sound(61); 
Link to comment
Share on other sites

So... you're trying to place a monser, put a teleport flash on it, and make the monster's attitude neutral, right?

 

The call char_ok doesn't do anything — it's a pure short, a number. You can take that out. You only need to use it if you're checking that the character is alive.

 

Do you know for certain that the character you're placing is going to be creature number 90? The only way that it will be is if 86-89 have already been placed, but 90 has not.

 

This is almost invariably easier if you use a hidden monster and activate_hidden_group.

Link to comment
Share on other sites

Quote:
Originally written by Kelandon:
This is almost invariably easier if you use a hidden monster and activate_hidden_group.
Listen to Kel. Listen to him...

Lis-ten...

Really, this way is way easier, and you can still have the clever-looking flash before the creature appears.
Link to comment
Share on other sites

No, sorry. I got it to work precisely as I want to work. The problem was with the definiton of the creature numbers, but it works now. I didn't know the numbers start at 86, and you can't just choose a random number.

 

The groups are all nice and such, but no. I may be way easier, but it will cost me another two hours to get it all working. I'll have to start replacing creatures and such, until all creatures have the right number, in each town. I have 42 towns. Can you imagine the work? You see, this creatures are summoned by a sort of wand, a special item, which calls a state in the scenario script.

Link to comment
Share on other sites

So... Fixed that last problem with summoned mosters. It wasn't such a drama anyway. I just let the game check if a certain mosters exists.

 

However, what I didn't know: How many mosters are permitted in a town?

 

(I'm so glad I don't have to start changing all towns by adding the with the item summoned monsters smile )

 

EDIT: Oh sorry, realized to late that this is a double post.

Link to comment
Share on other sites

I refer you to the docs, section 2.8, under the heading How Characters Are Identified. Specifically,

 

Quote:
Each town can have at most 120 creatures active in it at any one time. They are referred to by numbers 0 to 119. Different ranges of numbers are used for different sorts of creatures:

 

0-3: The party. The player’s characters have numbers 0 to 3.

4,5: Added characters. You can use calls to have a character travel with the party. That character will be put in one of these two slots. You can only add two characters.

6-85: Placed town characters. You can place up to 80 characters in a town. When you select a character in a town, you will see the character’s number to the lower left. That is the number the character will have in the game. Those preset characters are the only characters that can ever be in these slots. If you place an ogre in slot 43, slot 43 will only ever contain that ogre.

86-119: Added creatures. These slots are for wandering monsters, summoned creatures, and creatures that split.

Link to comment
Share on other sites

@Thralni (Or anyone else interested in another way of achieving the same thing):

 

If for some reason you absolutely do not want to use hidden groups, you could always use this instead:

 

Code:
place_monster((userx - 1),(usery - 2),16,0);n = char_on_spot(userx - 1,usery - 2);put_boom_on_char(n,5,0);set_attitude(n,3);run_animation_sound(61);
Ideally, you would check to make sure that "userx - 1,usery - 2" is empty first. I'll leave that as an exercise for other people to play with. 'Cause I couldn't be bothered right now.
Link to comment
Share on other sites

That is exactly the thing I made abouty a week ago, with automatical checks for amount of monsters, and possible terrain/monsters that may obscure the spot to summon the monster.

 

Thanks for the advice, but I already made something that works perfectly, and is almost the same as you made.

 

No, I'm not a complete beginner at scripting :p

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...