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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Akow), 1,365 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Ghosts in the machine #119500
03/26/07 20:22
03/26/07 20:22
Joined: Jan 2007
Posts: 110
USA East Coast
K
KojaK Offline OP
Member
KojaK  Offline OP
Member
K

Joined: Jan 2007
Posts: 110
USA East Coast
Is is possible for a game to do things you never programmed in?

Is it possible for the my vectors of an entity to change, and change back?

Is it possible for handles and pointers to interfere, and cause the my vector of another entity to change?

I have a game that is glitching up. Zombies are spawning in the place of blown off arms and heads when they should be spawning at special entities with the action. That action is the only thing that creates zombies. The only vector it stores is the my.x, y, and z. The zombie however, stores the handles of it's arms and head, which are turned into pointers every frame, to position it's limbs and animate them as needed.

Is is something I did, or is my game simply "evloving" as the guy in I, Robot put it?


Lead programmer for Two Screws Loose Click here for our forums, and downloads for our games
Re: Ghosts in the machine [Re: KojaK] #119501
03/26/07 22:44
03/26/07 22:44
Joined: Aug 2002
Posts: 572
Toronto
MadMark Offline
User
MadMark  Offline
User

Joined: Aug 2002
Posts: 572
Toronto
Hmm, wierd.

I would examine your code for any "temp" variables. I've a hunch you have used temp to define something, like where an arm flies off to, and then used the same temp variable somewhere in your spawn code. Temp's great for quick and dirty coding, but ya probably want to get rid of it, or re-initialize its value to zero before re-using it in combined code.

Mark


People who live in glass houses shouldn't vacuum naked.
Re: Ghosts in the machine [Re: MadMark] #119502
03/27/07 19:11
03/27/07 19:11
Joined: Jul 2000
Posts: 8,973
Bay Area
Doug Offline
Senior Expert
Doug  Offline
Senior Expert

Joined: Jul 2000
Posts: 8,973
Bay Area
If you start seeing ghosts in your computer you need to do the following:
1) Save your work.
2) Go outside into the sunlight.
3) Relax, breath deep, stretch your legs.
4) Go back in and fix a cup of coffee.
5) Look over your code and check for any un-initialized values or global values that may be used after a wait.


Conitec's Free Resources:
User Magazine || Docs and Tutorials || WIKI
Re: Ghosts in the machine [Re: Doug] #119503
03/27/07 20:17
03/27/07 20:17
Joined: Jan 2007
Posts: 110
USA East Coast
K
KojaK Offline OP
Member
KojaK  Offline OP
Member
K

Joined: Jan 2007
Posts: 110
USA East Coast
I followed every direction but 1, 2, 3, and 4.

Just to be clear, everything works fine, except the glitch is there.

I've changed stuff since the demo, but it still does it in the newer version I'm working on. Here's the spawn code from the demo.


Code:
 action spawn_zombie(){
my.invisible = on;
my.passable = on;
while(1){
if (player == null){
wait(1);
}
else{
if(zombie_numb < maxzombies && esc_menu_up == false){
ifndef disable_enemy;
ent_create(zombie_mdl, my.x, zombie_act);
endif;
zombie_numb += 1;
sleep(zombie_spawn_delay_esy);
}
}
wait(1);
}

}



