Gamestudio Links
Zorro Links
Newest Posts
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
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 7th_zorro), 1,203 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Saving "YOU" synonym value for using later... #4587
06/13/01 22:03
06/13/01 22:03

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



OK, done the search thing - nada...

I know what the "you" synonym is used for, but how do you save it for later use?
Specifically, *what* kind of parm is this, and what *type* of array would I need to create to track the entities that are triggering events.

This is more along the lines of completing level goals - tracking who the player has interacted with, and what level objects have been manipulated by the player.
Another use would be to store the results from a scan explosion - everyone hurt "raise their hands" (so to speak) and the routine takes all the entities within the blast radius, and stores their "names" for processing later on.

I would like the code to be simple, like:

Action Player_track(){
Myarray[ArrayIndex] = YOU;
// Rest of Code
}

Then be able to go through the array when the game dictates, and modify the entity "pointed to" by the array.


Thanks in Advance,

-Neut.


Re: Saving "YOU" synonym value for using later... #4588
06/13/01 23:22
06/13/01 23:22

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



You could easily copy the you synonym to another one by declaring a new synonym in the start like this synonym newsynonym { type entity;} and then copy the first to the second as easily as this: newsynonym=you;

however I haven't tested putting synonyms into arrays yet, and don't know if that can work, but you can always try.

my way of having each guy withing the blast radius get hurt, is toggle a skill of theirs in the scan event and then use that skill in another function runned by every guy, that kills em: if (str_cmpi(my._status,"exploded")==1) {playexplodedanim(); }

Hope that helped
LLaffer


Re: Saving "YOU" synonym value for using later... #4589
06/14/01 03:23
06/14/01 03:23

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Thanks Larry - good info.

But I really need this to be stored into an array if at all possible, because the routine involved would be too cumbersome if *not* in an array of some kind...

Doug, help... (1 finger from drowning man...)
- *not* the middle one either

-Neut.




Re: Saving "YOU" synonym value for using later... #4590
06/14/01 04:18
06/14/01 04:18
Joined: Jul 2000
Posts: 8,973
Bay Area
Doug Offline
Senior Expert
Doug  Offline
Senior Expert

Joined: Jul 2000
Posts: 8,973
Bay Area
As far as I know, you can not make a simple array of synonyms.

But we are replacing synonyms with 'pointers':

synonym guard { type entity; } // old style <*ick!*>
&entity guard; // new style <*cool!*>

Right now it's "pre-beta" so only JCL can tell us if something like this would work:

&entity targetArray[128]; // an array of 128 entity pointers



Conitec's Free Resources:
User Magazine || Docs and Tutorials || WIKI
Re: Saving "YOU" synonym value for using later... #4591
06/14/01 04:30
06/14/01 04:30

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



You could nave something like var done_this? = 0; and then when the player reaches a certain goal add 1 to this. When the counter reaches say 5 (or how many tasks there are you've finished!

Re: Saving "YOU" synonym value for using later... #4592
06/14/01 09:49
06/14/01 09:49

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



This is for a weather & special effects system involing numerous moving objects and particles.
Particles have a very limited number of variables, but particles are good - cause I can create 10,000 at once, if I want.
(And in a multiplayer game the above number is more probable, than not)
I'm trying to add some AI to the system and there aren't enough user-def vars for the particles.
Overcoming this is my objective.
I need particles to have collision detection, even if I have to code it myself - but I can't do it *without* storing "YOU" someplace.
Partially, this has to do with particle grouping and other stuff I don't want to get into...

(Dang! Seems like everyone's working on a weather system - me and my big mouth! ... ah well...)

-Neut.

[This message has been edited by NeutronBlue (edited 14 June 2001).]


Re: Saving "YOU" synonym value for using later... #4593
06/28/01 06:24
06/28/01 06:24

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



I would really like that pointer based entity system! I was writing a space sim for a while. I got stuck and stoped because I couldn't figure out a good way to cycle the targeting system throught the enemy entities, and retrive info on them. I can't wait for the new feature!

Re: Saving "YOU" synonym value for using later... #4594
06/28/01 09:29
06/28/01 09:29
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
W
WildCat Offline
Expert
WildCat  Offline
Expert
W

Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
Neut,
If you can hold out for the next release, there are some handy new commands coming that will convert "Pointers" to plain-old numbers that can be stored in an array.

Check this out (from the upcoming features list):
var = handle(object)
returns a handle of an object. A handle is a unique number that
internally identifies that object. The object can be an entity, an
action, a string, a bmap, a panel, or any pointer to them.

A handle is similar to a pointer, but is just a number and therefore
can be assigned to any variable or skill. After saving and loading a
game, a handle is guaranteed to reference always the same object -
this is not guaranteed for pointer parameters. For using a handle to
get the referenced object, it can be converted to a pointer, through
the following instruction.

ptr = ptr_for_handle(var)
assigns the object referenced by the given handle to a pointer.
Example:

my.skill40 = handle(you); // store a handle to the YOU entity
...
you = ptr_for_handle(my.skill40) // get the YOU entity back;

This way arbitrary objects can be stored in entity skills or var
arrays.

A lot of us have been waiting for this for a LONG time.

=WildCat



Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!
Re: Saving "YOU" synonym value for using later... #4595
12/06/02 01:02
12/06/02 01:02
Joined: Aug 2002
Posts: 572
Toronto
MadMark Offline
User
MadMark  Offline
User

Joined: Aug 2002
Posts: 572
Toronto
Is this storing of arbitrary objects in arrays available in the (5.203) version?

Mark


People who live in glass houses shouldn't vacuum naked.
Re: Saving "YOU" synonym value for using later... #4596
12/07/02 12:03
12/07/02 12:03
Joined: Oct 2002
Posts: 471
USA - Tennessee
JayG Offline
Senior Member
JayG  Offline
Senior Member

Joined: Oct 2002
Posts: 471
USA - Tennessee
I have been able to do it as long I converted the pointer to a handle first, and then back to a pointer when I need it. I think it is ptr_for_handle


Moderated by  HeelX, Spirit 

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