Click here to Skip to main content
15,886,055 members
Home / Discussions / C#
   

C#

 
Questiontabcontrol OwnerDrawFixed right to left in c# Pin
Member 1059114816-Feb-14 1:39
Member 1059114816-Feb-14 1:39 
QuestionHow to Open form inside existing Tab Page Pin
Member 1059114816-Feb-14 1:36
Member 1059114816-Feb-14 1:36 
AnswerRe: How to Open form inside existing Tab Page Pin
Member 1059114816-Feb-14 8:33
Member 1059114816-Feb-14 8:33 
QuestionRe: How to Open form inside existing Tab Page Pin
Ravi Bhavnani17-Feb-14 7:54
professionalRavi Bhavnani17-Feb-14 7:54 
Questionhello sir... for com port setting for sms application in c# Pin
aawajaarughat15-Feb-14 23:18
professionalaawajaarughat15-Feb-14 23:18 
AnswerRe: hello sir... for com port setting for sms application in c# Pin
Kornfeld Eliyahu Peter15-Feb-14 23:31
professionalKornfeld Eliyahu Peter15-Feb-14 23:31 
AnswerRe: hello sir... for com port setting for sms application in c# Pin
OriginalGriff15-Feb-14 23:32
mveOriginalGriff15-Feb-14 23:32 
QuestionTrying to make a converter Pin
daddy35615-Feb-14 14:01
daddy35615-Feb-14 14:01 
How would I go about making a program to convert this file
eg:

