Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
what could be the problem with this:
Code:
					(store_random_in_range,":new_troop5",":dungeonranged1",":dungeonranged2"),
										(entry_point_get_position,83,pos3),
					(entry_point_set_position,1,pos3),
					(add_visitors_to_current_scene,1,":new_troop5",1,1,-1),
					(entry_point_get_position, pos7, 1),
It is inside a mission_template trigger, but when it is executed, the bots spawn were the entry point 1 was before and the entry point is not moved.
 
Patta said:
Code:
(entry_point_get_position,83,pos3),
(entry_point_set_position,1,pos3),
With *_get_* operations, the first parameter is always where the result is stored - the "output parameter" (there might be very few exceptions to this rule, but I don't think there are any), so for other types like *_set_* the order might seem to change; for example:
Code:
(entry_point_get_position, pos1, 83),
(entry_point_set_position, 83, pos1),
Code:
(item_get_slot, ":result", ":item_id", slot_no),
(item_set_slot, ":item_id", slot_no, ":result"),
 
Sometimes i could bite myself...
Thx!

edit: It does not work, could it be that you can't use these entry points any more, that there is a maximum?
 
I'm guessing that the maximum entry point number is 127, like many other things, so 83 should work fine. It's a long time ago, but I vaguely remember something about entry points not being able to be shifted with the module system (at least where the agent spawning operations are concerned, during a running mission), so I have used invisible scene props instead for that sort of thing; you might figure out how to get it to work, though.
 
The Problem with invisible Scene Props would only be that i already have many of these, the Situation is the following: The Players come close to an invisible Scene Prop, and then some enemies spawn. From one Entry Point on, there does not spawn anyone. So these points (i think it starts with number 63) don't work for spawning as it seems. So i have to find another way. And i already have many invisible Props, so this could make it very complicated when someone wants to make a new map for the Game Mode :grin:
Well, i will see. Is it possible to do something with the Numbers you can enter in Edit Mode? You can give every scene prop a number, the same way as you can give entry points a number. Is it possible to get this number and then let the Bots spawn at the scene Prop with the specified number?
 
It doesn't need to be anything the scene maker needs to bother about - you could just spawn the marker scene props as needed, and use the "instance_no" as an index. If you know that you need 20 movable "entry points" you could do this once:
Code:
(set_spawn_position, pos1),
(try_for_range, ":unused" 0, 20),
  (spawn_scene_prop, "spr_marker"),
(try_end),
And then to use number 7, later:
Code:
(scene_prop_get_instance, ":instance_id", "spr_marker", 7), # this is a hidden "can fail" operation, beware
(prop_instance_set_position, ":instance_id", pos3, 1), # the last parameter is only for with version 1.134, so it doesn't bother updating clients
Then store the number of the marker scene prop that bots should spawn at somehow, maybe a in global or a troop slot of the type you are spawning, and set the agent position to the scene prop position in ti_on_agent_spawn.
 
- open module_mission_templates.py
- find the mission_template you want to modify
- find the entry point you want to move
- add mtef_no_auto_reset to the flags field

e.g.
Code:
(1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
to
Code:
(1,mtef_visitor_source|mtef_team_0|mtef_no_auto_reset,0,aif_start_alarmed,1,[]),
 
Caba`drin said:
rabican said:
is there a way to do collsiion detection?

i want to play a sword swing animation, see if it hits anyone, deal damage.

ti_on_agent_hit ?
It's the trigger that is fired in any mission template when an agent is hit by another.

Didn't mean that. I meant like this: hit button, play animation(the natural hitdetection will be off at this point.. uh i think), do stuff when your weapon gently caresses a target. And/or something somethin different like dropping a windmill from the sky at an agent.

As far as i know ti_on_agent_hit and ti_on_scene_prop hit are only ways to get any accurate real collision detection.

Anyway i sort of solved my propblem. Attached scene props on agents , spawned scene prop that will roughly follow the weapon animation and have try_for agents loop going on while this prop is animating with prop_instance_intersects_with_prop_instance checking if the weapon hits anything.  80something try for agents loops per second per ability used seems like it would be bad though, so if anyone has better ideas it would be appreciated.

 
Lueii said:
Somebody said:
A particle system effect displays a bunch of meshes (usually planar) with various (color) blending and rotational effects around a position. It is defined in module_particle_systems.py, and uses a mesh reference (include one in your BRF file).

Lueii said:
Fixed.  Still doesn't work.  What am I doing wrong?
Look at the order of operations. You are trying to set a visitor before resetting the scene and modifying the visitors.

I wasn't getting results then either.  Are you not supposed to do it in Module_game_menus?

Any help?

Code:
    [
      ("camp_trainer",       [],
      "Speak with the innkeep.",       
      [
         (set_jump_mission, "mt_training_ground_trainer_talk"),(modify_visitors_at_site, "$g_training_ground_melee_training_scene"),
         (reset_visitors),
         (set_visitor, 8, "trp_npc2"),
         (set_jump_entry, 5),
         (jump_to_scene, "$g_training_ground_melee_training_scene"),#
         (try_begin),
#        (check_quest_active, "qst_learn_where_merchant_brother_is"),#
      (else_try),
#        (check_quest_active, "qst_save_relative_of_merchant"),
#        (neg|check_quest_succeeded, "qst_save_relative_of_merchant",)
#      (try_end),
         (change_screen_mission),
         (music_set_situation, 0),
         ]),
 
ithilienranger said:
That isn't really an answer. Create a quick string and output that variable at different points.

Output's good, variable values are correct.  Still though, that particular trigger isn't firing. 
 
Lueii said:
Any help?

Code:
    [
      ("camp_trainer",       [],
      "Speak with the innkeep.",       
      [
         (set_jump_mission, "mt_training_ground_trainer_talk"),(modify_visitors_at_site, "$g_training_ground_melee_training_scene"),
         (reset_visitors),
         (set_visitor, 8, "trp_npc2"),
         (set_jump_entry, 5),
         (jump_to_scene, "$g_training_ground_melee_training_scene"),#
#         (try_begin),
#        (check_quest_active, "qst_learn_where_merchant_brother_is"),#
#      (else_try),
#        (check_quest_active, "qst_save_relative_of_merchant"),
#        (neg|check_quest_succeeded, "qst_save_relative_of_merchant",)
#      (try_end),
         (change_screen_mission),
         (music_set_situation, 0),
         ]),
I'm not sure. I could see that you don't have a closing
Code:
(try_end),
yours was commented, so I can recommend only commenting the whole try_ block, including
Code:
(try_begin),
and
Code:
(else_try),
I doubt that's the problem, though...
Does
Code:
$g_training_ground_melee_training_scene
really refer to your desired scene?
 
13exa said:
Im was still confused about Global Variables. Can someone give me a detail guide??
See the syntax link in my sig.

They are marked with "$" at the start; new ones' default value is 0; they maintain their value across all situations and over time, stored in the savegame; messing with the order they appear in the mod sys can cause savegame compatibility to break...
 
Bolkonsky said:
ithilienranger said:
That isn't really an answer. Create a quick string and output that variable at different points.

Output's good, variable values are correct.  Still though, that particular trigger isn't firing.
I don't see any problems with the code you posted before.
 
13exa said:
Well. I want to make a description of my problem.
Examples, I want to make a Game Menus that will give player an Item, but they are must be waiting for some hours. So i take Trade Assessment as Basic.

The Concept:
First, The Confirmation Menu about Waiting for 3 Hours
                                          V

            Rest for Hours = Waiting for Getting Item
                                          V
Last, The Confirmation that Player have the item on the Inventory


My problem is at the Red word. I can't make from Rest Hour to back to "Last, The Confirmation that Player have the item on the Inventory"

Have a solution, Caba' drin?
A global is likely appropriate in this situation. Depending on where the menu is coming from, you could use a few that already exist, such as
"$g_town_assess_trade_goods_after_rest" or "$g_town_visit_after_rest" (if it is not from a town), or create your own. Looking at the trade assessment bit of code is likely exactly what you want to model.
 
Status
Not open for further replies.
Back
Top Bottom