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, Grant, Neb), 908 guests, and 6 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
remove models during game. #407564
09/15/12 20:14
09/15/12 20:14
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
I need an action that removes all rit.mdl models that are
viseble during the game. I don't want them to be invisible but fully removed on a key press.
Is there an easy way ?


thx in advantage laugh


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: remove models during game. [Re: Realspawn] #407566
09/15/12 20:17
09/15/12 20:17
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You can use
ent_pvs (var num, var mode);
to check all potential visible entities and compare their filename with
str_for_entfile (STRING*, ENTITY*);
You may have to elaborate your issue for more precise help.


"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: remove models during game. [Re: Superku] #407598
09/16/12 15:19
09/16/12 15:19
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
I am not a great coder so sometimes i simply don't see or get it how to do some thingssss.

Here is what i need :

i have a var called bonus.

Now if 2 objects are picked up 1 will be added to this var so
the bonus wil stand on the nr 2.

if the var nr is 2 i need

- All models with the same name (say box.mdl) to be removed.
- Reset the var to 0 when all box.mdl are removed.

hope someone can provide me with a clear example

thank you

Last edited by Realspawn; 09/16/12 15:20.

Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: remove models during game. [Re: Realspawn] #407605
09/16/12 16:38
09/16/12 16:38
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I don't know how you pick up items but use EVENT_IMPACT or EVENT_CLICK. In their event you increase a variable, let's say bonus_count by one. Use a global while loop to check when bonus_count >= 2. If so, loop over all entities using
for(you = ent_next(NULL); you; you = ent_next(you)){...}.
In the loop you compare the entities' filenames using
str_for_entfile (STRING*, ENTITY*);
remove them if appropriate and reset the var afterwards.


"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

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