[OSP] Scripts von Gotha

Users who are viewing this thread

Gotha

Adimi h.c.
Baron
Hallo,

ich wollte einfach mal ein paar Scripts von mir Zurverfügungstellen .. Manche sind sau einfach manche sind etwas schwieriger etc.
Also gebt eure Bewertung, Verbesserungsvorschläge oder ähnliches...


Ich werde den Beitrag einfach immer bearbeiten und neues einfügen falls ich etwas habe.

[list type=decimal]
[*]Rotierendes Windmühlen Rad
[*]Tor Winden nur für Admins
[*]Türen nur für Admins(Keine Teleport Türen)
[*]Servernachricht an alle Senden
[*]Bewegende Zielscheiben
[/list]










Beschreibung:

Tragt im Map Editor bei dem Object ,,windmill_fan_turning"
Bei Var1 nummer die Nummer Eins ein. Daraufhin sollte sich das Rad nach Map restart anzudrehen.

Code:
   ("windmill_fan_turning",sokf_moveable,"windmill_fan_turning","bo_windmill_fan_turning", [
  
  (ti_on_scene_prop_init,
    [#Gotha Rotierendes Windmühlen Rad
	(multiplayer_is_server),
      (store_trigger_param_1, ":instance_id"),
       (prop_instance_get_position, pos8, ":instance_id"),
	   	   (prop_instance_get_variation_id,":var", ":instance_id"),
	   (eq,":var",1),
       (position_rotate_y, pos8, 300),                            #rotation auf y um 300 #/glaube nach rechts
       (scene_prop_set_slot, ":instance_id", windmill, 0),	   
       (prop_instance_animate_to_position, ":instance_id", pos8, 1100),
    ]),
(ti_on_scene_prop_animation_finished, [
(multiplayer_is_server),
    (store_trigger_param_1, ":instance_id"),
    (prop_instance_get_position, pos8, ":instance_id"),
	   (prop_instance_get_variation_id,":var", ":instance_id"),
	   (eq,":var",1),
    (try_begin),
	    (scene_prop_slot_eq, ":instance_id", windmill, 0),
        (position_rotate_y, pos8, 300),                             #rotation auf y um 300 #/glaube nach rechts
        (scene_prop_set_slot, ":instance_id", windmill, 1), 
        (prop_instance_animate_to_position, ":instance_id", pos8, 1100),
		(else_try),
	    (scene_prop_slot_eq, ":instance_id", windmill, 1),
        (position_rotate_y, pos8, 300),                            #rotation auf y um 300 #/glaube nach rechts
        (scene_prop_set_slot, ":instance_id", windmill, 0),        #setzt wieder den slot auf 0 dadurch ensteht ein loop
        (prop_instance_animate_to_position, ":instance_id", pos8, 1100),
	(try_end),
  ]),
  ]),


und dann noch in module_constans.py ,,windmill" definieren.

Code:
windmill = 1#slot fuer die mindmuehle

Beschreibung:

Tragt im Map Editor bei dem Object ,,winch_b"
Bei Var1 nummer die Nummer Eins ein. Daraufhin sollte sich die Tür nur noch von Admins öffnen lassen.

