Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (henrybane), 1,499 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Req: Basic Spell System #172315
12/11/07 18:49
12/11/07 18:49
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
Does anyone know of a basic spell system or have that can post?
Just the basic functions to send the spell.
Thanks in advance.

Re: Req: Basic Spell System [Re: Mythran] #172316
12/12/07 20:43
12/12/07 20:43
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
Erm...
No one knows of some "basic!" (the basic of) spell system?
I tryed several ways i really need some help...
Anyone?

Re: Req: Basic Spell System [Re: Mythran] #172317
12/12/07 20:53
12/12/07 20:53
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

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: flits] #172318
12/12/07 22:55
12/12/07 22:55
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
something like that yes.
Just the basic funcions.
Something Like this:

BMAP spell_pan = <spell.pcx>;
var spell_speed;
var distance[3];
var angle[3];
var position[3];
var mana = 30;
var max_mana = 30;
var dist;
PANEL spell_panel
{
pos_x = 100; pos_y = 100;
BMAP = spell_pan;
flags = d3d,refresh;
}
function spell()
{
WHILE(1)
{
if(mana >= max_mana)
{ mana = max_mana; }
if((key_e) && (key_t)){ aim(); }
if(key_t){ fire(); }
WAIT(1);
}
}
function aim()
{
spell_panel.VISIBLE = ON;
if(key_t){ fire(); }
}
function init_spell()
{
angle.pan = CAMERA.pan;
angle.tilt = CAMERA.tilt;
angle.roll = CAMERA.roll;
my.pan = angle.pan;
my.tilt = angle.tilt;
my.roll = angle.roll;
WHILE(1)
{
if(MY.SKILL5 == 0) { my.SKILL5 = 50; }
dist.x = TIME * spell_speed;
dist.y = 0;
dist.z = 0;
position.x = my.x;
position.y = my.y;
position.z = my.z;
spell_speed = MY.SKILL5;
//if(MY.SKILL5 == 0){MY.SKILL5 = 50;}
c_move(me,nullvector,dist,ignore_passable | glide | use_box);
c_trace(position,null,ignore_me + activate_shoot + ignore_passable);
if(EVENT_TYPE == EVENT_SONAR) { ent_remove (me); spell_panel.VISIBLE = OFF;return; }
WAIT(1); // change if it is too fast
}
}
function fire()
{
if(mana != 0){
ent_create ("arrow.mdl",player.x,init_spell);
}
else
{return;}
}

The only problem is that for some reason it doesnt work.
When i was able to cast a arrow, the player just dissapeared and the camera turned very slow only moving arround the arrow...

Re: Req: Basic Spell System [Re: Mythran] #172319
12/13/07 23:17
12/13/07 23:17
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

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] #172320
12/14/07 19:54
12/14/07 19:54
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
How do i tell this script that when it hits something, it just get removed.
I tryed event impact, event sonar, event whatever, but the f***ing ball just dont dissapear...

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 Offline
Expert
mpdeveloper_B  Offline
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
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

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: Mythran] #172323
12/16/07 21:36
12/16/07 21:36
Joined: Dec 2003
Posts: 179
Chameleon_Man Offline
Member
Chameleon_Man  Offline
Member

Joined: Dec 2003
Posts: 179
ent_remove(me) is risky when you call it early in a function. In your code, you remove the entity, but the rest of the code in the function is still being read. All your my.whatever = x calls after ent_remove are coming up ambiguous because, since you deleted the entity, the engine doesn't know what "my" is.

Re: Req: Basic Spell System [Re: Chameleon_Man] #172324
12/23/07 18:20
12/23/07 18:20
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

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.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1