A "stupid" script issue -1 reply

Please wait...

insanelazarez

Here take this basic equipment

50 XP

27th April 2008

0 Uploads

121 Posts

0 Threads

#1 10 years ago

Hello guys, My problem is with the "escape_dialog". I did this several times and it works but... i did something wrong AFTER. The first change is after the medkit to fox dialog. I have this error:

Expression : fatal error Function : CScriptEngine::lua_error File : E:\stalker\patch_1_0004\xr_3da\xrGame\script_engine.cpp Line : 73 Description : Arguments : LUA error: ....r. - shadow of chernobyl\gamedata\scripts\_g.script:20: bad argument #2 to 'format' (string expected, got no value)

In that part of the script i have this...

--' fox help

function transfer_medikit_to_fox (player, wounded) wounded:set_relation(game_object.friend, player) db.actor:give_info_portion("escape_fox_heal")

for i = 1, 8 do local spawn_position = vector():set( 75.11, 10.08, 607.41 ) alife():create("val_bandit_respawn_4", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() )

end ----------»»»»»» Is this a mistake? end

With the first dialog with wolf, this...

function give_weapon_to_actor (trader, actor) dialogs.relocate_item_section(trader, "wpn_usp", "in") dialogs.relocate_item_section(trader, "ammo_11.43x23_hydro", "in") dialogs.relocate_item_section(trader, "stalker_outfit", "in") dialogs.relocate_item_section(trader, "wpn_vintorez", "in") dialogs.relocate_item_section(trader, "ammo_9x39_pab9", "in") dialogs.relocate_item_section(trader, "ammo_og-7b", "in") dialogs.relocate_item_section(trader, "wpn_knife", "in") dialogs.relocate_item_section(trader, "medkit", "in") dialogs.relocate_item_section(trader, "medkit", "in") dialogs.relocate_money(trader, "2750", "in")

end------------»»» Is this wrong? Because the the spawns are right here...