And here's the zombie code, with the arm's and head's code as well.
Code:
  action zombie_left{
my.enable_entity = on;
my.push = 2;
my.what_i_am = profzombie;
my.health = max_health;
while(my.health > 75){

wait(1);
}
my.health = 0;
my.animation = 0;
my.passable = on;
while(my.animation < 100){
if(esc_menu_up == false){
ent_animate(me, "dieA", my.animation,null);
my.animation += 1;
}
wait(1);
}
my.transparent = on;
my.alpha = 100;
while(my.alpha > 0){
my.alpha -= 1;
wait(1);
}
ent_remove(me);
}
action zombie_right{
my.enable_entity = on;
my.push = 2;
my.what_i_am = profzombie;
my.health = max_health;
while(my.health > 75){

wait(1);
}
my.health = 0;
my.animation = 0;
my.passable = on;
while(my.animation < 100){
if(esc_menu_up == false){
ent_animate(me, "dieA", my.animation,null);
my.animation += 1;
}
wait(1);
}
my.transparent = on;
my.alpha = 100;
while(my.alpha > 0){
my.alpha -= 1;
wait(1);
}
ent_remove(me);
}
action zombie_head{
my.enable_entity = on;
my.push = 2;
my.what_i_am = profzombie;
my.health = max_health;
//my.pan += 180;
while(my.health > 75){
wait(1);
}
my.health = 20;
my.animation = 0;
my.passable = on;
while(my.animation < 100){
if(esc_menu_up == false){
ent_animate(me, "dieA", my.animation, null);
my.animation += 1;
}
wait(1);
}
my.transparent = on;
my.alpha = 100;
while(my.alpha > 0){
my.alpha -= 1;
wait(1);
}
ent_remove(me);
}
function random_ehh();
action zombie_act
{
var oldvec[3];
var foundpath = 0;
var animationpercent;
my.push = 3;
my.health = max_health;
my.what_i_am = profzombie;
my.enable_impact = on;
my.enable_entity = on;
ptrtempent = ent_create(zombieleft, my.x, zombie_left);
my.partlarm = handle(ptrtempent);
ptrtempent = ent_create(zombieright, my.x, zombie_right);
my.partrarm = handle(ptrtempent);
ptrtempent = ent_create(zombiehead, my.x, zombie_head);
my.parthead = handle(ptrtempent);
random_ehh();
while(my.health > 0){
ptrtempent = ptr_for_handle(my.parthead);
if(ptrtempent != null){
if(ptrtempent.health > 75){
ptrtempent.pan = my.pan;
ptrtempent.tilt = my.tilt;
vec_for_vertex(ptrtempent.x, me, 40);
}
}
ptrtempent = ptr_for_handle(my.partlarm);
if(ptrtempent != null){
if(ptrtempent.health > 75){
ptrtempent.pan = my.pan;
ptrtempent.tilt = my.tilt;
vec_for_vertex(ptrtempent.x, me, 69);
}
}
ptrtempent = ptr_for_handle(my.partrarm);
if(ptrtempent != null){
if(ptrtempent.health > 75){
ptrtempent.pan = my.pan;
ptrtempent.tilt = my.tilt;
vec_for_vertex(ptrtempent.x, me, 35);
}
}
if(esc_menu_up == false){
oldvec.x = my.x;
vec_set(temp,player.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp);
c_move(me, vector(2,0,0), vector(0,0,-1), glide | IGNORE_PUSH | IGNORE_ME);
if(oldvec.x != my.x){
ent_animate(me, "walkA", animationpercent, anm_cycle);
animationpercent += 2;
}
else{
ent_animate(me, "standB", animationpercent, anm_cycle);
animationpercent += 1;
}
}
wait(1);
}
ptrtempent = ptr_for_handle(my.parthead);
if(ptrtempent != null){
ptrtempent.health = 50;
}
ptrtempent = ptr_for_handle(my.partlarm);
if(ptrtempent != null){
ptrtempent.health = 50;
}
ptrtempent = ptr_for_handle(my.partrarm);
if(ptrtempent != null){
ptrtempent.health = 50;
}
zombie_numb -= 1;
my.passable = on;
my.event = null;
animationpercent = 0;
kills += 1;
while(animationpercent < 100){
if(esc_menu_up == false){
ent_animate(me, "dieA", animationpercent, null);
animationpercent += 1;
}
wait(1);
}
my.transparent = on;
my.alpha = 100;
while(my.alpha > 0){
my.alpha -= 1;
wait(1);
}
ent_remove(me);
}



I've commented out the events for the zombies, but my.what_i_am is simply a variable. skill 33 i believe.

I also have these templates with the code,

include <is_IPathfinding.wdl>;
include <gid01.wdl>;
include <startup01.wdl>;
include <fxGore01.wdl>;

but the code is not using any of them directly. If i take out intense pathfinding(Is_IPathfinding), for some reason every bitmap becomes bigger, and the player sinks...

Last edited by KojaK; 03/27/07 20:19.

Lead programmer for Two Screws Loose Click here for our forums, and downloads for our games

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