Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Already made it thanks :grin:
but i need help with send_message_to_url script...
Im trying to send data to my php page with GET.
something like this:
index.php?name=MyName&&gold=50&&xp=120
i already made the php and mysql connections so no worry,
only need to know how to send the variables.

Never mind i found it myself,
Now how do i get a player name?
I really need it fast.
 
SnRolls said:
Please guys i need help :sad:
For the questions like this, you can always look in header_operations file, it lists all available operations.

In your case, it's either str_store_player_username if you've got player_id, or str_store_agent_name if you've got agent_id instead.
 
Dawiduh said:
DarkAngel#1 said:
hey people i got thorgrims map editor ages ago and attempted to do some map editing (i'm using it with warband so...) anyway i can edit the map fine and it saves in the editor but when i run the mod the map is the same as the original i have no idea why???

I hope this helps:

Lumos said:
I very, very, very doubt that Dawiduh has M&B installed in
Dawiduh said:
C:\Users\David\AppData\Local\VirtualStore\Program Files (x86)\Moun&Blade\Modules\Native
:mrgreen:

Yeah, I have no idea how that got tere  :neutral: Obviously I didn't install it there and it does not save the games there. Those go here: C:\Users\David\Documents\Mount&Blade Warband Savegames so in Documents not AppData. Weird as hell.

In my case Thorgrim's saves somewhere else... Search the "...Users\your_user\AppData\..." for map.txt and parties.txt and once you found them just copy them to your mod's folder.

If it's not this... I don't know.



Sorry its taken so long to get a reply back , your advice did work Dawiduh thankyou
 
Lav said:
SnRolls said:
Please guys i need help :sad:
For the questions like this, you can always look in header_operations file, it lists all available operations.

In your case, it's either str_store_player_username if you've got player_id, or str_store_agent_name if you've got agent_id instead.
Thank you very very much ! :grin:
I tried to search for that but it just wasnt there.
Its good im learning new things :smile:
 
No, i mean how can i make activation code for each player that joins in for the first time?
Im making an rpg mod.

I found operation that could help: player_get_unique_id
but how can i make that show only if the user isnt registered to the website or something ? :S
 
Do you need one? I never thought high about this idea. Just generate a standard "guest" troop for players who are not yet in database, and show them a suggestion to register.

In fact, with a little bit of creative coding you can allow players to register directly from the game.
 
I just wanna make that players who arent registered in the database, should recieve a message in game that they should activate their account with
their own activation code like: 4053
and if the account is verfied it doesnt show them any message, and thats it.
 
Ok so i couldnt find any dialogue tutorials from here, is there anyone who knows if there is one? :smile:
Gotta make a story for my mod.
 
Ildradil said:
Ok so i couldnt find any dialogue tutorials from here, is there anyone who knows if there is one? :smile:
Gotta make a story for my mod.
Caba`drin said:
xenoargh said:
The first section like this:

Code:
"[ ...some code here... ]"

...is a block that exists to test a condition or series of conditions.

It's only purpose is to return TRUE or FALSE.  And every single Dialog gets checked until a TRUE result occurs.

Secondly, the parts after "start" can only be accessed IF "start" happened, their branch is active, AND their own condition block is TRUE.

So, if you want something that always happens when Generalissimo EvilGuy meets your player on a Tuesday, but you want him to do something else on Wednesday, his "start" might look like so:

Code:
#Start of Dialog block
[
#See header_dialogs for what can be here besides "anyone".  All Dialogs must have a "start".
anyone, "start",
#Start condition block here
[ 
(eq, "$g_talk_troop", "trp_generalissimo_evilguy"),#ONLY RUN ME IF EVILGUY
(try_begin),
(eq, "$g_day_of_week", 2),#DO THIS TUESDAYS
(assign, "$g_conversation_temp",1),
(str_store_string, s17, "@This is my Tuesday conversation start"),
(else_try),
(eq, "$g_day_of_week", 3),#WEDNESDAYS
(assign, "$g_conversation_temp",2),
(str_store_string, s17, "@This is my Wednesday conversation start"),
 (else_try),
(assign, "$g_conversation_temp",3),#IF ALL ELSE FAILS...
(str_store_string, s17, "@This is what I say any other day of the week"),
(try_end),
],
#Condition is TRUE; we're talking to EvilGuy, now we need our custom text:
"s17",
#Now we the Player to be able to say something, even if it's something prosaic like, "leave", to exit this Dialog.
"player_response_or_responses_here",
#Consequences, if any:
[],
#End of dialog block
],
xenoargh said:
I don't like doing Dialogues using a Troop in that first block; it makes it easier to accidentally create logic errors.  I prefer to do it in the Conditions block, like so:

Code:
[anyone,"start", [(eq, "$g_talk_troop", "trp_player_castellan"),], "What can I do for you {playername}", "castellan_talk",[]], 

That means that I can have multiple starts for that Troop, depending on the conditions block returning TRUE, like this:

Code:
[anyone,"start", 
[
(eq, "$g_talk_troop", "trp_player_castellan"),
(eq, "$g_some_game_global", 1),
], "What can I do for you {playername}", "castellan_talk",[]],

[anyone,"start", 
[
(eq, "$g_talk_troop", "trp_player_castellan"),
(eq, "$g_some_game_global", 2),
], "Oh, it's {playername}, that scummy devil, come to bother me again!", "castellan_talk",[]],

The only major exception to this is dealing with Party encounters where you may be talking to any random guy in the Party, for example, the Looter's start:

Code:
[party_tpl|pt_looters|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker),], "{!}Warning: This line should never be displayed.", "looters_1",[
	(str_store_string, s11, "@It's your money or your life, {mate/girlie}. No sudden moves or we'll run you through."),
	(str_store_string, s12, "@Lucky for you, you caught me in a good mood. Give us all your coin and I might just let you live."),
	(str_store_string, s13, "@This a robbery, eh? I givin' you one chance to hand over everythin' you got, or me and my mates'll kill you. Understand?"),
	(store_random_in_range, ":random", 11, 14),
	(str_store_string_reg, s4, ":random"),
	(play_sound, "snd_encounter_looters")
  ]],

Note there that there are not two but four things that must be TRUE:

1.  It's a Party encounter on the overworld.
2.  The Party Template is pt_looters.
3.  $talk_context == tc_party_encounter.
4.  encountered_party_is_attacker must be TRUE
 
SnRolls said:
I just wanna make that players who arent registered in the database, should recieve a message in game that they should activate their account with
their own activation code like: 4053
and if the account is verfied it doesnt show them any message, and thats it.
Well, you send player's name to your webserver with send_message_to_url and parse response in script_game_receive_url_response.

If player's name was not found, your webserver must generate the activation code and save it in the database (or wherever you will store your data) together with player's name and current timestamp. However if there already exists an activation code for this player, it should be used instead. Instead of sending player's data to game server, webserver will send message code that player was not found, and the activation code.

Game server then needs to send the activation code to client, where it can be presented to player using a variety of methods (display_message, dialog_box, presentation, etc).

User then goes to your webserver and registers with his name and activation code (or just activation code). Webserver checks that the activation code indeed exists in the database and creates a new player record, removing activation code from the database.

You will have to periodically clean the database of obsolete activation codes (from players who tried to play but never registered).

Except I still don't understand - why don't you just display a "go to this URL and register" message instead of all this mayhem? Result is absolutely the same, but much less hassle both for you and for player. :smile:
 
I am a little confused, could someone help me.

Code:
("musket_smoke", psf_billboard_3d, "prt_mesh_smoke_1",
     65, 10.0, 0.6, 0.0, 58.0, 1.2,     #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
     (0.0, 0.75), (1, 0),       #alpha keys
     (0.0, 0.7), (1, 0.4),      #red keys
     (0.0, 0.7),(1, 0.4),       #green keys
     (0.0, 0.6), (1, 0.4),      #blue keys
     (0, 1.5),   (0.5, 11.0),   #scale keys
     (0.2, 0.1, 0.1),           #emit box size
     (2, 2, 0),                 #emit velocity
     0.1                        #emit dir randomness
    ),

My particles do not show up, can anyone see anything wrong. I had to fix the particle from being to weak one time. Any hints?
 
Does anyone know if troop DNA parameters actually work in Warband, and if so - what do they actually do?

Because I'm repeatedly trying to add a troop to the scene with the same DNA, but his looks are absolutely random.

Or is it just some kind of hidden parameter to distinguish the agents on the scene from each other?
 
Lumos said:
What is a troop DNA anyways? I've seen it used and mentioned, but I have no real idea waht it is. A way to spawn different/identical agents of the same troop?
That's what I thought and tried to do, with no success. There doesn't seem to be any difference between agents spawned with same DNA, and agents spawned without any DNA - looks of both are randomized within the bounds declared in the troop tuple.
 
cmpxchg8b said:
DNA is used to randomize stuff like troop face and weapon selection. If you use the same DNA, it should give the same results.
Lav, what code do you use to spawn the agent?
This is slightly modified code from Native:
Code:
    ("setup_troop_meeting",
        [
            (store_script_param_1, ":meeting_troop"),
            (store_script_param_2, ":troop_dna"),
            (call_script, "script_get_meeting_scene"), 
            (assign, ":meeting_scene", reg0),
            (modify_visitors_at_site, ":meeting_scene"),
            (reset_visitors),
            (set_visitor, 0, "trp_player"),
            (try_begin),
                (gt, ":troop_dna", -1),
                (set_visitor, 17, ":meeting_troop", ":troop_dna"),
            (else_try),
                (set_visitor, 17, ":meeting_troop"),
            (try_end),  
            (set_jump_mission,"mt_conversation_encounter"),
            (jump_to_scene, ":meeting_scene"),
            (change_screen_map_conversation, ":meeting_troop", ":troop_dna"),
        ]
    ),
And then, in module_game_menus:
Code:
            (call_script, "script_setup_troop_meeting", "trp_test_inf", 10000),
Note that Native version of the script has different last line:
Code:
            (change_screen_map_conversation, ":meeting_troop"),
However this does not seem to affect anything at all.

I have also tried to start a mission instead of map_conversation:
Code:
            (change_screen_mission),
Again, with the same results.

Update. For the record, troop definition is:
Code:
  ["test_inf", "Testing Infantry", "Testing Infantry", 0, 0, 0, fac_commoners, [], def_attrib, wp(100), knows_common, man_face_younger_1, man_face_older_2],
 
Status
Not open for further replies.
Back
Top Bottom