Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
why does this not work #148075
08/15/07 16:52
08/15/07 16:52
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
sorry, but i didnt know how to ask a proper question

Code:

VECTOR tempVec;
var i=0, j=0;
for (i=0;i<8;i++)
{
for (j=0;j<8;j++)
{
tempVec.x = 200*sin(360/8*j);
tempVec.y = 200*cos(360/8*j);
tempVec.z = 100*i + 48;
tempEnt = ent_create ("kiste1.mdl",tempVec,kiste);
tempEnt.skill1 = random(360);
wait(1);
}
}



even if i put another wait(1); between ent_create and the following line it doe not work.

how else can i pass variables to a created entity?

Re: why does this not work [Re: ello] #148076
08/15/07 17:14
08/15/07 17:14
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Maybe change the line

tempEnt.skill1

to tempEnt.skill[0]

Re: why does this not work [Re: vlau] #148077
08/15/07 18:04
08/15/07 18:04
Joined: Mar 2007
Posts: 75
Hamburg, Ger
Altimeter Offline
Junior Member
Altimeter  Offline
Junior Member

Joined: Mar 2007
Posts: 75
Hamburg, Ger
since this is Lite C-scripting:
-not VECTOR, but VECTOR*
The best is to initialize immediately like
VECTOR* tempVec = { x=0; y=0; z=0; }

-like vlau wrote: skill[1] is the preferred expression in LiteC.

-if it still does not work, post some more info:
do you get any error message or is the entity just not appearing?

Re: why does this not work [Re: Altimeter] #148078
08/15/07 18:16
08/15/07 18:16
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Quote:

since this is Lite C-scripting:
-not VECTOR, but VECTOR*



That's not true. You can write in the way ello did as well.

From what I see you didn't declare tempEnt, ello.


Always learn from history, to be sure you make the same mistakes again...
Re: why does this not work [Re: Uhrwerk] #148079
08/15/07 18:25
08/15/07 18:25
Joined: Mar 2007
Posts: 75
Hamburg, Ger
Altimeter Offline
Junior Member
Altimeter  Offline
Junior Member

Joined: Mar 2007
Posts: 75
Hamburg, Ger
yes, you need something like ENTITY* tempEnt;

As I read your code you create the same entity tempEnt 8 times?
Do you want to create 1 entity or 8 entities?

Re: why does this not work [Re: Altimeter] #148080
08/15/07 18:43
08/15/07 18:43
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
i have a line ENTITY* tempEnt; at the beginning of the script. that was just an idea to have access to the entities parameters. i want to adjust the pan angle of the created entity according to what j is

Re: why does this not work [Re: ello] #148081
08/15/07 19:20
08/15/07 19:20
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
What exactly the problem you have? I've tried your code and
it work perfectly even I wrote tempEnt.skill1 = random(360).

Maybe the problem come from function kiste().

Re: why does this not work [Re: vlau] #148082
08/15/07 19:24
08/15/07 19:24
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
yes, i just found that, too. kiste was declared as a physics entity to early.

Re: why does this not work [Re: ello] #148083
08/15/07 19:35
08/15/07 19:35
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
OIC, maybe put the line : tempEnt.skill1 = random(360);
to function kiste() and rewrite it to : my.skill1 = random(360)
or my.skill[0] = random(360) before those physic codes.

Re: why does this not work [Re: vlau] #148084
08/15/07 19:42
08/15/07 19:42
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
yes, i did it that way now. i put a wait line before the physics code. now i can set the pan directly in the for-loop


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