1 registered members (henrybane),
1,499
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Req: Basic Spell System
[Re: Mythran]
#172317
12/12/07 20:53
12/12/07 20:53
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
what kind of spell systeem must it be if you press a key you trow a fireball ore liken in the newest harry poter serie?
"empty"
|
|
|
Re: Req: Basic Spell System
[Re: Mythran]
#172319
12/13/07 23:17
12/13/07 23:17
|
Joined: Sep 2006
Posts: 292
Mythran
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 292
|
Hmm i've got to say... Why the hell no one cares about spell systems?
Here's one free of charge...
All due credit to me and to aum, but i dont want, i dont know about aum...
function energy_ball() { wait (1); my.enable_entity = on; my.enable_block = on; my.event = remove_eball; my.pan = you.pan; my.tilt = you.tilt; my.lightred = 250; my.lightgreen = 150; my.lightrange = 200; eball_speed.x = 20; eball_speed.y = 0; eball_speed.z = 0; eball_speed *= time; while (my != null) { my.roll += 20 * time; move_mode = ignore_you + ignore_passents; ent_move (eball_speed, nullvector); wait (1); } }
function remove_eball() { wait (1); if (you == player) { player.hp -= 60; // decrease player's health } ent_remove (me); }
ACTION player_action { my.passable = 0; player = my; my.entity_type = 0; my.gravity = 6; my.z_offset = 6; wait(1); WHILE (1) { //the main loop if (key_t == 1) { ent_animate(my,"attack_a",my.animate,0); my.skill10 += 3 * time; //3
eball_pos.x = my.x; eball_pos.y = my.y; eball_pos.z = my.z + 25; // the energy ball appears betwen wizard's hands ent_create (energyball_mdl, eball_pos, energy_ball); snd_play (energy_snd, 70, 0); wait (16); } gravity(); movement(); camera(); animation(); wait(1); } }
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Hope this will be helpfull to the community
|
|
|
Re: Req: Basic Spell System
[Re: Mythran]
#172321
12/15/07 02:25
12/15/07 02:25
|
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B
Expert
|
Expert
Joined: Feb 2006
Posts: 2,185
|
in "remove_eball" you have to set it like this:
if (event_type == event_entity || event_type == event_block) { ent_remove(me); }
also if you want it to find the player, do not use if (you == player), give the player a skill like:
action player_action { my.skill99 = 1979; //code.... }
and then for the check use
if (you.skill99 == 1979) rather than if (you == player)
because i can't promise that you will ever be equal to the player value, even if the you pointer is on the player...
- aka Manslayer101
|
|
|
Re: Req: Basic Spell System
[Re: mpdeveloper_B]
#172322
12/15/07 17:57
12/15/07 17:57
|
Joined: Sep 2006
Posts: 292
Mythran
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 292
|
ent_remove(me); is giving me a crash
function remove_eball() { if (event_type == event_entity || event_type == event_block) { ent_remove(me); }
}
function energy_ball() { my.enable_entity = on; my.enable_block = on; my.event = remove_eball; my.pan = camera_pan; my.tilt = camera_tilt; my.lightred = 250; my.lightgreen = 150; my.lightrange = 200; eball_speed.x = 20; eball_speed.y = 0; eball_speed.z = 0; eball_speed *= time; while (1) { my.roll += 20 * time; c_move(me,eball_speed,nullvector,ignore_you + ignore_passable | glide | use_box); wait (1); } }
//action SpellInit //{ // while (me != null) // { // mana = -1; // ent_animate(my,"attack_a",my.animate,0); // my.animate += 20 * time; // eball_pos.x = my.x; // eball_pos.y = my.y; // eball_pos.z = my.z + 25; // the energy ball appears betwen wizard's hands // ent_create (energyball_mdl, eball_pos, energy_ball); // snd_play (energy_snd, 70, 0); // wait (32); // } //}
Function SpellInit { mana = -1; ent_animate(my,"attack_a",my.animate,0); my.animate += 20 * time; eball_pos.x = my.x + 40; // Change the X position where the ball will appear eball_pos.y = my.y; eball_pos.z = my.z + 15; // Change the Z position where the ball will appear ent_create (energyball_mdl, eball_pos, energy_ball); snd_play (energy_snd, 70, 0); wait (1); }
function aim() { spell_panel.VISIBLE = ON; }
function fire() { if(mana != 0) { spellinit(); } else { return; } }
function spell() { WHILE(1) { aim(); if(mana > max_mana) { mana = max_mana; } if(mana <= 0) { mana = 0; } if(key_t) { fire(); } WAIT(1); } }
Last edited by Mythran; 12/15/07 19:24.
|
|
|
Re: Req: Basic Spell System
[Re: Chameleon_Man]
#172324
12/23/07 18:20
12/23/07 18:20
|
Joined: Sep 2006
Posts: 292
Mythran
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 292
|
////////////////////////////////////////////////////////////// // copy / overwrite all the files inside the eball folder to your game (\office) folder // don't forget to include eball.wdl in your main game file (office.wdl if you are using the templates) //////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
string energyball_mdl = <energy.mdl>;
//////////////////////////////////////////////////////////////
sound energy_snd = <energy.wav>;
//////////////////////////////////////////////////////////////
var eball_speed; var eball_pos;
//////////////////////////////////////////////////////////////
function energy_ball(); function remove_eball();
//////////////////////////////////////////////////////////////
action wizard { clip_size = 0; while (1) { while (my.skill10 < 95) { ent_cycle ("attack", my.skill10); // play the attack animation frames my.skill10 += 3 * time; wait (1); } eball_pos.x = my.x; eball_pos.y = my.y; eball_pos.z = my.z + 25; // the energy ball appears betwen wizard's hands ent_create (energyball_mdl, eball_pos, energy_ball); snd_play (energy_snd, 70, 0); wait (16); while (my.skill10 > 2) { ent_cycle ("attack", my.skill10); // play the attack animation frames my.skill10 -= 2 * time; wait (1); } wait (32); } remove_eball(); }
function energy_ball() { wait (1); my.enable_entity = on; my.enable_block = on; my.event = remove_eball; my.pan = you.pan; my.tilt = you.tilt; my.lightred = 250; my.lightgreen = 150; my.lightrange = 200; eball_speed.x = 20; eball_speed.y = 0; eball_speed.z = 0; eball_speed *= time; while (my != null) { my.roll += 20 * time; //move_mode = ignore_you + ignore_passents; //c_move(my,nullvector,use_aabb | ignore_passable | glide); ent_move (eball_speed, nullvector); wait (1); } }
Action enemy_impact { my.enable_entity = on; my.event = remove_eball; }
function remove_eball() { wait (1); if (event_type == event_entity) { ent_remove (me); } }
How do i tell the ball that when there's a impact it's supossed to dissapear? I tryed impact, entity, block, none worked. And i cant find whats wrong... Thanks in advance.
|
|
|
|