Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (3run, 1 invisible), 3,648 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
valino, juergenwue, VladMak, Geir, ondrej
19209 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: hidding syntax in attaching weapon... [Re: Wjbender] #399124
04/11/12 14:27
04/11/12 14:27
Joined: Feb 2010
Posts: 886
Random Offline OP
User
Random  Offline OP
User

Joined: Feb 2010
Posts: 886
I know. But it doesn`t work "same error".
Maby it is because ENTITY* weapon_holder isn`t only the player.
It is also my AI.
Thats why weapon_holder has to be you.

I try it like this:
I will just separate the weapon script into an AI and player weapon script (two different codes).
I will post the results soon.



Re: hidding syntax in attaching weapon... [Re: Random] #399138
04/11/12 15:07
04/11/12 15:07
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Random, looking at you last posted script, I see you are only defining
vector POINTERS for the weapon_base and weapon_tip.

You need REAL vectors, not just pointers...

Try replacing the following code...
Code:
//Replace this old code
   VECTOR*	weapon_base;
   VECTOR*	weapon_tip;

//with this NEW code
   VECTOR weapon_base, weapon_tip;

And no other changes...


As for re-assigning ME, always a tricky prospect...
I cant see you doing it WRONG, but you are probably far better off
using the YOU pointer instead, cause you can IGNORE_YOU in a trace...


(thats as deep as Ive looked sorry... bad eye-sight night tonight..)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: hidding syntax in attaching weapon... [Re: Random] #399140
04/11/12 15:21
04/11/12 15:21
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
Originally Posted By: Random

Maby it is because ENTITY* weapon_holder isn`t only the player.
It is also my AI.
Thats why weapon_holder has to be you.


Originally Posted By: Wjbender

//but if you is the valid entity holding the sword somehow then yes weapon_holder=you


could you say whats the error?

im perhaps confusing you to much here
rather stick with whats simple and hope you nail it good luck man


Last edited by Wjbender; 04/11/12 15:31.

Compulsive compiler
Re: hidding syntax in attaching weapon... [Re: EvilSOB] #399142
04/11/12 15:39
04/11/12 15:39
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
i think you could be right here with the pointers!


Compulsive compiler
Re: hidding syntax in attaching weapon... [Re: Wjbender] #399183
04/11/12 20:33
04/11/12 20:33
Joined: Feb 2010
Posts: 886
Random Offline OP
User
Random  Offline OP
User

Joined: Feb 2010
Posts: 886
Quite shocking.
EvilSOB solution worked.
I can`t belive that this:

Code:
VECTOR*	weapon_base;
   VECTOR*	weapon_tip;



was the problem...
Thank you very much!



Re: hidding syntax in attaching weapon... [Re: Random] #399197
04/12/12 08:01
04/12/12 08:01
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
great! i encountered this once and its actualy a bit weird because
the pointer is supposed to get filled up by the function


Compulsive compiler
Re: hidding syntax in attaching weapon... [Re: Wjbender] #399254
04/13/12 00:50
04/13/12 00:50
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
That is a common mis-conception Wjbender, but still wrong.

There are NO FUNCTIONS that I know of that will 'create' a vector to save its results into,
they all just "overwrite the contents of the area the pointer is pointing AT".

So if you have given it a pointer that is pointing at a random/invalid location,
like for example "VECTOR* weapon_tip;" then the unexpected WILL happen sooner or later.


This is a hole we all all into quite often...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: hidding syntax in attaching weapon... [Re: EvilSOB] #399311
04/14/12 08:15
04/14/12 08:15
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
im not arguing that gamestudio has functions that create and return the pointer
what im saying is ITS SUPPOSE to do it that way,the function is done WRONG

VECTOR* vec_test()
{
VECTOR p;
p.x=1;
p.y=2;
p.z=3;
return (&p);//<---return the adress of p ,so the pointer points to this adress
}


VECTOR *test=vec_test();
if(test.x==1)printf("x=1");
if(test.y==2)printf("y=2");
if(test.z==3)printf("z=3");

its called user friendly/ease of use! test it
i have been proggraming from the first time i layd hands on a keyboard
my friend and that was when the zx sinclair came out so i have ALOT
of experience backing me up(multiple languages)mostly c++


Compulsive compiler
Re: hidding syntax in attaching weapon... [Re: Wjbender] #399317
04/14/12 09:03
04/14/12 09:03
Joined: Apr 2012
Posts: 1
W
wunima Offline
Guest
wunima  Offline
Guest
W

Joined: Apr 2012
Posts: 1
Im not reasoning and arguing that gamestudio has features that make and come back the pointer
what im saying is ITS SUPPOSE to do it that way,the operate is done WRONG



____________________________________________________
ergo baby carrier sale
ergo baby organic carrier
ergo petunia pickle bottom

Re: hidding syntax in attaching weapon... [Re: wunima] #399339
04/14/12 12:07
04/14/12 12:07
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
And Im not arguing that OTHER languages often return temporary objects.
Im just saying LiteC SELDOM does...

I too have bwwn a code-monkey for a few years, since you were in nappies to be exact.
I started on a Vic20 that came out the year you were born...

But most importantly, Ive got a few more years with LITEC than you, so I am
quite certain of my opinions...


Yes, it WOULD be nice if MORE functions actually returned temporary objects,
but, well, they dont... So we gotta live with it.

And I dont know about you, but when I read the manual and the first line of the
vec_for_vertex entry says "Sets the given vector to ..." then I would assume it
is saying it NEEDS to be GIVEN a vector to update...


Many of LiteC's function DO return temporary objects, but not many in MY opinion,
and vec_for_vertex is NOT one of the few...

Im not defending liteC, Im just stating the facts we must learn to live with.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 2 of 3 1 2 3

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

Gamestudio download | 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