Code:
("winch_b",sokf_moveable|spr_use_time(5),"winch_b","bo_winch", [
   (ti_on_scene_prop_use,
    [
      (store_trigger_param_1, ":agent_id"),
      (store_trigger_param_2, ":instance_id"),
(prop_instance_get_variation_id,":var", ":instance_id"),
(agent_get_player_id, ":player", ":agent_id"),
(try_begin),

##FUER ALLE
      (neq, ":var", 1),
      #for only server itself-----------------------------------------------------------------------------------------------
      (call_script, "script_use_item", ":instance_id", ":agent_id"),
      #for only server itself-----------------------------------------------------------------------------------------------
      (get_max_players, ":num_players"),                               
      (try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
        (player_is_active, ":player_no"),
        (multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
      (try_end),	
(else_try),	  
##FUER ADMINS
	  (eq, ":var", 1),
	  (player_is_admin, ":player"),
	      #for only server itself-----------------------------------------------------------------------------------------------
      (call_script, "script_use_item", ":instance_id", ":agent_id"),
      #for only server itself-----------------------------------------------------------------------------------------------
      (get_max_players, ":num_players"),                               
      (try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
        (player_is_active, ":player_no"),
        (multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
		(try_end),  
		(try_end),  
    ]),
  ]),

Beschreibung:

Tragt im Map Editor bei dem Object ,,castle_f_sally_door_a"
Bei Var1 nummer die Nummer Eins ein. Daraufhin sollte die Tür nur noch für Admins öffnebar sein.

Code:
("castle_f_sally_door_a",sokf_moveable|spr_use_time(0),"castle_f_sally_door_a","bo_castle_f_sally_door_a", [(ti_on_scene_prop_use,
 [
      (store_trigger_param_1, ":agent_id"),
      (store_trigger_param_2, ":instance_id"),

      (multiplayer_is_server),
(neq,":agent_id",-1),
      (agent_get_player_id,":player_no",":agent_id"),
	  (prop_instance_get_variation_id, ":var1", ":instance_id"),
	#  (prop_instance_get_variation_id_2, ":var2", ":instance_id"),
	  
	  
	  #VAR1 0 = FORALL
      (try_begin),#
  (neq, ":var1", 1),
              #for only server itself-----------------------------------------------------------------------------------------------
          (call_script, "script_use_item", ":instance_id", ":agent_id"),
          #for only server itself-----------------------------------------------------------------------------------------------
          (get_max_players, ":num_players"),                               
          (try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
            (player_is_active, ":player_no"),
            (multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
          (try_end),		
   (else_try),
   (eq, ":var1", 1),#fuer admins
(player_is_admin, ":player_no"),
              #for only server itself-----------------------------------------------------------------------------------------------
          (call_script, "script_use_item", ":instance_id", ":agent_id"),
          #for only server itself-----------------------------------------------------------------------------------------------
          (get_max_players, ":num_players"),                               
          (try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
            (player_is_active, ":player_no"),
            (multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
          (try_end),		
		    (try_end),
  ]),
  
   (ti_on_init_scene_prop,
    [
      (store_trigger_param_1, ":instance_no"),
      (scene_prop_set_hit_points, ":instance_no", 1000),
    ]),
     
   (ti_on_scene_prop_destroy,
    [
      (play_sound, "snd_dummy_destroyed"),
      
      (assign, ":rotate_side", 86),
      
      (try_begin),
        (this_or_next|multiplayer_is_server),
		(neg|game_in_multiplayer_mode),

        (store_trigger_param_1, ":instance_no"),      
        (store_trigger_param_2, ":attacker_agent_no"),

        (set_fixed_point_multiplier, 100),
        (prop_instance_get_position, pos1, ":instance_no"),

        (try_begin),
          (ge, ":attacker_agent_no", 0),
          (agent_get_position, pos2, ":attacker_agent_no"),
          (try_begin),
            (position_is_behind_position, pos2, pos1),
            (val_mul, ":rotate_side", -1),
          (try_end),
        (try_end),
      
        (init_position, pos3),

        (try_begin),
          (ge, ":rotate_side", 0),
          (position_move_y, pos3, -100),
        (else_try),
          (position_move_y, pos3, 100),
        (try_end),
      
        (position_move_x, pos3, -50),
        (position_transform_position_to_parent, pos4, pos1, pos3),
        (position_move_z, pos4, 100),
        (position_get_distance_to_ground_level, ":height_to_terrain", pos4),
        (val_sub, ":height_to_terrain", 100),
        (assign, ":z_difference", ":height_to_terrain"),
        (val_div, ":z_difference", 3),

        (try_begin),
          (ge, ":rotate_side", 0),
          (val_add, ":rotate_side", ":z_difference"),
        (else_try),
          (val_sub, ":rotate_side", ":z_difference"),
        (try_end),

        (position_rotate_x, pos1, ":rotate_side"),
        (prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
      (try_end),
    ]),       

    (ti_on_scene_prop_hit,
    [
      (store_trigger_param_1, ":instance_no"),       
      (store_trigger_param_2, ":damage"),
      
      (try_begin),
        (scene_prop_get_hit_points, ":hit_points", ":instance_no"),
        (val_sub, ":hit_points", ":damage"),
        (gt, ":hit_points", 0),
        (play_sound, "snd_dummy_hit"),
      (else_try),
        (neg|multiplayer_is_server),
        (play_sound, "snd_dummy_destroyed"),
      (try_end),

      (try_begin),
        (this_or_next|multiplayer_is_server),
		(neg|game_in_multiplayer_mode),

        (particle_system_burst, "psys_dummy_smoke", pos1, 3),
        (particle_system_burst, "psys_dummy_straw", pos1, 10),
      (try_end),      
    ]),
  ]),

Beschreibung:

Dieser Script teil muss in module_scripts.py.
Ihr müsst bevor dieser Script abgerufen wird etwas im String register s5 speichern.
Z.b. mit (str_store_string,s5,"@MeinText oder was auch immer..."),

Code:
("cf_server_message_syn",  #script_cf_server_message_syn
[
(get_max_players,":max"),
(try_for_range, ":player",1,":max"),
(neq, ":player",-1),
(neq, ":player",0),
(player_is_active, ":player"),
(multiplayer_send_string_to_player, ":player",multiplayer_event_show_server_message,s5),  
 (try_end),
 (server_add_message_to_log, s5),#speichert s5 in den logs
]),

Beschreibung:

Tragt im Map Editor bei dem Object ,,archery_target_with_hit_a"
Bei Var1 nummer die Nummer Eins ein. Daraufhin müsst ihr die Map neustarten/laden und dann sollten sich die Zielscheiben bewegen.

Code:
("archery_target_with_hit_a",0,"arena_archery_target_a","bo_arena_archery_target_a", [
 
 (ti_on_scene_prop_init,#testmove mit archerytarget_move ersetzt # done
(multiplayer_is_server),
    [#Githas Script fuer Moving Targets
      (store_trigger_param_1, ":instance_id"),
       (prop_instance_get_position, pos6, ":instance_id"),
	   	   (prop_instance_get_variation_id,":var", ":instance_id"),
	   (eq,":var",1),
       (position_move_x, pos6, -3500),                    
       (scene_prop_set_slot, ":instance_id", archerytarget_move , 0),	   
       (prop_instance_animate_to_position, ":instance_id", pos6, 500),
    ]),
(ti_on_scene_prop_animation_finished, [
(multiplayer_is_server),
    (store_trigger_param_1, ":instance_id"),
    (prop_instance_get_position, pos6, ":instance_id"),
	   (prop_instance_get_variation_id,":var", ":instance_id"),
	   (eq,":var",1),
    (try_begin),
	    (scene_prop_slot_eq, ":instance_id", archerytarget_move , 0),
        (position_move_x, pos6, 3500),                       
        (scene_prop_set_slot, ":instance_id", archerytarget_move , 1), 
        (prop_instance_animate_to_position, ":instance_id", pos6, 500),
	(else_try),
		(scene_prop_slot_eq, ":instance_id", archerytarget_move , 1),
        (position_move_x, pos6, -3500),                  
        (scene_prop_set_slot, ":instance_id", archerytarget_move , 0), 
        (prop_instance_animate_to_position, ":instance_id", pos6, 500),
	(else_try),
		(scene_prop_slot_eq, ":instance_id", archerytarget_move , 1),
        (position_move_x, pos6, 3500),                         
        (scene_prop_set_slot, ":instance_id", archerytarget_move , 0), 
        (prop_instance_animate_to_position, ":instance_id", pos6, 500),
    (try_end),
]),##############Move Target ende
 #####
   
    (ti_on_scene_prop_hit,#klappt nicht 100%ig
    [
(multiplayer_is_server),
        (store_trigger_param_1, ":instance_no"),
		(set_fixed_point_multiplier,1),
		(position_get_x, ":attacker", pos2),
		(agent_get_player_id, ":player", ":attacker"),
        (prop_instance_get_position, pos5, ":instance_no"),
        (agent_get_position, pos3, ":attacker"),
        (get_distance_between_positions_in_meters, ":dist", pos3, pos5),
		(assign, reg1, ":dist"),
		(str_store_player_username, s1, ":player"),
		(str_store_string, s4, "@{s1} traf die Zielscheibe. Entfernung: {reg1} meter."),
		(call_script, "script_cf_server_message_syn"),	
    ]),

auch hier muss wieder archerytarget_move definiert werden..

Code:
archerytarget_move = 2#slot fuer beweglcihe zielscheibe


Der Thread ist noch nicht fertig... Ich weis auch nicht ob jetzt grade alles richtig und Bug frei ist.. Muss ich morgen genauer nachschauen.

Wenn ihr einen Code nehmt, wäre es nett Credits einzubauen.




mfg
 
Auf dauernder Nachfrage:

Teleporttüren

Code:
("castle_f_sally_door_a",sokf_moveable|spr_use_time(0),"castle_f_sally_door_a","bo_castle_f_sally_door_a", 
    [
    (ti_on_scene_prop_use,
    [
    (store_trigger_param_1, ":agent_id"),
    (store_trigger_param_2, ":instance_id"),

    (multiplayer_is_server),
    (agent_get_player_id,":player_no",":agent_id"),
    (prop_instance_get_variation_id, ":var1", ":instance_id"),
    (prop_instance_get_variation_id_2, ":var2", ":instance_id"),
   (try_begin),
      (eq, ":var2", 0),# Wenn die zweite Variations Nr = 0 ist, Teleport
      (player_is_active, ":player_no"),
      (scene_prop_get_num_instances, ":tp_num", "spr_barrier_sphere"),
      (try_for_range, ":target_no", 0, ":tp_num"),
        (scene_prop_get_instance, ":target_instance_id", "spr_barrier_sphere", ":target_no"),
        (prop_instance_get_variation_id, ":target_var1", ":target_instance_id"),
        (eq, ":target_var1", ":var1"),
        (assign, ":tp_num", -1),
        (try_end),
          (eq, ":tp_num", -1),
          (agent_get_horse,":reiter",":agent_id"),
          (prop_instance_get_position, pos1, ":target_instance_id"),
        (try_begin),#Dafuer da, dass auch Kavalleristen teleportiert werden.
          (eq,":reiter",-1),#Wenn der reiter tot ist
          (agent_set_position, ":agent_id", pos1),
         (else_try),
          (neq,":reiter",-1),#Wenn der reiter lebt
          (agent_set_position, ":reiter", pos1),
        (try_end),
   (else_try),
   #Wenn die zweite Variations Nummer 1 = Kann jeder die Tur auf und zu machen
     (eq, ":var2", 1), 
     (try_begin),
       (player_is_admin, ":player_no"),
       (call_script, "script_use_item", ":instance_id", ":agent_id"),
       (get_max_players, ":num_players"),                               
       (try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
         (player_is_active, ":player_no"),
         (multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
     (try_end),
       (agent_play_sound, ":agent_id","snd_quest_succeeded"),#Spielt nen tollen ekelhaften Sound ab :P eine # vor die Zeile setzen zum entfernen
     (try_end), 
    (else_try),
  #Wenn die zweite Variations Nummer 2 = Kann nur ein admin die Tur auf und zu machen
      (eq, ":var2", 2),
      (call_script, "script_use_item", ":instance_id", ":agent_id"),
      (get_max_players, ":num_players"),                               
      (try_for_range, ":player_no", 1, ":num_players"),
        (player_is_active, ":player_no"),
        (multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
      (try_end),
   (try_end),
  ]),
  
   (ti_on_init_scene_prop,
    [
      (store_trigger_param_1, ":instance_no"),
      (scene_prop_set_hit_points, ":instance_no", 1000),
    ]),
     
   (ti_on_scene_prop_destroy,
    [
      (play_sound, "snd_dummy_destroyed"),
      
      (assign, ":rotate_side", 86),
      
      (try_begin),
        (this_or_next|multiplayer_is_server),
        (neg|game_in_multiplayer_mode),

        (store_trigger_param_1, ":instance_no"),      
        (store_trigger_param_2, ":attacker_agent_no"),

        (set_fixed_point_multiplier, 100),
        (prop_instance_get_position, pos1, ":instance_no"),

        (try_begin),
          (ge, ":attacker_agent_no", 0),
          (agent_get_position, pos2, ":attacker_agent_no"),
          (try_begin),
            (position_is_behind_position, pos2, pos1),
            (val_mul, ":rotate_side", -1),
          (try_end),
        (try_end),
      
        (init_position, pos3),

        (try_begin),
          (ge, ":rotate_side", 0),
          (position_move_y, pos3, -100),
        (else_try),
          (position_move_y, pos3, 100),
        (try_end),
      
        (position_move_x, pos3, -50),
        (position_transform_position_to_parent, pos4, pos1, pos3),
        (position_move_z, pos4, 100),
        (position_get_distance_to_ground_level, ":height_to_terrain", pos4),
        (val_sub, ":height_to_terrain", 100),
        (assign, ":z_difference", ":height_to_terrain"),
        (val_div, ":z_difference", 3),

        (try_begin),
          (ge, ":rotate_side", 0),
          (val_add, ":rotate_side", ":z_difference"),
        (else_try),
          (val_sub, ":rotate_side", ":z_difference"),
        (try_end),

        (position_rotate_x, pos1, ":rotate_side"),
        (prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
      (try_end),
    ]),       

    (ti_on_scene_prop_hit,
    [
      (store_trigger_param_1, ":instance_no"),       
      (store_trigger_param_2, ":damage"),
      
      (try_begin),
        (scene_prop_get_hit_points, ":hit_points", ":instance_no"),
        (val_sub, ":hit_points", ":damage"),
        (gt, ":hit_points", 0),
        (play_sound, "snd_dummy_hit"),
      (else_try),
        (neg|multiplayer_is_server),
        (play_sound, "snd_dummy_destroyed"),
      (try_end),

      (try_begin),
        (this_or_next|multiplayer_is_server),
        (neg|game_in_multiplayer_mode),

        (particle_system_burst, "psys_dummy_smoke", pos1, 3),
        (particle_system_burst, "psys_dummy_straw", pos1, 10),
      (try_end),      
    ]),
  ]),
Das ganze ist auf Native Multiplayer ausgelegt.
Hab es versucht, ein wenig zu formatieren.
 
you%2Bsir%2Bhave%2Bjust%2Bwon%2Bthe%2Binternet%2Band%2Bmy%2Bheart%2B_5d28eb4e5cf9c537894b11130277823a.jpg


Ich habe es endlich geschafft ihn zum OSP zu bewegen <3!
 
Danke !  :smile:

You can added the sound for the windmill




module_scene_props.py
  ("windmill_fan_turning",sokf_moveable,"windmill_fan_turning","bo_windmill_fan_turning", [
 
  (ti_on_scene_prop_init,
    [#Gotha Rotierendes Windmühlen Rad


        (play_sound, "snd_windmill_turning", sf_looping),

(multiplayer_is_server),
      (store_trigger_param_1, ":instance_id"),
      (prop_instance_get_position, pos8, ":instance_id"),
    (prop_instance_get_variation_id,":var", ":instance_id"),
  (eq,":var",1),
      (position_rotate_y, pos8, 300),                            #rotation auf y um 300 #/glaube nach rechts
      (scene_prop_set_slot, ":instance_id", windmill, 0),  
      (prop_instance_animate_to_position, ":instance_id", pos8, 1100),
    ]),
(ti_on_scene_prop_animation_finished, [
(multiplayer_is_server),
    (store_trigger_param_1, ":instance_id"),
    (prop_instance_get_position, pos8, ":instance_id"),
  (prop_instance_get_variation_id,":var", ":instance_id"),
  (eq,":var",1),
    (try_begin),
    (scene_prop_slot_eq, ":instance_id", windmill, 0),
        (position_rotate_y, pos8, 300),                            #rotation auf y um 300 #/glaube nach rechts
        (scene_prop_set_slot, ":instance_id", windmill, 1),
        (prop_instance_animate_to_position, ":instance_id", pos8, 1100),
(else_try),
    (scene_prop_slot_eq, ":instance_id", windmill, 1),
        (position_rotate_y, pos8, 300),                            #rotation auf y um 300 #/glaube nach rechts
        (scene_prop_set_slot, ":instance_id", windmill, 0),        #setzt wieder den slot auf 0 dadurch ensteht ein loop
        (prop_instance_animate_to_position, ":instance_id", pos8, 1100),
(try_end),
  ]),
  ]),


module_constans.py
windmill = 1#slot fuer die mindmuehle

module_sounds
("windmill_turning",sf_2d|sf_priority_10|sf_vol_4|sf_looping, ["windmill_t.ogg"]),

Of course, make the sound with wavausore/ogg convertion/place the sound at warband/mod/"mod name"/sounds.

It's a located sound, you can hear it just if you are arond the windmill :smile:

edit: but for me, it's better with

module mission template (in towns for ex)  :mrgreen:
      (0, 0, 0,

      [

        (party_slot_eq,"$current_town",slot_party_type, spt_town),
        (eq, "$current_town", "p_town_4"),  # where i have a windmill   

          ],
      [
          (call_script, "script_cf_turn_windmill_fans", 0),
          ]),


module script
  # script_cf_turn_windmill_fans
  # Input: arg1 = instance_no (none = 0)
  # Output: none
  ("cf_turn_windmill_fans",
    [(store_script_param_1, ":instance_no"),
      (scene_prop_get_instance, ":windmill_fan_object", "spr_windmill_fan_turning", ":instance_no"),
      (ge, ":windmill_fan_object", 0),
      (prop_instance_get_position, pos1, ":windmill_fan_object"),
      (position_rotate_y, pos1, 10),
      (prop_instance_animate_to_position, ":windmill_fan_object", pos1, 100),
      (val_add, ":instance_no", 1),
    (play_sound,"snd_windmill_turning"),   
      (call_script, "script_cf_turn_windmill_fans", ":instance_no"),
  ]),

module sounds
("windmill_turning",sf_priority_9|sf_vol_10, ["windmill1.wav","windmill2.wav","windmill3.wav"]),#3 random sounds "CRrrrr"  :lol:
 
FantasyWarrior said:
Danke !  :smile:

You can added the sound for the windmill




module_scene_props.py
  ("windmill_fan_turning",sokf_moveable,"windmill_fan_turning","bo_windmill_fan_turning", [
 
  (ti_on_scene_prop_init,
    [#Gotha Rotierendes Windmühlen Rad


        (play_sound, "snd_windmill_turning", sf_looping),

(multiplayer_is_server),
      (store_trigger_param_1, ":instance_id"),
      (prop_instance_get_position, pos8, ":instance_id"),
    (prop_instance_get_variation_id,":var", ":instance_id"),
  (eq,":var",1),
      (position_rotate_y, pos8, 300),                            #rotation auf y um 300 #/glaube nach rechts
      (scene_prop_set_slot, ":instance_id", windmill, 0),  
      (prop_instance_animate_to_position, ":instance_id", pos8, 1100),
    ]),
(ti_on_scene_prop_animation_finished, [
(multiplayer_is_server),
    (store_trigger_param_1, ":instance_id"),
    (prop_instance_get_position, pos8, ":instance_id"),
  (prop_instance_get_variation_id,":var", ":instance_id"),
  (eq,":var",1),
    (try_begin),
    (scene_prop_slot_eq, ":instance_id", windmill, 0),
        (position_rotate_y, pos8, 300),                            #rotation auf y um 300 #/glaube nach rechts
        (scene_prop_set_slot, ":instance_id", windmill, 1),
        (prop_instance_animate_to_position, ":instance_id", pos8, 1100),
(else_try),
    (scene_prop_slot_eq, ":instance_id", windmill, 1),
        (position_rotate_y, pos8, 300),                            #rotation auf y um 300 #/glaube nach rechts
        (scene_prop_set_slot, ":instance_id", windmill, 0),        #setzt wieder den slot auf 0 dadurch ensteht ein loop
        (prop_instance_animate_to_position, ":instance_id", pos8, 1100),
(try_end),
  ]),
  ]),


module_constans.py
windmill = 1#slot fuer die mindmuehle

module_sounds
("windmill_turning",sf_2d|sf_priority_10|sf_vol_4|sf_looping, ["windmill_t.ogg"]),

Of course, make the sound with wavausore/ogg convertion/place the sound at warband/mod/"mod name"/sounds.

It's a located sound, you can hear it just if you are arond the windmill :smile:

edit: but for me, it's better with

module mission template (in towns for ex)  :mrgreen:
      (0, 0, 0,

      [

        (party_slot_eq,"$current_town",slot_party_type, spt_town),
        (eq, "$current_town", "p_town_4"),  # where i have a windmill   

          ],
      [
          (call_script, "script_cf_turn_windmill_fans", 0),
          ]),


module script
  # script_cf_turn_windmill_fans
  # Input: arg1 = instance_no (none = 0)
  # Output: none
  ("cf_turn_windmill_fans",
    [(store_script_param_1, ":instance_no"),
      (scene_prop_get_instance, ":windmill_fan_object", "spr_windmill_fan_turning", ":instance_no"),
      (ge, ":windmill_fan_object", 0),
      (prop_instance_get_position, pos1, ":windmill_fan_object"),
      (position_rotate_y, pos1, 10),
      (prop_instance_animate_to_position, ":windmill_fan_object", pos1, 100),
      (val_add, ":instance_no", 1),
    (play_sound,"snd_windmill_turning"),   
      (call_script, "script_cf_turn_windmill_fans", ":instance_no"),
  ]),

module sounds
("windmill_turning",sf_priority_9|sf_vol_10, ["windmill1.wav","windmill2.wav","windmill3.wav"]),#3 random sounds "CRrrrr"  :lol:

You can't hear it in native anyway :razz:
 
The sound work  :smile:

And i have a "sound box" technique (for ex: for sea, river, watter fall...) place an invisible scene prop at the good place.


Module scene prop
  ("soundbox_sea",0,"0","0",
  [
  (ti_on_scene_prop_init,
 
    [
        (play_sound, "snd_sea", sf_looping),           
    ]),
  ]),

Module sounds
("sea",sf_2d|sf_priority_9|sf_vol_6|sf_looping, ["sea.wav"]),

I've made tests with 15 sound box with priority_9 + music and other sounds = no problem.

And i have an animated watermill too  :razz:

Just make a watermill fan an name it "watermill"
mGDBP.jpg


And copy the codes like for "windmill" (i've made the sound in a diferent place than the water  ou windmill scene prop, in a sound box, you can hear it just if you are at 10 meters around the prop (or her sound box...)) .


module scene prop
  ("watermill",sokf_moveable,"watermill","bo_watermill",
  [

  ]),

Module mission template
      (0, 0, 0,

      [
        (party_slot_eq,"$current_town",slot_party_type, spt_town),
        (eq, "$current_town", "p_town_15"),     
          ],
      [
          (call_script, "script_cf_turn_watermill_fans", 0),
          ]),

Or

      (0, 0, 0,

      [
          (call_script, "script_cf_turn_watermill_fans", 0),     
          ],
      [

          ]),


Module script
  ("cf_turn_watermill_fans",
    [
        (store_script_param_1, ":instance_no"),
      (scene_prop_get_instance, ":watermill_object", "spr_watermill", ":instance_no"),
      (ge, ":watermill_object", 0),
      (prop_instance_get_position, pos1, ":watermill_object"),
      (position_rotate_y, pos1, 10),
      (prop_instance_animate_to_position, ":watermill_object", pos1, 100),
      (val_add, ":instance_no", 1),   
      (call_script, "script_cf_turn_watermill_fans", ":instance_no"),
  ]),


:razz:

Sorry for the english langage, Danke  :smile:
 
Back
Top Bottom