debug modding on the fly ingame

Ask questions, discuss ideas, get answers

debug modding on the fly ingame

Postby freddy » Sun Nov 13, 2011 10:02 am

iwé seen this done in youtube clips but i wonder if theres somewhere i can read more about this. i get that addtemplate stuff same as in ordinary modding, but if i want to create a willy for example whats the command. just create willy? or must it be positioned to?

thanks.
User avatar
freddy
 
Posts: 1247
Joined: Sun Oct 18, 2009 4:58 pm

Re: debug modding on the fly ingame

Postby Senshi » Sun Nov 13, 2011 10:06 am

Just create. It will be positioned/spawned right in front of your crosshair.
User avatar
Senshi
 
Posts: 695
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany

Re: debug modding on the fly ingame

Postby Apache Thunder » Mon Nov 14, 2011 6:05 am

Just use the same commands you see in the con files to mod from the console. (the console you get when you press the ~ key that is the the immediate left of the 1 key. (not the 1 key on the numpad...the other one))

Example:

Code: Select all
Object.create Willy


This will spawn a willy in front of your camera facing north.

You can use the active command along with others to alter things ingame from the debugger console just like you would from a con file. You just have to type it in line by line.
ImageImageImage

I have cameras in your head!
User avatar
Apache Thunder
 
Posts: 1199
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA

Postby freddy » Mon Nov 14, 2011 5:30 pm

thanks. unfortunately it wasnt that easy to get the server to spawn objects, it needs a spawner and some coordinates or nothing happens.



the good news is that its easy to change damage settings and score settings :)



there is some delay between the command and the execution but it might be because i run the test server on a really slow old laptop.
User avatar
freddy
 
Posts: 1247
Joined: Sun Oct 18, 2009 4:58 pm

Postby freddy » Thu Dec 15, 2011 8:07 am

i kinda forgot about this lol, its not realy debug modding im after but more like changing mods on a live server without the need to uploading a map patch or game.con and then restart the whole thing. i found theres some limits so one has to be careful with the base instructions when like setting up spawners and adjust it so it can be altered between different modes. once there is a spawner in place one cant easily get rid of it, but its easy to adjust its parameters.

will test some stuff like in the piti_multimod if i can get around to it.

Code: Select all
Var v_mg1
Var v_mg2
Var v_aa1
Var v_aa2
Var v_dg1
Var v_dg2
Var v_jeep1
Var v_jeep2
Var v_apc1
Var v_apc2
Var v_arty1
Var v_arty2
Var v_ltank1
Var v_ltank2
Var v_htank1
Var v_htank2
Var v_fighter1
Var v_fighter2
Var v_heli1
Var v_heli2
Var v_dest1
Var v_dest2
Var v_battle1
Var v_battle2
Var v_carrier1
Var v_carrier2
Var v_pt1
Var v_pt2

game.customGameName -> v_modname
if v_modname == BF1942

v_mg1      = stationary_mg42   
v_mg2      = stationary_browning
v_aa1      = flak38   
v_aa2      = aa_allies
v_dg1      = defgun
v_dg2      = defgun
v_jeep1      = blackmedal
v_jeep2      = willy     
v_apc1      = ho-ha
v_apc2      = m3a1
v_arty1    =
v_arty2    =
v_ltank1   = chi-ha
v_ltank2   = sherman
v_htank1   =
v_htank2   =
v_fighter1 = zero    
v_fighter2 = corsair
v_heli1      =
v_heli2      =
v_dest1      = hatsuzuki
v_dest2      = fletcher 
v_battle1  = yamato   
v_battle2  = princeow 
v_carrier1 = shokaku   
v_carrier2 = enterprise
v_pt1      = type38   
v_pt2      = elco80   

example spawner

ObjectTemplate.create ObjectSpawner MachineGunSpawner
ObjectTemplate.setObjectTemplate 1 v_mg1
ObjectTemplate.setObjectTemplate 2 v_mg2

ObjectTemplate.create ObjectSpawner AASpawner
ObjectTemplate.setObjectTemplate 1 v_aa1
ObjectTemplate.setObjectTemplate 2 v_aa2
User avatar
freddy
 
Posts: 1247
Joined: Sun Oct 18, 2009 4:58 pm

Re: debug modding on the fly ingame

Postby archer » Sun Dec 18, 2011 2:15 pm

Hi
I've been trying something similar some years ago. The somewhat disappointing thing about multiplay with debug executable is that if you change the game in any meaningful manner (like adding another weapon to a plane, change the round of fire, etc.) then it causes a de-synchronization: all the players suddenly get connection errors and then disconnect.

As for spawning objects, if you are the host, then you can simply use game.spawnObject <name> to get objects to spawn on your position. However, if you are a client, then using game.spawnObject will spawn the object on the host's coordinates instead of yours. It's quite funny to spawn tanks this way when the host is flying a plane. Instant crash :D
Clients can use Game.SpawnObjectAt <name> <position> to spawn things on given coordinates x/y/z. You still have to know your approximate position though.

I once dreamed of starting a live modding competition, where people would join a debug server and the be given like five minutes to code themselves a vehicle of doom. Then they would fight in those vehicles, the last one standing wins. Of course there would have to be lots of rules for the modders, for example forbidding the use of ObjectTemplate.HasArmor 0. Unfortunately, the whole thing is impossible because of the de-synchronization 'bug' I described above.
dzn.battlefield.pl - my Bf1942 modding website
User avatar
archer
 
Posts: 54
Joined: Fri Feb 05, 2010 4:40 pm
Location: Übertów

Postby freddy » Sun Dec 18, 2011 8:42 pm

wow that was some serious mods stuff :) i was thinking more in line like tweaking things a bit. i dont use the debug exe, just a normal server with small code snippets i can activate with the ingame commands (or remote). i would be nice if i could figure out a way to make a script or program that could activate some of these codes randomly, like maybe some wind effects changing wind direction and such. or just throw in a ctf flag or perhaps some bots. havent tried those last ones tho but should be possible.
User avatar
freddy
 
Posts: 1247
Joined: Sun Oct 18, 2009 4:58 pm


Return to 1942 Modding Discussion

Who is online

Users browsing this forum: Majestic-12 [Bot] and 24 guests

cron