for i = 1, 9 do local spawn_position = vector():set( 52.61, 3.71, 508.30 ) alife():create("pri_respawn_neutral", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 2 do local spawn_position = vector():set( 28.85, 17.53, 668.07 ) alife():create("ros_killer_respawn_4", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("ros_killer_respawn_3", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 5 do local spawn_position = vector():set( 79.10, 12.05, 166.74 ) alife():create("pri_respawn_military", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("esc_soldier_respawn_specnaz", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end end----------»»»»»» And this one, wrong too?

--' Escape blockpost box

And the bribe under the bridge...

function give_soldiers_bribe(actor, npc) dialogs.relocate_money(npc, 500, "out")

for i = 1, 3 do local spawn_position = vector():set( 79.10, 12.05, 166.74 ) alife():create("val_bandit_respawn_4", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("val_bandit_respawn_3", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("val_bandit_respawn_2", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 5 do local spawn_position = vector():set( 11.48, 2.17, 292.68 ) alife():create("tushkano_normal", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end end -------»»»»»»» The same again?

And the reward of fox...

function fox_pay_money(actor, npc) dialogs.relocate_money(npc, 1500, "in") for i = 1, 2 do local spawn_position = vector():set( 128.42, 1.12, 309.73 ) alife():create("bar_dolg_respawn_3", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("bar_stalker_respawn_2", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("wpn_rpg7", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("ammo_og-7b", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 3 do local spawn_position = vector():set( 13.06, 13.96, 638.06 ) alife():create("yan_zombied_respawn_1", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("yan_zombied_respawn_2", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("yan_zombied_respawn_3", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 6 do local spawn_position = vector():set( 14.79, 17.82, 675.47 ) alife():create("yan_ecolog_respawn_1", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 1 do local spawn_position = vector():set( 87.25, 6.94, 583.87 ) alife():create("bar_dolg_respawn_3", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("bar_dolg_respawn_2", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 1 do local spawn_position = vector():set( 26.14, 18.09, 686.00 ) alife():create("mil_killer_respawn_4", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("mil_killer_respawn_3", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("mil_killer_respawn_2", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end ---- »»» do i need another "end" here? treasure_manager.get_treasure_manager():give_treasure("esc_secret_truck_goods") end

.

This is my script:[ATTACH]66376[/ATTACH]

Like i said... the spawns are not wrong. The "end" part is a problem to me. I don't know why. Any ideas?

Thanks guys,

Insanelazarez




Gr1ph00n

dez0wave team

50 XP

2nd October 2007

0 Uploads

31 Posts

0 Threads

#2 10 years ago

Hi, i looked at your script, and i can find some mistakes:

function give_weapon_to_actor should be: function give_weapon_to_actor (trader, actor) dialogs.relocate_item_section(trader, "wpn_usp", "in") dialogs.relocate_item_section(trader, "ammo_11.43x23_fmj", "in") dialogs.relocate_item_section(trader, "ammo_11.43x23_hydro", "in") dialogs.relocate_item_section(trader, "stalker_outfit", "in") dialogs.relocate_item_section(trader, "wpn_vintorez", "in") dialogs.relocate_item_section(trader, "ammo_9x39_pab9", "in") dialogs.relocate_item_section(trader, "ammo_9x39_ap", "in") dialogs.relocate_item_section(trader, "ammo_9x39_sp5", "in") dialogs.relocate_item_section(trader, "wpn_rpg7", "in") dialogs.relocate_item_section(trader, "ammo_og-7b", "in") dialogs.relocate_item_section(trader, "wpn_knife", "in") dialogs.relocate_item_section(trader, "medkit", "in") dialogs.relocate_item_section(trader, "medkit", "in") dialogs.relocate_money(trader, 2750, "in") -- 2750, the 2nd argument of this function, must be a number, not a string

--end -- with this end, you close the function, so you musnt use it for i = 1, 2 do local spawn_position = vector():set( 14.79, 17.82, 675.47 ) alife():create("yan_ecolog_respawn_1", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 3 do local spawn_position = vector():set( -241.17, -18.50, -154.80 ) alife():create("pri_respawn_neutral", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() )

end

for i = 1, 4 do local spawn_position = vector():set( -154.49, -17.40, -131.43 ) alife():create("val_bandit_respawn_4", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("val_bandit_respawn_3", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() )

end

for i = 1, 3 do local spawn_position = vector():set( -139.81, -25.73, -435.63 ) alife():create("bloodsucker_normal", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("bloodsucker_strong", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() )

end

for i = 1, 2 do local spawn_position = vector():set( -88.61, -3.15, -72.26 ) alife():create("rad_zombied_respawn_3", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("rad_zombied_respawn_2", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("medkit", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("medkit", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 12 do local spawn_position = vector():set( -206.41, -18.80, -170.09 ) alife():create("pri_respawn_neutral", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 3 do local spawn_position = vector():set( 109.51, -1.31, -0.07 ) alife():create("val_bandit_respawn_4", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("val_bandit_respawn_3", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("wpn_rpg7", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("ammo_og-7b", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 9 do local spawn_position = vector():set( 52.61, 3.71, 508.30 ) alife():create("pri_respawn_neutral", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 2 do local spawn_position = vector():set( 28.85, 17.53, 668.07 ) alife():create("ros_killer_respawn_4", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("ros_killer_respawn_3", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end

for i = 1, 5 do local spawn_position = vector():set( 79.10, 12.05, 166.74 ) alife():create("pri_respawn_military", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) alife():create("esc_soldier_respawn_specnaz", spawn_position, db.actor:level_vertex_id() , db.actor:game_vertex_id() ) end end -- the end should be here

Even if there are some little mistakes, i dont think they cause that CTD. The problem is in _g.script, in function printf(fmt,...); but you can comment out its body as well.




insanelazarez

Here take this basic equipment

50 XP

27th April 2008

0 Uploads

121 Posts

0 Threads

#3 10 years ago

Sorry for the late replay Griph00n. Look man, i solved the problem so... I played ok for several times, but after that some problem related with "stack overflow". I can not play the game at all, and i hate that part. But still... thanks for your reply Griph00n.