00000000 44 58 45 00 46 07 00 00 00 00 00 00 00 00 00 00 01 75 6E 69 74 73 2E DXE.F............units.
00000017 74 79 70 65 73 2E 42 61 73 65 00 01 75 6E 69 74 73 2E 65 78 74 65 6E types.Base..units.exten
0000002E 73 69 6F 6E 73 2E 44 61 6D 61 67 65 00 01 75 6E 69 74 73 2E 65 78 74 sions.Damage..units.ext
00000045 65 6E 73 69 6F 6E 73 2E 54 72 61 6E 73 70 6F 72 74 00 01 43 6F 6E 74 ensions.Transport..Cont
0000005C 61 69 6E 65 72 73 00 01 49 6E 70 75 74 00 01 57 6F 72 6C 64 00 01 41 ainers..Input..World..A
00000073 70 70 6C 69 63 61 74 69 6F 6E 00 01 4D 61 74 68 00 01 47 6C 6F 62 61 pplication..Math..Globa
0000008A 6C 00 01 53 6F 75 6E 64 00 01 4C 6F 63 61 6C 69 7A 65 72 00 01 4E 65 l..Sound..Localizer..Ne
000000A1 74 77 6F 72 6B 00 04 41 6D 6D 6F 53 75 70 70 6C 79 44 65 73 63 72 69 twork..AmmoSupplyDescri
000000B8 70 74 6F 72 00 03 EF 01 00 00 69 6E 69 74 00 03 F7 01 00 00 64 65 73 ptor......init......des
000000CF 74 72 6F 79 00 03 FB 01 00 00 63 72 65 61 74 65 5F 65 78 74 65 6E 73 troy......create_extens
000000E6 69 6F 6E 00 05 04 41 6D 6D 6F 53 75 70 70 6C 79 00 02 5F 62 61 73 65 ion...AmmoSupply.._base
000000FD 00 02 5F 65 78 74 00 02 5F 75 6E 69 74 00 02 5F 75 76 64 00 02 5F 73 .._ext.._unit.._uvd.._s
00000114 75 70 70 6C 79 5F 65 76 65 6E 74 00 02 5F 73 65 74 5F 74 6F 5F 73 75 upply_event.._set_to_su
0000012B 70 70 6C 79 00 02 5F 69 67 6E 6F 72 65 5F 77 65 61 70 6F 6E 00 03 1E pply.._ignore_weapon...
00000142 02 00 00 73 75 70 65 72 00 03 29 02 00 00 69 6E 69 74 00 03 85 02 00 ...super..)...init.....
00000159 00 75 70 64 61 74 65 00 03 8D 02 00 00 73 65 74 5F 74 6F 5F 73 75 70 .update......set_to_sup
00000170 70 6C 79 00 03 6D 03 00 00 75 73 65 00 00 03 2A 04 00 00 63 68 65 63 ply..m...use...*...chec
00000187 6B 5F 75 73 61 62 6C 65 5F 6D 65 73 73 61 67 65 00 03 D4 04 00 00 65 k_usable_message......e
0000019E 6D 70 74 79 5F 75 70 64 61 74 65 00 03 D8 04 00 00 64 61 6D 61 67 65 mpty_update......damage
000001B5 5F 65 78 70 6C 6F 73 69 6F 6E 00 03 E0 04 00 00 65 78 70 6C 6F 64 65 _explosion......explode
000001CC 00 03 E4 04 00 00 61 69 72 73 74 72 69 6B 65 00 03 ED 04 00 00 64 65 ......airstrike......de
000001E3 73 74 72 6F 79 00 03 1D 05 00 00 73 61 76 65 00 03 06 06 00 00 6C 6F stroy......save......lo
000001FA 61 64 00 05 00 27 02 27 02 27 02 0A 00 27 00 0A 00 27 02 27 02 0C 0D ad...'.'.'...'...'.'...
00000211 00 2D 00 2C 69 6E 69 74 00 10 00 2E 10 01 2E 0A 2E 2D 03 2F 29 1D 02 .-.,init.........-./)..
00000228 00 00 27 02 0A 00 27 00 0E 00 29 28 02 00 00 0A 00 27 02 27 02 0F 00 ..'...'...)(.....'.'...
0000023F 0C 00 00 2C 42 61 73 65 00 2D 00 2C 69 6E 69 74 00 10 01 2E 2D 01 2F ...,Base.-.,init....-./
00000256 28 0F 02 10 01 28 0F 01 10 00 28 0F 04 07 00 00 00 00 00 28 0F 05 09 (....(....(........(...
0000026D 28 0F 06 07 00 00 00 00 00 28 0F 03 0E 02 2C 76 65 68 69 63 6C 65 5F (........(....,vehicle_
00000284 64 61 74 61 00 2F 28 0B 29 84 02 00 00 27 02 0A 00 27 04 27 04 27 04 data./(.)....'...'.'.'.
0000029B 0A 00 27 03 27 03 0C 06 00 2C 64 65 62 75 67 00 07 41 6D 6D 6F 54 72 ..'.'....,debug..AmmoTr
000002B2 75 63 6B 3A 3A 73 65 74 5F 74 6F 5F 73 75 70 70 6C 79 28 29 00 2E 2D uck::set_to_supply()..-
000002C9 01 15 0F 05 10 00 28 10 00 2B 19 03 00 00 29 CC 02 00 00 0E 02 2C 62 ......(..+....)......,b
000002E0 61 73 65 5F 64 61 74 61 00 2C 75 73 61 62 6C 65 00 08 28 0E 02 2C 75 ase_data.,usable..(..,u
000002F7 73 61 62 6C 65 5F 64 61 74 61 00 2C 68 6F 76 65 72 5F 63 68 65 63 6B sable_data.,hover_check
0000030E 5F 66 75 6E 63 74 69 6F 6E 00 08 28 0F 04 10 01 28 0F 06 10 02 28 29 _function..(....(....()
00000325 69 03 00 00 0E 02 2C 62 61 73 65 5F 64 61 74 61 00 2C 75 73 61 62 6C i.....,base_data.,usabl
0000033C 65 00 09 28 0E 02 2C 75 73 61 62 6C 65 5F 64 61 74 61 00 2C 68 6F 76 e..(..,usable_data.,hov
00000353 65 72 5F 63 68 65 63 6B 5F 66 75 6E 63 74 69 6F 6E 00 09 28 0F 04 07 er_check_function..(...
0000036A 00 00 00 00 00 28 0F 06 07 00 00 00 00 00 28 27 03 0A 00 27 01 27 01 .....(........('...'.'.
00000381 0C 06 00 2C 64 65 62 75 67 00 07 4D 75 6C 65 3A 3A 75 73 65 28 29 2C ...,debug..Mule::use(),
00000398 20 5F 73 75 70 70 6C 79 5F 65 76 65 6E 74 3D 00 0E 04 16 07 20 5F 69 _supply_event=..... _i
000003AF 67 6E 6F 72 65 5F 77 65 61 70 6F 6E 3D 00 16 0E 06 16 2E 2D 01 15 0C gnore_weapon=......-...
000003C6 0B 00 2C 73 65 72 76 65 72 00 2D 00 2C 66 72 6F 6D 5F 63 6C 69 65 6E ..,server.-.,from_clien
000003DD 74 5F 61 73 6B 5F 66 6F 72 5F 69 6E 76 65 6E 74 6F 72 79 5F 75 6E 69 t_ask_for_inventory_uni
000003F4 74 00 08 2E 2D 01 15 0E 04 2B 26 04 00 00 29 F7 03 00 00 0C 0B 00 2C t...-....+&...).......,
0000040B 73 65 72 76 65 72 00 2D 00 2C 66 72 6F 6D 5F 63 6C 69 65 6E 74 5F 61 server.-.,from_client_a
00000422 63 74 69 76 61 74 65 5F 65 76 65 6E 74 00 0E 04 2E 2D 01 15 27 01 0A ctivate_event....-..'..
00000439 00 27 01 27 01 0C 06 00 2C 64 65 62 75 67 00 07 4D 75 6C 65 3A 3A 63 .'.'....,debug..Mule::c
00000450 68 65 63 6B 5F 75 73 61 62 6C 65 5F 6D 65 73 73 61 67 65 28 29 00 2E heck_usable_message()..
00000467 2D 01 15 0C 0A 00 2C 6C 6F 6F 6B 75 70 00 07 6D 65 73 73 61 67 65 5F -.....,lookup..message_
0000047E 74 6F 5F 72 65 73 75 70 70 6C 79 00 2E 2D 01 2C 72 65 70 6C 61 63 65 to_resupply..-.,replace
00000495 00 07 3C 2A 3E 00 00 2E 0C 08 00 2C 69 6E 70 75 74 5F 6D 61 6E 61 67 ..<*>......,input_manag
000004AC 65 72 00 2C 5F 62 69 6E 64 69 6E 67 73 00 2C 67 65 74 5F 62 75 74 74 er.,_bindings.,get_butt
000004C3 6F 6E 5F 74 72 61 6E 73 6C 61 74 65 64 5F 6E 61 6D 65 00 2F 2E 2D 02 on_translated_name./.-.
000004DA 2F 29 D3 04 00 00 27 01 0A 00 27 00 0A 00 27 02 27 02 27 02 0A 00 27 /)....'...'...'.'.'...'
000004F1 00 0A 00 27 00 0E 0F 2D 00 15 0A 00 27 00 27 01 11 00 0E 02 2C 76 65 ...'...-....'.'.....,ve
00000508 68 69 63 6C 65 5F 64 61 74 61 00 2F 28 0E 00 2C 64 65 73 74 72 6F 79 hicle_data./(..,destroy
0000051F 00 2D 00 15 0F 00 0A 28 0F 02 0A 28 0A 00 27 01 27 01 27 02 0C 06 00 .-.....(...(..'.'.'....
00000536 2C 64 65 62 75 67 00 07 4D 75 6C 65 3A 3A 73 61 76 65 28 29 00 2E 2D ,debug..Mule::save()..-
0000054D 01 15 11 01 0E 02 2C 76 65 68 69 63 6C 65 5F 64 61 74 61 00 2F 28 10 ......,vehicle_data./(.
00000564 00 2C 73 61 76 65 00 07 73 65 74 5F 74 6F 5F 73 75 70 70 6C 79 00 2E .,save..set_to_supply..
0000057B 0E 05 2E 2D 02 15 10 00 2C 73 61 76 65 00 07 73 75 70 70 6C 79 5F 65 ...-....,save..supply_e
00000592 76 65 6E 74 00 2E 0E 04 2E 2D 02 15 10 00 2C 73 61 76 65 00 07 75 73 vent.....-....,save..us
000005A9 61 62 6C 65 00 2E 0E 02 2C 62 61 73 65 5F 64 61 74 61 00 2C 75 73 61 able....,base_data.,usa
000005C0 62 6C 65 00 2F 2E 2D 02 15 10 00 2C 73 61 76 65 00 07 68 6F 76 65 72 ble./.-....,save..hover
000005D7 5F 63 68 65 63 6B 5F 66 75 6E 63 74 69 6F 6E 00 2E 0E 02 2C 75 73 61 _check_function....,usa
000005EE 62 6C 65 5F 64 61 74 61 00 2C 68 6F 76 65 72 5F 63 68 65 63 6B 5F 66 ble_data.,hover_check_f
00000605 75 6E 63 74 69 6F 6E 00 2F 2E 2D 02 15 27 01 0A 00 27 01 27 01 0C 06 unction./.-..'...'.'...
0000061C 00 2C 64 65 62 75 67 00 07 4D 75 6C 65 3A 3A 6C 6F 61 64 28 29 00 2E .,debug..Mule::load()..
00000633 2D 01 15 0E 0A 10 00 2C 6C 6F 61 64 00 07 73 65 74 5F 74 6F 5F 73 75 -......,load..set_to_su
0000064A 70 70 6C 79 00 2E 2D 01 2F 2E 10 00 2C 6C 6F 61 64 00 07 73 75 70 70 pply..-./...,load..supp
00000661 6C 79 5F 65 76 65 6E 74 00 2E 2D 01 2F 2E 10 00 2C 6C 6F 61 64 00 07 ly_event..-./...,load..
00000678 69 67 6E 6F 72 65 5F 77 65 61 70 6F 6E 00 2E 2D 01 2F 2E 2D 03 15 0E ignore_weapon..-./.-...
0000068F 02 2B 01 07 00 00 29 8A 06 00 00 0E 02 2C 62 61 73 65 5F 64 61 74 61 .+....)......,base_data
000006A6 00 2C 75 73 61 62 6C 65 00 10 00 2C 6C 6F 61 64 00 07 75 73 61 62 6C .,usable...,load..usabl
000006BD 65 00 2E 2D 01 2F 28 0E 02 2C 75 73 61 62 6C 65 5F 64 61 74 61 00 2C e..-./(..,usable_data.,
000006D4 68 6F 76 65 72 5F 63 68 65 63 6B 5F 66 75 6E 63 74 69 6F 6E 00 10 00 hover_check_function...
000006EB 2C 6C 6F 61 64 00 07 68 6F 76 65 72 5F 63 68 65 63 6B 5F 66 75 6E 63 ,load..hover_check_func
00000702 74 69 6F 6E 00 2E 2D 01 2F 28 29 42 07 00 00 0C 06 00 2C 65 72 72 6F tion..-./()B......,erro
00000719 72 00 07 54 68 65 20 41 6D 6D 6F 53 75 70 70 6C 79 20 64 69 64 20 6E r..The AmmoSupply did n
00000730 6F 74 20 6C 6F 61 64 20 69 74 73 20 75 73 61 62 6C 65 20 69 6E 66 6F ot load its usable info
00000747 20 72 69 67 68 74 00 2E 2D 01 15 27 01 0A 00 right..-..'...



to this file

eg:


C#
import units.types.Base;
import units.extensions.Damage;
import units.extensions.Transport;
import Containers, Input;
import World, Application, Math, Global, Sound;
import Localizer;
import Network;

class AmmoSupplyDescriptor
{
    init( node, c_desc ) {}

    destroy() {}

    create_extension( ext, unit )
    {
        return AmmoSupply().init( ext, unit, void );
    }
}

class AmmoSupply
{
    object _base;
    object _ext;
    object _unit;
    object _uvd;
    object _supply_event;
    object _set_to_supply;
    object _ignore_weapon;

super()
{
    return _base;
}

init( ext, unit )
{
    _base := Base.Base().init( unit );
    _unit := unit;
    _ext := ext;
    _supply_event := "";
    _set_to_supply := false;
    _ignore_weapon := "";
    _uvd := _unit.vehicle_data;
    return this;
}

update( unit, ext, time, rel_time ) {}

set_to_supply( switch, event_name, ignore_weapon )
{
    Application.debug("AmmoTruck::set_to_supply()");
    _set_to_supply := switch;

    if( switch )
    { // activate supply, deactivate all other
        _unit.base_data.usable := true;
        _unit.usable_data.hover_check_function := true;
        _supply_event := event_name;
        _ignore_weapon := ignore_weapon;
    } else { // deactivate supply, activate all other
        _unit.base_data.usable := false;
        _unit.usable_data.hover_check_function := false;
        _supply_event := "";
        _ignore_weapon := "";
    }
}

use( unit )
{
    Application.debug( "Mule::use(), _supply_event="+ _supply_event+ " _ignore_weapon="+_ignore_weapon );
    Network.server().from_client_ask_for_inventory_unit( true ); // this will open the inventory if we succeed

    if( _supply_event )
    { // This is old Single player stuff, probably it is not needed, or useful anymore
        Network.server().from_client_activate_event( _supply_event );
    }
}

check_usable_message( unit )
{
    Application.debug( "Mule::check_usable_message()");
    return Localizer.lookup( "message_to_resupply"  ).replace( "<*>", Global.input_manager._bindings.get_button_translated_name );
}

empty_update() {}

damage_explosion( damage, position) {}

explode() {}

airstrike()
{
    // Airstrike now die!
    explode();
}

destroy()
{
    object uvd := _unit.vehicle_data;
    _base.destroy();
    _base := void;
    _unit := void;
}

save( data )
{
    Application.debug( "Mule::save()" );
    object uvd := _unit.vehicle_data;
    data.save( "set_to_supply", _set_to_supply );
    data.save( "supply_event", _supply_event );
    data.save( "usable", _unit.base_data.usable );
    data.save( "hover_check_function", _unit.usable_data.hover_check_function );
}

load( data )
{
    Application.debug( "Mule::load()" );
    set_to_supply( data.load( "set_to_supply" ), data.load( "supply_event" ), data.load( "ignore_weapon" ) );

    if( _unit )
    {
        _unit.base_data.usable := data.load( "usable" );
        _unit.usable_data.hover_check_function := data.load( "hover_check_function" );
    } else {
        Application.error("The AmmoSupply did not load its usable info right");
        }
    }
}

AnswerRe: Trying to make a converter Pin
Richard Andrew x6415-Feb-14 17:26
professionalRichard Andrew x6415-Feb-14 17:26 
GeneralRe: Trying to make a converter Pin
Mycroft Holmes15-Feb-14 20:41
professionalMycroft Holmes15-Feb-14 20:41 
GeneralRe: Trying to make a converter Pin
harold aptroot15-Feb-14 23:52
harold aptroot15-Feb-14 23:52 
GeneralRe: Trying to make a converter Pin
harold aptroot15-Feb-14 23:50
harold aptroot15-Feb-14 23:50 
GeneralRe: Trying to make a converter Pin
daddy35617-Feb-14 11:49
daddy35617-Feb-14 11:49 
GeneralRe: Trying to make a converter Pin
harold aptroot17-Feb-14 21:30
harold aptroot17-Feb-14 21:30 
GeneralRe: Trying to make a converter Pin
daddy35618-Feb-14 0:27
daddy35618-Feb-14 0:27 
GeneralRe: Trying to make a converter Pin
harold aptroot18-Feb-14 0:42
harold aptroot18-Feb-14 0:42 
GeneralRe: Trying to make a converter Pin
daddy35618-Feb-14 4:03
daddy35618-Feb-14 4:03 
GeneralRe: Trying to make a converter Pin
harold aptroot18-Feb-14 4:37
harold aptroot18-Feb-14 4:37 
GeneralRe: Trying to make a converter Pin
daddy35618-Feb-14 6:06
daddy35618-Feb-14 6:06 
GeneralRe: Trying to make a converter Pin
harold aptroot18-Feb-14 6:25
harold aptroot18-Feb-14 6:25 
GeneralRe: Trying to make a converter Pin
harold aptroot18-Feb-14 10:12
harold aptroot18-Feb-14 10:12 
GeneralRe: Trying to make a converter Pin
daddy35618-Feb-14 10:48
daddy35618-Feb-14 10:48 
GeneralRe: Trying to make a converter Pin
harold aptroot18-Feb-14 22:09
harold aptroot18-Feb-14 22:09 
GeneralRe: Trying to make a converter Pin
daddy35619-Feb-14 3:38
daddy35619-Feb-14 3:38 
GeneralRe: Trying to make a converter Pin
harold aptroot19-Feb-14 4:34
harold aptroot19-Feb-14 4:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.