Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
hi,
I have some weird problems with spawn points, it's like with every troop spawning the spawn point is moving right and the next time troops are spawning there they are like 50 metres right of the actual spawn point. Does anyone know the problem?
 
Yes, can't be fixed. Its just the way M&B spawns troops. Sometimes it spawns them in a line putting the next one in front, as well.
 
No, I don't mean troops spawning in a line.
I have a spawn point in a scene and spawn the first 10 troops there and a minute later the next 10, but the second group doesn't spawn on the spawn point, it spawns right of it which is pretty weired, because they also spawn outside of the battlefield in nothing.
 
2 things

What is the difference between the variables ":num_troops... and "$number...?
how do you use the strings type reg(24) and the rest? And what do tghey have to do with global parameters?
 
morgoth2005 said:
2 things

What is the difference between the variables ":num_troops... and "$number...?
how do you use the strings type reg(24) and the rest? And what do tghey have to do with global parameters?

: instead of $ means it is  alocal variable.  That means it stops existing once you exit whatever block you are in (I believe).

So if you have

(try_for_range, ":blah", 0, 10),

(try_end),

Then it should only exist between the try begin and try end...at least that's how I believe the scope works.

if you use it without assigning it it will be a random number.

reg(24) is not a string register.  The numebric registers are basically the same as regular variables but can be use within strings such as in a dialog "Yes, sir, that will be {reg24} gold."

For strings you must load them into the string registers such as (str_store_string, 24, str_warning_message),
then use it in a dialog or menu as "warning: {s24}"

It's a pain in the ass.
 
I've just heard about this ai_mask command from Cartread's Catacombs mod, and I'm wondering, can it be used in a scene so that until you get inside a certain radius of someone they do not attack?
 
Highlander said:
No, I don't mean troops spawning in a line.
I have a spawn point in a scene and spawn the first 10 troops there and a minute later the next 10, but the second group doesn't spawn on the spawn point, it spawns right of it which is pretty weired, because they also spawn outside of the battlefield in nothing.

Yeah, this is just how it works.
 
Bryce: Scopes in m&b are somewhat looser defined than that. You could think of the scope as the outmost block of code containing the statement. That sentence is a bit vague, I realize; in practice each script consists of one block. Any local variable referenced in a script is defined for all portions of that script, regardless of try-blocks.
For trigger the conditions are one scope, and the "body" is another separate scope. The same principle holds for dialogs, etc.

Morgoth: String registers have two uses, and two uses only:
1) You can put values in them using the various str_store_xxx commands (which you can find in header_operations.py); and you can clear them using the str_clear command.
2) They can be referenced in strings displayed using the display_message command, using the notation {s#} where '#' is the number of the string-register.

For instance, if you have an entry in your module_strings.py file that looks like this:
Code:
("lets_meet_in", "Let's meet in {s10}."),
and a script with the following code:
Code:
(str_store_party_name, 10, "p_zendar"),
(display_message,"str_lets_meet_in"),
then that piece of code will display the message
Code:
Let's meet in Zendar.
when it's executed.

The {s10} part in the string-entry means "put the current contents of string-register 10 here", while the (str_store_party_name, 10, "p_zendar") part means "store the name of the party p_zendar in string-register 10".
 
Leprechaun said:
I've just heard about this ai_mask command from Cartread's Catacombs mod, and I'm wondering, can it be used in a scene so that until you get inside a certain radius of someone they do not attack?
AFAIK there's no such command, I believe it refers to a helper scene prop. Theoreticly you are able to animate a scene prop to follow an agent, but I doubt that would work very well.

I've got a question too.
How do you make shadows be cast on scene props, not only terrain?
 
How do you make shadows be cast on scene props, not only terrain?

This happens automatticaly, you don't have to change anything. If you made a new scene prop and it's not getting shadows(it's all light, if you know what I mean) then you got the wrong material settings assigned to it. just open brfedit, find the material and find the part where there are setting (shaders etc) and a number. If I'm not mistaken the number for scene props is simply "2" (it sets something like "no lightning". can't remember.
 
Manitas said:
Leprechaun said:
I've just heard about this ai_mask command from Cartread's Catacombs mod, and I'm wondering, can it be used in a scene so that until you get inside a certain radius of someone they do not attack?
AFAIK there's no such command, I believe it refers to a helper scene prop. Theoreticly you are able to animate a scene prop to follow an agent, but I doubt that would work very well.
Cartread said:
The monsters are ai_mask so they only notice you after you bust down their door.

I shall have to query Cartread on this, as it's probable I'm misinterpreting something.
 
bryce777 said:
Anyone know of any upper limit on the number of entry points possible in a scene?
As far as I know it's 30 or 33.

By the way, what's the limit of positions? I once tryed 200, but it gave me some errors.
 
AHA!


Cartread said:
Leprechaun said:
Cartread said:
The monsters are ai_mask so they only notice you after you bust down their door.

What exactly does this command do? Does it suppress the combat AI until you get within a certain radius of the, or something? I'd love to know how it works.

I'm not exactly certain, but aif_group_bits & aif_group_mask (i didn't notice any differences) seem to keep a troop still until it "sees" (doesn't go through collision meshes, usually) an enemy troop, then it goes to alarmed.


That looks handy.
 
Leprechaun said:
Cartread said:
I'm not exactly certain, but aif_group_bits & aif_group_mask (i didn't notice any differences) seem to keep a troop still until it "sees" (doesn't go through collision meshes, usually) an enemy troop, then it goes to alarmed.

That looks handy.
The only flag is aif_start_alarmed.
The two are not flags, they are just utility constants.
aif_group_bits tells how many bits a value has to be shifted to the right, aif_group_mask is an overlay mask used to get the actual value of the flags field.

However, this might have an unintentional significance. If you set the flag to aif_group_bits it's equivalent to unsetting all flags, also the start_alarmed.
On the other hand if you set it to aif_group_mask, it's like you set all the possible flags to 'on', so maybe there are some flags that are not published to the module system.
The isue might be worth further investigation.
 
Highlander said:
bryce777 said:
Anyone know of any upper limit on the number of entry points possible in a scene?
As far as I know it's 30 or 33.

By the way, what's the limit of positions? I once tryed 200, but it gave me some errors.

Ok, thanks.  Too bad it's not higher.... Have not used positions at all so far....
 
Status
Not open for further replies.
Back
Top Bottom