Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 17,416 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Strange: WED Entity skills zero? #433683
12/04/13 13:10
12/04/13 13:10
Joined: Dec 2013
Posts: 10
RLP, Germany
ThunderStorm Offline OP
Newbie
ThunderStorm  Offline OP
Newbie

Joined: Dec 2013
Posts: 10
RLP, Germany
Hello Community,

I am new but experienced with 3DGS.

I was encountering a strange problem:
I have got an entity (just a 64x64x64 mdl block) which is invisible and has an action "actLevelchange".
I wanted to pass the string of the new Level in the entity's string1, which works fine. But skills 1,2,3 (position of player in new loaded level), which I set to some numbers are all 0 at runtime.
The entity's action uses the IMPACT-event and the event is properly executed, when the player collides with the Levelchange-Block. But why are the skills not passed from WED?

On other WED-Entities (like enemies) skills are working fine.

Thanks in advance for replies.
ThunderStorm

Re: Strange: WED Entity skills zero? [Re: ThunderStorm] #433685
12/04/13 13:50
12/04/13 13:50
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
What do you mean? If you change a level the entities get removed, so a skill wont saved...

If you made the next level in WED and you set some skills in WED, and they dont appear when that level is loaded, you probably forgot to re-build the level to include the new changes in the .wmb file. laugh

PS.: There is an option, I think (havent used WED in a while) to only update entities... Works a LOT faster, if you dont want to wait for the whole level to be built.

Last edited by EpsiloN; 12/04/13 13:51.

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: Strange: WED Entity skills zero? [Re: EpsiloN] #433688
12/04/13 13:56
12/04/13 13:56
Joined: Dec 2013
Posts: 10
RLP, Germany
ThunderStorm Offline OP
Newbie
ThunderStorm  Offline OP
Newbie

Joined: Dec 2013
Posts: 10
RLP, Germany
The problem exists before a new level is loaded.

Here are the skill-settings in WED:

Skill1: -768.000
Skill2: 1022.000
Skill3: 49.000

Here is the entity-action:

Code:
function actLevelchange()
{
	my.emask |= ENABLE_IMPACT;
	my.event = levelchangeEvent;
	
	printf("%.4f, %.4f, %.4f", my.skill[0], my.skill[1], my.skill[2]);
}



This should print the first three skillvalues, but it prints 0.0000,0.0000,0.0000...


UPDATE:
Rebuilding the map several times didn't fix the problem...

Last edited by ThunderStorm; 12/04/13 15:31.
Re: Strange: WED Entity skills zero? [Re: ThunderStorm] #433696
12/04/13 15:46
12/04/13 15:46
Joined: Dec 2013
Posts: 10
RLP, Germany
ThunderStorm Offline OP
Newbie
ThunderStorm  Offline OP
Newbie

Joined: Dec 2013
Posts: 10
RLP, Germany
OK, I solved it.

There was an error with the VECTOR-Pointer, in which I stored the skill-values in.

Thanks,
ThunderStorm

Last edited by ThunderStorm; 12/04/13 15:48.
Re: Strange: WED Entity skills zero? [Re: ThunderStorm] #433705
12/04/13 19:24
12/04/13 19:24
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
There is a mistake in your printf line, too. Try the following code:

Code:
void main()
{
	var my_var = 1404.5;
	
	printf("%.4f",my_var);
	printf("%.4f",(double)my_var);
}



The first printf will tell you that the variable is "0.0000", the second printf tells you the correct value. Check the manual for printf, it does not accept vars.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Strange: WED Entity skills zero? [Re: Superku] #433739
12/05/13 21:32
12/05/13 21:32
Joined: Dec 2013
Posts: 10
RLP, Germany
ThunderStorm Offline OP
Newbie
ThunderStorm  Offline OP
Newbie

Joined: Dec 2013
Posts: 10
RLP, Germany
Yes, you´re right. Forgot to cast the var to double.
But the problem is solved now. Thanks laugh


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