Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Im trying to make it that when the main character does not have an item equipped on his person he starts to lose health while traveling on the world map, how can is this possible?
and is it possible to designate zones on world map that require this item or that happens while there are areas that do not need it somehow? would that require complex coord positioning or something not possible?
ive read guides for inventory checks that go off every couple days or hours, for stats and stuff how do I do this for hp?
 
I'm going to be brief here and only point in the general direction.

You need a simple trigger to check every few game hours if an item is equipped, then drop some hp.
Search header_operations.py for the operations, use "equip" and "hp" as search strings.
Triggers -> coding tutorial like everybody else, or read the top of the file.

It's possible to designate regions and check where is the player. Party coords on the map are easy to get both for the main party and locations.
 
Cozur said:
Looking for a trigger that will give castle_1 to kingdom_2 instead of kingdom_1 after a set number of days have passed.
you need to call

script_give_center_to_faction_aux
script_give_center_to_lord
 
Thanks.

Edit:

Trigger looks like this now:

#SECRET FACTION TOWN/CASTLE/VILLAGE
(3 * 24,0,ti_once,[],[
    (call_script, "script_give_center_to_faction", "p_castle_83", "fac_kingdom_20"),
]),
#SECRET FACTION OWNSERSHIP
(3 * 24,0,ti_once,[],[
    (call_script, "script_start_give_center_to_lord", "p_castle_83", "trp_kingdom_20_lord"),
]),

But it does not fire after 3 days, but rather after 18 hours have passed.
 
Cozur said:
But it does not fire after 3 days, but rather after 18 hours have passed.
No idea why that is.
Also, don't use two separate triggers. Either put these two script calls in one trigger, or... I do think that calling give_center_to_faction is redundant when you're calling give_center_to_lord (reference game_start), but I'm not sure. Perhaps someone could shed some more light on this.
But anyways, I wouldn't use two triggers for one thing.
 
MadVader said:
I'm going to be brief here and only point in the general direction.

You need a simple trigger to check every few game hours if an item is equipped, then drop some hp.
Search header_operations.py for the operations, use "equip" and "hp" as search strings.
Triggers -> coding tutorial like everybody else, or read the top of the file.

It's possible to designate regions and check where is the player. Party coords on the map are easy to get both for the main party and locations.

Ah ok, should i define another trigger that checks to see if player hp = 0, player dies and loads that game over screen? I saw a script for that somewhere before. But how can the game tell what 0 hp = death? because ive seen wounded @ 0 hp before. is that just adding the correct stuff to the trigger? like is there a value for wounded and a value for dead or do you add a value for a dead player?

see im trying to add a poison swamp but i want it to kill the player if he stays to long in it without rubber boot item.
 
It's simple really, you only need one trigger to fire every few hours. Note that the player automatically heals with the party Wound Treatment skill, so balance the poison damage.

Trigger condition: player poisoned.
Trigger consequence:
- decrease HP by N (store_troop_health, troop_set_health)
- if HP<=0, game over (a pop-up dialog box, or a menu, or a presentation, followed by (change_screen_quit), just like the retirement in Native)


@Cozur:
There is no start_give_center_to_lord script. You probably get an error while building, but you don't tell us that. The script is called (script_)give_center_to_lord.
Always deal with the build errors and warnings first, or you are going to have bugs.
 
MadVader said:
It's simple really, you only need one trigger to fire every few hours. Note that the player automatically heals with the party Wound Treatment skill, so balance the poison damage.

Trigger condition: player poisoned.
Trigger consequence:
- decrease HP by N (store_troop_health, troop_set_health)
- if HP<=0, game over (a pop-up dialog box, or a menu, or a presentation, followed by (change_screen_quit), just like the retirement in Native)


@Cozur:
There is no start_give_center_to_lord script. You probably get an error while building, but you don't tell us that. The script is called (script_)give_center_to_lord.
Always deal with the build errors and warnings first, or you are going to have bugs.

I haven't got any build errors while compiling, just copied the

Code:
(call_script, "script_start_give_center_to_lord", "p_castle_83", "trp_knight_1_10", 0),

from the module_script that deals with assigning specific centers to certain lords.

I'll give your advice a go.
 
I'm having a problem with the initialize_aristocracy script, I have 8 factions in my mod so far so all I have added to this script is this

(else_try),
(is_between, ":cur_troop", "trp_knight_7_1", "trp_knight_8_1"),
(store_sub, ":npc_seed", ":cur_troop", "trp_knight_7_1"),
(assign, ":ancestor_seed", 37),

(else_try),
(is_between, ":cur_troop", "trp_knight_8_1", "trp_kingdom_1_pretender"),
(store_sub, ":npc_seed", ":cur_troop", "trp_knight_8_1"),
(assign, ":ancestor_seed", 43),
(try_end),

The problem I have is that lords 7_1 to 7_8 and lords 8_1 to 8_8 are now the players son in laws  :???: but the rest are set as they should be.

Anyone know how I can fix this problem.
 
Lumos said:
Use the ******** script_GIVE_CENTER_TO_LORD. Just remove the start_ part. Why are you even asking this?!

Because I used

Code:
script_give_center_to_lord

and still get the error when in-game.

No need to freak out.
 
MadVader said:
It's simple really, you only need one trigger to fire every few hours. Note that the player automatically heals with the party Wound Treatment skill, so balance the poison damage.

Trigger condition: player poisoned.
Trigger consequence:
- decrease HP by N (store_troop_health, troop_set_health)
- if HP<=0, game over (a pop-up dialog box, or a menu, or a presentation, followed by (change_screen_quit), just like the retirement in Native)

ahh thank you very much!
 
Cozur said:
Lumos said:
Use the ******** script_GIVE_CENTER_TO_LORD. Just remove the start_ part. Why are you even asking this?!

Because I used

Code:
script_give_center_to_lord

and still get the error when in-game.

No need to freak out.

Cozur, check your "start_give_center_to_lord" script. On Native's header_operations.py, opcode 23 is store_script_param, and it should have 2 parameters. Yours may have only one parameter. You can use store_script_param_1 or store_script_param_2 instead (assumed that the line of code tried to read 1st or 2nd parameter of the script calling.
 
Status
Not open for further replies.
Back
Top Bottom